-
Notifications
You must be signed in to change notification settings - Fork 3
Karr/finalWorkflow #168
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
base: main
Are you sure you want to change the base?
Karr/finalWorkflow #168
Conversation
sesquideus
left a comment
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.
From my side it looks fine -- I have a few minor reservations but that can be improved later.
|
|
||
|
|
||
|
|
||
| class SciCentred(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True): |
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.
Currently this does not seem to be crgph-specific.
|
|
||
|
|
||
| class LmAppSciCentred(BandLmMixin, CgrphAppMixin, SciCentred): | ||
| _name_template = r"{band}_APP_SCI_CENTRED" |
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.
If this is indeed something that can be parameterized by cgrph, the name template should most likely read r'{band}_{cgrph}_SCI_CENTRED
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.
I don't yet fully understand how the abstraction works, so I might misunderstand.
The CgrphAppMixin implies that the class is partially specialized and thus that cgrph part of the template name is correctly substituted with (by?) APP.
But then I would expect the same with the band: the BandLmMixin is used, and the class is called LmAppSciCentred, so I think the template name should be LM_APP_SCI_CENTRED.
| from pymetis.classes.mixins.cgrph import CgrphSpecificMixin | ||
|
|
||
|
|
||
| class IfuOffAxisPsfRaw(ImageDataItem, abstract=True): |
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.
Fully specialized data items should not be abstract (in fact that could be the definition and in that case we can dispense with abstract altogether).
hugobuddel
left a comment
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.
Good, almost the full workflow complete!
It seems that there are several small mistakes that need to be rectified. I probably have missed some too, so please check. There are also several duplicate classes, that I think is an accident.
I suggest to either create these classes automatically, or at least use a script to verify that they are correct.
Also, please reuse the names we already have. It is confusing to see the name of a task, and then have to guess which recipe it corresponds to. Reinventing names adds friction for no reason that I can discern.
Can you also please address the open comments on #167? You essentially resubmitted that PR for review, and apparently I now reviewed partially the same code twice.
Nevertheless, thanks for taking on this tedious task!
| pass | ||
|
|
||
|
|
||
| class LmRavcCentroidTab(BandLmMixin, CgrphAppMixin, CentroidTab): |
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.
I think this is exactly the same as the next class; did you mean
| class LmRavcCentroidTab(BandLmMixin, CgrphAppMixin, CentroidTab): | |
| class LmAppCentroidTab(BandLmMixin, CgrphAppMixin, CentroidTab): |
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.
hciApp.py was redundant; I temporarily forgot I had defined all the imaging data classes with the first HCI workflow. I have removed it.
|
|
||
|
|
||
| class LmAppSciCentred(BandLmMixin, CgrphAppMixin, SciCentred): | ||
| _name_template = r"{band}_APP_SCI_CENTRED" |
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.
I don't yet fully understand how the abstraction works, so I might misunderstand.
The CgrphAppMixin implies that the class is partially specialized and thus that cgrph part of the template name is correctly substituted with (by?) APP.
But then I would expect the same with the band: the BandLmMixin is used, and the class is called LmAppSciCentred, so I think the template name should be LM_APP_SCI_CENTRED.
| class IfuOffAxisPsfRaw(ImageDataItem, abstract=True): | ||
|
|
||
| _name_template = r'IFU_OFF_AXIS_PSF_RAW' | ||
| _title_template = r"IFU RAVC sci calibration" |
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.
Is IfuOffAxisPsfRaw only applicable to RAVC? Could be
| class IfuRavcSciThroughput(CgrphAppMixin, IfuSciThroughput): | ||
| pass | ||
|
|
||
| class IfuCvcSciThroughput(CgrphAppMixin, IfuSciThroughput): | ||
| pass | ||
|
|
||
| class IfuAppSciThroughput(CgrphAppMixin, IfuSciThroughput): | ||
| pass |
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.
These Mixin's are all for App, that doesn't seem right. Maybe
| class IfuRavcSciThroughput(CgrphAppMixin, IfuSciThroughput): | |
| pass | |
| class IfuCvcSciThroughput(CgrphAppMixin, IfuSciThroughput): | |
| pass | |
| class IfuAppSciThroughput(CgrphAppMixin, IfuSciThroughput): | |
| pass | |
| class IfuRavcSciThroughput(CgrphRavcMixin, IfuSciThroughput): | |
| pass | |
| class IfuCvcSciThroughput(CgrphCvcMixin, IfuSciThroughput): | |
| pass | |
| class IfuAppSciThroughput(CgrphAppMixin, IfuSciThroughput): | |
| pass |
| class IfuRavcSciCentred(CgrphAppMixin, IfuSciCentred): | ||
| pass | ||
|
|
||
| class IfuRavcCentroidTab(CgrphAppMixin, IfuCentroidTab): | ||
| pass | ||
|
|
||
| class IfuCvcSciCentred(CgrphAppMixin, IfuSciCentred): | ||
| pass | ||
|
|
||
| class IfuCvcCentroidTab(CgrphAppMixin, IfuCentroidTab): | ||
| pass |
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.
| class IfuRavcSciCentred(CgrphAppMixin, IfuSciCentred): | |
| pass | |
| class IfuRavcCentroidTab(CgrphAppMixin, IfuCentroidTab): | |
| pass | |
| class IfuCvcSciCentred(CgrphAppMixin, IfuSciCentred): | |
| pass | |
| class IfuCvcCentroidTab(CgrphAppMixin, IfuCentroidTab): | |
| pass | |
| class IfuRavcSciCentred(CgrphRavcMixin, IfuSciCentred): | |
| pass | |
| class IfuRavcCentroidTab(CgrphRavcMixin, IfuCentroidTab): | |
| pass | |
| class IfuCvcSciCentred(CgrphCvcMixin, IfuSciCentred): | |
| pass | |
| class IfuCvcCentroidTab(CgrphCvcMixin, IfuCentroidTab): | |
| pass |
| return {product_lmSciCalibrated, product_lmSciCentred, product_lmSciCentred, product_lmCentroidTable, product_lmSciHifilt, product_lmSciDerotatedPsfsub, product_lmSciDerotated, product_lmSciContrastRadprof, product_lmSciContrastAdi, product_lmSciThroughput, product_lmSciCoverage, product_lmSciSnr, product_lmSciPsfMedian} | ||
|
|
||
|
|
||
| class MetisLmAppSciCalibrated(MetisRecipe): |
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.
Idem, here I would expect the name MetisLmAdiApp
| ifu_ravc_post_task = (task('ifu_ravc_post') | ||
| .with_recipe('metis_ifu_adi_cgrph') |
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.
Place name the tasks like the recipes as much as feasible, otherwise everyone has to learn too many different names. The recipe, the recipe class, the edps task can all have names that are simply different forms of the same thing.
| ifu_ravc_post_task = (task('ifu_ravc_post') | |
| .with_recipe('metis_ifu_adi_cgrph') | |
| ifu_adi_ravc_task = (task('ifu_adi_ravc_task') | |
| .with_recipe('metis_ifu_adi_cgrph') |
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.
I renamed the tasks, and pushed the changes.
| class CentroidTab(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True): | ||
|
|
||
| _name_template = r'{band}_RAVC_CENTROID_TAB' | ||
| _title_template = r"{band} RAVC centroid tab" |
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.
I can't say that I fully understand the abstraction layer, but I would not expect RAVC here, because I wouldn't know where the CVC equivalent would go. Or does that not exist?
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.
If it is cgrph-specific, it should naturally say r'{band}_{cgrph}_CENTROID_TAB'. If it is not, CgrphSpecificMixin should go away.
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.
That is the thought I had too, either CgrphSpecificMixin and {cgrph} in the name, or neither.
The nomenclature is quite confusing though. I interpreted the term "cgrph-specific" as meaning "for a specific coronograph", e.g. "for the RAVC coronograph".
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.
I just finished a better structure, in which this is no longer needed at all. Setting CgrphRavcMixin in the derived class will be enough.
| class AdiCalibrated(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True): | ||
|
|
||
| _name_template = r'{band}_RAVC_SCI_CALIBRATED' | ||
| _title_template = r"{band} RAVC sci calibration" |
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.
This class mentions RAVC, in fact, most of the classes in this file do. But this file is in the appHci.py file. I would expect APP classes in a file with that name. Maybe I don't understand things properly, at least it is confusing.
| 'DET1.DATA': Image, | ||
| } | ||
|
|
||
| class SciDerotated(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True): |
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.
Most of these classes are now defined both in hci.py and in appHci.py. We could do that, but I think it would be better if we give the classes unique names.
Also, it seems the classes have the same _name_template, and I don't think that is allowed, because aren't those the unique identifiers of the class?
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.
Or in case you actually need to use the same class in different places, you can just import them. (If that leads to circular imports, then you can refactor them by putting all the shared classes in a separate file.)
deleted superfluous file
Basic implementation of the third workflow/recipes for ADI. A bit rough, but it produces the correct output.