-
Notifications
You must be signed in to change notification settings - Fork 1
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 class hierarchy of NB2WProduct #130
Conversation
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.
When I wrote this class, it was not intended to be directly initialised, serving as something like an abstract base class.
But if it actually works for the general-purpose NumpyDataProduct
, then OK, let's use it like this.
There is some violation of the logic, however. The oda:DataProduct
ontology class is a parent for every kind of products, not only NumpyDataProduct
-based. So maybe it makes sense to introduce some term like oda:NumpyDataProduct
to the ontology and have it as a type_key
here. But in this case, python class hierarchy is different from ontology class hierarchy. Reconciling this will require some more involved refactoring.
To summarise, having this as a hotfix for the specific issue is OK for me, but I would let @volodymyrss and @burnout87 comment on this
As a sidenote: I don't like the name |
I will try to discuss with @burnout87 on Monday. An alternative would be to introduce a derived class for the Fits(Numpy)DataProduct to preserve the logic or to make a check in nb2worflow for the attribute existence |
Having a dedicated class for a Numpy-based product makes sense, this would allow us to have the To add: I would avoid renaming the classes, especially those in the |
@burnout87 why don't you use this PR to implement such a class without my hack ? |
You can use JEM-X expert test_notebook for spectra to test this (I have set appropriate parameters) |
As soon as Denys approves it, could you merge? It would be nice to have notebooks finally working also for the outputs. |
This solves issue #129