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

Only average over trains dimension in Scan.bin_by_steps() #269

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

takluyver
Copy link
Member

This came up at FXE: if you have an array with multiple values per train, such as a spectrum, you naturally want an average spectrum per scan step, but scan.bin_by_steps(arr) reduces it down to a single number per scan step instead.

This could theoretically break code that relies on it collapsing extra dimensions, but I'm not sure when you'd want that, and it's very easy to do further averaging on the results from this if you need to. So I hope we can just consider it a bug and fix it. 🤞

cc @bermudei

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.93%. Comparing base (65ca7c8) to head (57ab6f3).
Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #269   +/-   ##
=======================================
  Coverage   73.93%   73.93%           
=======================================
  Files          23       23           
  Lines        2996     2996           
=======================================
  Hits         2215     2215           
  Misses        781      781           

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

Copy link
Member

@JamesWrigley JamesWrigley left a comment

Choose a reason for hiding this comment

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

Won't this also remove the extra dimension names and such? It'd be nice to preserve those if possible. This should also have a test.

@takluyver
Copy link
Member Author

You're quite right, I hadn't read the code carefully enough. 👍

Copy link
Member

@JamesWrigley JamesWrigley left a comment

Choose a reason for hiding this comment

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

LGTM!

@takluyver takluyver merged commit 2d0ba3c into master Dec 13, 2024
11 checks passed
@takluyver takluyver deleted the scan-bin-mean-trainId branch December 13, 2024 11:02
@takluyver
Copy link
Member Author

Thanks!

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