gt4sd-core icon indicating copy to clipboard operation
gt4sd-core copied to clipboard

Refactor AlgorithmConfiguration baseclass

Open jannisborn opened this issue 1 year ago • 0 comments

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 as domain: ClassVar[str]
  • the ones in the signatures like get_application_prefix which returns a str are because in the parent class those are class methods, not instance methods. THe error is Signature of "get_application_prefix" incompatible with supertype "AlgorithmConfiguration

It might be fixable by a refactor but I'm not sure it's worth it

jannisborn avatar Aug 12 '22 07:08 jannisborn