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

Add tool for migrating stellarphot v1 data to stellarphot v2 #471

Merged
merged 6 commits into from
Oct 13, 2024

Conversation

mwcraig
Copy link
Contributor

@mwcraig mwcraig commented Oct 12, 2024

This adds a way to update v1 data so that it can be used in v2. This will help remove the need to redo a bunch of photometry while allowing users to take advantage of the new stuff in v2.

NOTE: #470 should be merged first, because that fix was necessary for this PR to work.

@mwcraig mwcraig added this to the 2.0.0-beta milestone Oct 12, 2024
@mwcraig mwcraig requested a review from JuanCab October 12, 2024 21:35
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.32%. Comparing base (5260c1c) to head (6b267ce).
Report is 59 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #471      +/-   ##
==========================================
+ Coverage   80.05%   80.32%   +0.27%     
==========================================
  Files          31       32       +1     
  Lines        4011     4067      +56     
==========================================
+ Hits         3211     3267      +56     
  Misses        800      800              

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

JuanCab
JuanCab previously approved these changes Oct 13, 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.

Looks good... At least the column renaming and so forth. I am curious about units (since no explicit unit conversion done). See my notes. Approve, but would appreciate feedback and typo corrections.

@@ -438,6 +438,9 @@ def __init__(
**kwargs,
)

# From this point forwarsd we should be using self to get at any data
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# From this point forwarsd we should be using self to get at any data
# From this point forward we should be using self to get at any data

Same typo noted in #470

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was fixed there

stellarphot/utils/tests/test_version_migrator.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.

A little confused why you created a fixture for this rather than just creating a new and old version of the testing file... it it just to allow iteration of test cases via the fixture?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a through test suite as far as I can tell, kind of explains the weird fixture I noted earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, was using it a few different times

Comment on lines +132 to +136
# Note that this deliberately discards any unit that might have been
# present in the original data. This is a stellarphot-specific migration
# tool, not something more general, and the choices above are the correct
# units for the data.
new_data[un] = new_data[un].value * unitify[un]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we potentially have unit conversion issues here? Or were these units also used in v1 but just not attached to the columns? I don't remember.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The old almost never included units, but it depended on whether the photometry was saved as CSV (no units saved) or FITS (units sometimes present for some things). This is maybe a little risky, but for feder data the image unit was always ADU, times, in seconds, etc.

No one else ever used v1 as far as I know, so this should be ok, I think

stellarphot/utils/version_migrator.py Outdated Show resolved Hide resolved
@mwcraig mwcraig dismissed JuanCab’s stale review October 13, 2024 20:59

The merge-base changed after approval.

@mwcraig mwcraig merged commit a84498c into feder-observatory:main Oct 13, 2024
15 of 16 checks passed
@mwcraig mwcraig deleted the migration-tool branch October 13, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants