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 wcs_ref_models.py to reduce repeated methods #405

Open
emolter opened this issue Feb 18, 2025 · 0 comments
Open

Refactor wcs_ref_models.py to reduce repeated methods #405

emolter opened this issue Feb 18, 2025 · 0 comments

Comments

@emolter
Copy link
Contributor

emolter commented Feb 18, 2025

All of the models defined in wcs_ref_models need identical on_save and to_fits as well as much of the same functionality in their respective validate() methods. There is already a base class named _SimpleModel that contains these methods. However, there are 11 different models that do not inherit from _SimpleModel, so lots of repeated code remains.

It would be useful to refactor this (using, e.g., a mixin pattern) so that all the models can benefit from the implementations in the base class or classes.

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

1 participant