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

Refactor registration of features in RTDC-Hierarchy class #168

Open
maxschloegel opened this issue Feb 9, 2022 · 1 comment
Open

Refactor registration of features in RTDC-Hierarchy class #168

maxschloegel opened this issue Feb 9, 2022 · 1 comment

Comments

@maxschloegel
Copy link
Contributor

Due to the solution of #165, in a RTDC-Hierarchy instance the registration of features happens both in its apply_filter()-function and in its __getitem__()-function. Specifically this is the case for non-scalar features "image", "image_bg", "mask" (done in apply_filter()-function) and non-scalar temporary/plugin-features.

For clarity and cleaner code, this should be bundled into one external function being called in both, apply_filter() and __getitem__().

@paulmueller
Copy link
Member

paulmueller commented Feb 9, 2022

Other things that can be improved while fixing this:

The external function can be either

  • a "require_feature" function that is called in __getitem__ for each feature or
  • a "setup_features" function that is called always in __getitem__ and apply_filter

It should also be kept in mind that we have temporary and plugin features that, at any time point, may appear and disappear at the user's will. There should be tests against that to make sure that e.g. a hierarchy child does not return a temporary feature if that feature was deregistered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants