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

Move table representation builder #420

Merged
merged 8 commits into from
Aug 12, 2024

Conversation

mwcraig
Copy link
Contributor

@mwcraig mwcraig commented Aug 9, 2024

Fixes #408.

The root cause of #408 was that the mechanism for allowing an astropy Table to read/write our custom models was built into the model classes and not run unless one instantiated each of the models. As a result, if you tried reading a PhotometryData table before you instantiated a camera and an observatory then the read would fail.

This PR fixes the issue by ensuring that the code to add the table representations is run when stellarphot is imported.

This issue is hard to test for because if any code anywhere in the test suite makes a Camera and an Observatory hen the test passes. To ensure that we are testing for this failure I added a special tox case for it and added a workflow that runs that test.

@mwcraig mwcraig added the bug Something isn't working label Aug 9, 2024
@mwcraig mwcraig added this to the 2.0.0-beta milestone Aug 9, 2024
@mwcraig mwcraig requested a review from JuanCab August 9, 2024 21:12
@mwcraig mwcraig marked this pull request as draft August 9, 2024 21:13
@mwcraig
Copy link
Contributor Author

mwcraig commented Aug 9, 2024

Marked as a draft to make sure we get #419 in first

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.91%. Comparing base (f297b73) to head (3f7ae4b).
Report is 158 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
+ Coverage   78.87%   78.91%   +0.04%     
==========================================
  Files          29       30       +1     
  Lines        3815     3823       +8     
==========================================
+ Hits         3009     3017       +8     
  Misses        806      806              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mwcraig mwcraig marked this pull request as ready for review August 11, 2024 23:44
JuanCab
JuanCab previously approved these changes Aug 12, 2024
Copy link
Contributor

@JuanCab JuanCab left a comment

Choose a reason for hiding this comment

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

Interesting fix. I can't claim to understand the tox aspects of this, but the logic seemed sound.

stellarphot/tests/test_core_minimal_imports.py Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not fully conversant in or even have any experience at all withtox. So I did look over the tox stuff and understand the idea, although I can't really be relied on to catch any bugs in it. :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was marginally surprised the tox changes worked 🤣

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice solution to the testing problem.

@mwcraig mwcraig dismissed JuanCab’s stale review August 12, 2024 02:12

The merge-base changed after approval.

@mwcraig
Copy link
Contributor Author

mwcraig commented Aug 12, 2024

@JuanCab -- is this OK to merge once tests pass?

@JuanCab
Copy link
Contributor

JuanCab commented Aug 12, 2024

@JuanCab -- is this OK to merge once tests pass?

Yep

@mwcraig mwcraig merged commit 9a0aca6 into feder-observatory:main Aug 12, 2024
18 checks passed
@mwcraig mwcraig deleted the move-table-rep-builder branch August 12, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PhotometryData cannot read files it has written
2 participants