Currently, there are a few issues with the feature API:
Instance methods: the methods such as is_cat() should be class attributes, not instance methods, as they do not require processing and do not vary between instances
Validation: currently, validation is performed in the ProblemConfig.add_feature method. The responsibility to validate should belong to the feature
Naming: each class should have Feature at the end to make it clear that this is a custom object for representing features.
Each of these changes would break the existing API, so I am deferring these changes until the next major release. A good solution would use attrs to create dataclasses.
We should also consider whether using an existing API like bofire would be feasible.
Currently, there are a few issues with the feature API:
is_cat()
should be class attributes, not instance methods, as they do not require processing and do not vary between instancesProblemConfig.add_feature
method. The responsibility to validate should belong to the featureFeature
at the end to make it clear that this is a custom object for representing features.Each of these changes would break the existing API, so I am deferring these changes until the next major release. A good solution would use
attrs
to create dataclasses.We should also consider whether using an existing API like bofire would be feasible.