Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Feature API #45

Open
TobyBoyne opened this issue Jul 4, 2024 · 0 comments
Open

Rework Feature API #45

TobyBoyne opened this issue Jul 4, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@TobyBoyne
Copy link
Collaborator

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.

@TobyBoyne TobyBoyne added the enhancement New feature or request label Jul 4, 2024
@TobyBoyne TobyBoyne self-assigned this Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant