-
Notifications
You must be signed in to change notification settings - Fork 13
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
Combine raw & proc in open_run() by default #569
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave the tests only a brief look, as I suspect the non-default
parts are copied verbatim.
The main logic looks good. LGTM, apart from some minor code flow recommendations.
extra_data/reader.py
Outdated
if origin not in absence_ok: | ||
if base_dc is None: | ||
raise | ||
warn(f'No data available for this run at origin {origin}') | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably go for a continue
in the except
branch, and move the entire else
branch to after the complete try-except
to avoid a level of indentation for so much code. I realize this has been like this before (written by me 🙃), but the logic seems complicated enough now that it seems useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done
This now also fixes a bug @JamesWrigley noticed, where specifying |
This adds a new
data='default'
option (which becomes the default) to combine raw & proc data, preferring raw where names clash. For new data, this means you can access corrected detector data with the new source names (e.g.*/CORR/*
), alongside raw data with names like*/DET/*
. For older data, there will be no difference fromdata='raw'
.open_run()
without passingdata=
and then uses a detector component likeAGIPD1M()
previously got raw data, but would now get corrected data when reading runs with the new source names. But hopefully this isn't common, and it's easily fixed.A large part of the diff is just moving some existing tests to a new file, so it may be easier to review by commit.