gt4sd-core
gt4sd-core copied to clipboard
Refactor AlgorithmConfiguration baseclass
Inconsistent types between AlgorithmConfiguration
base class and the child ConfigurablePropertyAlgorithm Configuration
, concerning attributes like domain
but also methods like ensure_artifacts_for_version
(class methods in the base class but instance methods in the base class).
A simple refactor into 3 instead of 2 classes should fix this.
Originally posted by @jannisborn in https://github.com/GT4SD/gt4sd-core/pull/121#discussion_r943649339
- So the ones in the contstructor for lines like
self.domain=domain
says:error: Cannot assign to class variable "domain" via instance
. That's because in the parent class (AlgorithmConfiguration
) we set it asdomain: ClassVar[str]
- the ones in the signatures like
get_application_prefix
which returns astr
are because in the parent class those are class methods, not instance methods. THe error isSignature of "get_application_prefix" incompatible with supertype "AlgorithmConfiguration
It might be fixable by a refactor but I'm not sure it's worth it