Skip to content

Rework Feature API #45

@TobyBoyne

Description

@TobyBoyne

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions