-
Notifications
You must be signed in to change notification settings - Fork 1
Add load_field and load_group to allow loading custom entries using GenericNeXusWorkflow #278
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
Open
nvaytet
wants to merge
10
commits into
main
Choose a base branch
from
component-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
681179c
add component_types to contraints to allow loading custom entries in …
nvaytet 50ad6a0
add tests
nvaytet 43df02f
formatting
nvaytet ca661a1
fix LoadDetectorWorkflow tests
nvaytet b95ef2f
Merge branch 'main' into component-types
nvaytet 8fbb233
trying without component_types and adding a load_field
nvaytet f5a448e
Merge branch 'component-types' of github.com:scipp/essreduce into com…
nvaytet 49b4b4c
Apply automatic formatting
pre-commit-ci-lite[bot] e18cd6b
remove component_types in favor of providers that use load_field and …
nvaytet c43c1b0
Apply automatic formatting
pre-commit-ci-lite[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -691,16 +691,12 @@ def LoadMonitorWorkflow( | |
|
|
||
|
|
||
| def LoadDetectorWorkflow( | ||
| *, | ||
| run_types: Iterable[sciline.typing.Key], | ||
| monitor_types: Iterable[sciline.typing.Key], | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why we needed to have the monitor_types here, when we are loading detectors? |
||
| *, run_types: Iterable[sciline.typing.Key] | ||
| ) -> sciline.Pipeline: | ||
| """Generic workflow for loading detector data from a NeXus file.""" | ||
| wf = sciline.Pipeline( | ||
| (*_common_providers, *_detector_providers), | ||
| constraints=_gather_constraints( | ||
| run_types=run_types, monitor_types=monitor_types | ||
| ), | ||
| constraints=_gather_constraints(run_types=run_types, monitor_types=[]), | ||
| ) | ||
| wf[DetectorBankSizes] = DetectorBankSizes({}) | ||
| wf[PreopenNeXusFile] = PreopenNeXusFile(False) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 decided to add the
selectionas an arg here instead of going theNeXusComponentLocationSpecway as it would have required creating a newTypeVarwhich was not only forComponent, and then creating new types likeNeXusEntryLocationSpecand also some new(the analog to
component_spec_by_name: https://github.com/scipp/essreduce/blob/main/src/ess/reduce/nexus/workflow.py#L89).The current approach is less invasive.
But I don't mind implementing the above if there would be a use for it?
Right now, since the
load_fieldwould be called inside a custom providers, and selection parameters could simple be added to that provider, e.g.Not sure what other cases could be needed?