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

Fix metadata for islands queries #328

Merged
merged 12 commits into from
Mar 4, 2022
Merged

Fix metadata for islands queries #328

merged 12 commits into from
Mar 4, 2022

Conversation

ddobie
Copy link
Collaborator

@ddobie ddobie commented Feb 8, 2022

Fix #308.

@pep8speaks
Copy link

pep8speaks commented Feb 8, 2022

Hello @ddobie! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-03-02 23:56:54 UTC

@vast-bot
Copy link

vast-bot commented Feb 8, 2022

Hello @ddobie! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-02-08 07:13:19 UTC

@ddobie ddobie added this to In progress in v3.0.0 and full-survey data via automation Feb 8, 2022
@ddobie ddobie marked this pull request as ready for review February 8, 2022 07:17
@ddobie ddobie requested a review from ajstewart February 8, 2022 07:17
Copy link
Collaborator

@ajstewart ajstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my comment above, I'm not sure how easy it would be to try and test.

I was just a bit worried that this essentially opens up a third 'stream' of measurement types to deal with throughout the code (components, pipeline being the other two).

Comment on lines +1477 to +1516
'island_id': 'U',
'island_name': 'U',
'n_components': 'f',
'ra_hms_cont': 'U',
'dec_dms_cont': 'U',
'ra_deg_cont': 'f',
'dec_deg_cont': 'f',
'freq': 'f',
'maj_axis': 'f',
'min_axis': 'f',
'pos_ang': 'f',
'flux_int': 'f',
'flux_int_err': 'f',
'flux_peak': 'f',
'mean_background': 'f',
'background_noise': 'f',
'max_residual': 'f',
'min_residual': 'f',
'mean_residual': 'f',
'rms_residual': 'f',
'stdev_residual': 'f',
'x_min': 'i',
'x_max': 'i',
'y_min': 'i',
'y_max': 'i',
'n_pix': 'i',
'solid_angle': 'f',
'beam_area': 'f',
'x_ave': 'f',
'y_ave': 'f',
'x_cen': 'f',
'y_cen': 'f',
'x_peak': 'i',
'y_peak': 'i',
'flag_i1': 'i',
'flag_i2': 'i',
'flag_i3': 'i',
'flag_i4': 'i',
'comment': 'U',
'detection': '?'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering, do these different columns break anything further down the line? Is there a column missing that is explicitly referred to later on?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.

rms_image and flux_peak_err are missing which would break Source.write_measurements(simple=True). There is a background_noise which we could use to replace rms_image and we could probably also calculate flux_peak_error using the Condon et al. equations. On the other hand it might be better to just fill them with NaN values.

I've been thinking for some time that we really need some form of end-to-end testing that will pick up on this kind of thing, but I think it'd just be too hard to write.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.

rms_image and flux_peak_err are missing which would break Source.write_measurements(simple=True). There is a background_noise which we could use to replace rms_image and we could probably also calculate flux_peak_error using the Condon et al. equations. On the other hand it might be better to just fill them with NaN values.

If the end result is not too 'wrong', and for the sake of keeping it simple, I think yes, use what is already here to replace those columns. You might be able to get away with using background_noise for both? Just make sure it's documented in the docs or the code that this is happening.

I've been thinking for some time that we really need some form of end-to-end testing that will pick up on this kind of thing, but I think it'd just be too hard to write.

Yes it's very much only unit testing at the moment isn't it. It would probably snowball but it might be possible to get some sort of integration testing in there. You could move all the current tests under a unit directory i.e. tests/unit and then have an integration directory and test in there which does something end-to-end. The tricky bit is designing what that should be.

The notebooks always filled that void for me, but not ideal.

@ddobie
Copy link
Collaborator Author

ddobie commented Feb 17, 2022

Added placeholders, warnings and docs.

@ddobie ddobie requested a review from ajstewart March 2, 2022 23:54
Copy link
Collaborator

@ajstewart ajstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Maybe open an issue to act as leaving a note to try and make the testing more robust and end-to-end for these different types of catalogue inputs (components, islands, pipeline).

v3.0.0 and full-survey data automation moved this from In progress to Reviewer approved Mar 3, 2022
@ddobie ddobie merged commit d945bfb into dev Mar 4, 2022
v3.0.0 and full-survey data automation moved this from Reviewer approved to Done Mar 4, 2022
@ajstewart ajstewart deleted the iss308 branch March 4, 2022 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Update Query._get_components metadata to allow for islands queries
4 participants