-
Notifications
You must be signed in to change notification settings - Fork 5
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
Reimplement dataaccessor #66
Conversation
… metaclass=RequiredAttributesMetaclass), i.e. DataAccessor inheriting from RequiredAttributesMetaclass is an overkill, since RequiredAttributesMetaclass does nothing more than checking for required attributes. requiredatts.py can be removed and DataAccessor can be turned into a dataclass, which will have the required arguments declared.
…ired attributes is much simpler achieved by defining a Python dataclass instead of inheriting from a metaclass.
… Third commit of this sort.
… parent class of FitsImage is a dataclass. In this case that will yield: TypeError: DataAccessor.__init__() missing 11 required positional arguments:....
Probably some loose ends although all unit tests pass, since
|
The line
Apparently not implemented yet. Should not be solved as part of this PR. |
The other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @HannoSpreeuw, I'll approve these for now since the tests pass. But I don't think this is completely there yet. There are some inconsistencies that I would like to address. I'll open a separate issue to collect everything I spotted, and we can address that in a separate PR.
Because of the above reason and #65, maybe #53 should still be open.
Allright. |
Following @suvayu on replacing DataAccessor by a dataclass.
DataAccessor was inheriting from RequiredAttributesMetaclass.
This way of enforcing required attributes seems too heavy machinery and the dataclass is a a lightweight solution.
Should also fix #53