-
Notifications
You must be signed in to change notification settings - Fork 36
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
Include params in HDF5 output #142
Conversation
array=np.array([d.params['min_delta']])) | ||
col3 = fits.Column(name='min_value', format='E', | ||
array=np.array([d.params['min_value']])) | ||
|
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.
Should these parameters be in the fits header instead of a new extension? That would seem more standard to me
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.
Yes, I agree, these belong in the header (I think of the primary HDU)
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.
Thanks, the table seemed quite clunky. I moved them to the header.
It should be mentioned that the parameters are also saved via the FITS output, despite the title of the PR. @astrofrog @ChrisBeaumont - I think this is ready to be reviewed. |
Looks good to me! |
I had the wrong values being passed to the wrong keywords in the header.
|
Ah good point -- perhaps this PR should also update the implementation of |
Two issues have cropped up now that I'm not quite sure how to address properly:
|
@ChrisBeaumont @astrofrog -- I've asked (and googled) around a bit about handling infs in FITS headers and have not gotten a decisive answer. Do either of you have an idea for handling this? Instead of using |
That sounds like a reasonable workaround to me.
Would it be easy in this PR to modify test_benchmark to fix this? Sorry for letting this get stale. The code changes here look good to me so, if you can add the above workarounds to get the test suite to pass, I'm fine with merging |
@ChrisBeaumont - I altered As for |
@ChrisBeaumont - I altered Do you have any thoughts on this approach? It should enable equality tests in the cases that a custom function is provided (like in |
self_params = self.params | ||
other_params = other.params | ||
|
||
self_params.pop('min_value') |
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.
ooo careful here -- pop
permanently mutates the params dict of the parent dendrograms. Better to set self_params = self.params.copy(), other_params = other.params.copy()
@e-koch 2 minor comments, but I'm OK with merging once they are addressed. |
@ChrisBeaumont - Thanks! Should be ready to merge now. |
|
||
# Hack for not comparing params that have not been set | ||
# There is currently no explicit way to tell if it has not been set | ||
# We assume that if it is =0, then it is not set and won't be compared |
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.
👍
Thanks! |
Include params in HDF5 output
The parameters dictionary isn't currently included when saving. This just adds that ability to the import and export functions.