Skip to content

Conversation

@j-c-c
Copy link
Collaborator

@j-c-c j-c-c commented Jul 14, 2025

Adopt Relion's newer offsets metadata fields: #1118

  • adopt _rlnOriginX(Y)Angst in favor of _rlnOriginX(Y)
  • Still read in both conventions
  • Internally use new convention in metadata
  • Will save off in new convention

@j-c-c j-c-c self-assigned this Jul 14, 2025
@j-c-c j-c-c added cleanup extern Relating to external changes labels Jul 14, 2025
@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

❌ Patch coverage is 97.75281% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.65%. Comparing base (04948e6) to head (2cea2fc).
⚠️ Report is 45 commits behind head on develop.

Files with missing lines Patch % Lines
src/aspire/downloader/data_fetcher.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1302      +/-   ##
===========================================
+ Coverage    90.61%   90.65%   +0.04%     
===========================================
  Files          133      133              
  Lines        14389    14433      +44     
===========================================
+ Hits         13038    13084      +46     
+ Misses        1351     1349       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@garrettwrong
Copy link
Collaborator

What's the update here? Thanks

@j-c-c j-c-c mentioned this pull request Aug 6, 2025
@j-c-c
Copy link
Collaborator Author

j-c-c commented Aug 6, 2025

What's the update here? Thanks

The update is I felt very unsatisfied with this implementation. It changes the behavior of our ImageSource classes and involved adapting a lot of tests. I've opened a PR (#1317) that maintains current behavior of our ImageSource classes and just updates the metadata convention for offsets. Going to leave both PRs until we have a chance to discuss which is preferred.

@j-c-c j-c-c mentioned this pull request Aug 7, 2025
@j-c-c j-c-c changed the base branch from develop to pxsz September 16, 2025 15:05
Base automatically changed from pxsz to develop September 24, 2025 18:05
@garrettwrong
Copy link
Collaborator

Cool. This is still a fair amount of changes, but a lot of it is test code, so I think we can get it in this release if it can be made ready soon. Thanks

@garrettwrong garrettwrong mentioned this pull request Oct 7, 2025
@j-c-c j-c-c requested a review from garrettwrong October 8, 2025 12:32
Copy link
Collaborator

@garrettwrong garrettwrong left a comment

Choose a reason for hiding this comment

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

Sorry, almost there, one issue, otherwise minor tweaks and this'll be good enough to push forward. This source stuff gets dicey fast.

Thanks!

rln_src_32.offsets, sim.offsets, rtol=0, atol=atol, strict=True
)
np.testing.assert_allclose(rln_src_64.offsets, sim.offsets, rtol=0, atol=atol)
np.testing.assert_allclose(rln_src_32.offsets, sim.offsets, rtol=0, atol=atol)
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool thanks

@j-c-c
Copy link
Collaborator Author

j-c-c commented Oct 8, 2025

@garrettwrong Ok, sorry that took until end of day. Here you go.

@j-c-c j-c-c requested a review from garrettwrong October 8, 2025 20:09
@j-c-c j-c-c requested a review from garrettwrong October 9, 2025 12:46
garrettwrong
garrettwrong previously approved these changes Oct 9, 2025
Copy link
Collaborator

@garrettwrong garrettwrong left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@j-c-c j-c-c marked this pull request as ready for review October 9, 2025 12:57
@j-c-c j-c-c requested a review from janden as a code owner October 9, 2025 12:57
Copy link
Collaborator

@janden janden left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on this.

Looks great! Just a few things.

centered_fft=self.centered_fft,
)

return Image(im_ds, pixel_size=im.pixel_size).stack_reshape(
Copy link
Collaborator

Choose a reason for hiding this comment

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

So we are bypassing the standard Image.downsample method in order to keep the pixel_size the same. Why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By the time this generation pipeline is kicked off by requesting images the pixel_size has already been adjusted as an image attribute and in metadata in the ImageSource.downsample method. If we use Image.downsample here the pixel size will get adjusted twice.

if not close:
warnings.warn(
f"User provided pixel_size: {reference_pixel_size} angstrom, does not match"
f" pixel_size found in metadata: {pixel_sizes} angstrom. Setting"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a little confusing, since I don't think we always check the return value and act on it. Should this be updated?

janden
janden previously approved these changes Oct 17, 2025
@j-c-c j-c-c dismissed stale reviews from janden and garrettwrong via 7d10379 October 17, 2025 14:52
@j-c-c j-c-c merged commit 38069c0 into develop Oct 17, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup extern Relating to external changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants