-
Notifications
You must be signed in to change notification settings - Fork 1
Move types to subpackages #607
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,11 @@ class ProductionInfo(snx.NXsource): | |
| like ``SampleRun`` or ``BackgroundRun``. | ||
| """ | ||
|
|
||
| SampleRun = NewType('SampleRun', int) | ||
| """Sample run.""" | ||
|
|
||
| # The following are legacy types and will be removed in the future. | ||
| # Use the types defined in technique packages instead. | ||
| BackgroundRun = NewType('BackgroundRun', int) | ||
| """Background run such as a run with only a solvent which the sample is placed in.""" | ||
| EmptyBeamRun = NewType('EmptyBeamRun', int) | ||
|
|
@@ -66,8 +71,6 @@ class ProductionInfo(snx.NXsource): | |
|
|
||
| It is used for reading the data from the transmission monitor. | ||
| """ | ||
| SampleRun = NewType('SampleRun', int) | ||
| """Sample run.""" | ||
| VanadiumRun = NewType('VanadiumRun', int) | ||
| """Vanadium run.""" | ||
|
|
||
|
|
@@ -103,40 +106,24 @@ class TransmissionRun(Generic[ScatteringRunType]): | |
| - :class:`VanadiumRun` | ||
| """ | ||
|
|
||
|
|
||
| # 1.2 Monitor types | ||
| IncidentMonitor = NewType('IncidentMonitor', int) | ||
| """Incident monitor""" | ||
| TransmissionMonitor = NewType('TransmissionMonitor', int) | ||
| """Transmission monitor""" | ||
| FrameMonitor0 = NewType('FrameMonitor0', int) | ||
|
Member
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. Would there be any use in providing a default set of monitors? (
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. I don't think so. We shouldn't use them in workflows because they carry no meaning. So I think they would only be good for testing, and then we can easily define them in the tests. |
||
| """Frame monitor number 0""" | ||
| FrameMonitor1 = NewType('FrameMonitor1', int) | ||
| """Frame monitor number 1""" | ||
| FrameMonitor2 = NewType('FrameMonitor2', int) | ||
| """Frame monitor number 2""" | ||
| FrameMonitor3 = NewType('FrameMonitor3', int) | ||
| """Frame monitor number 3""" | ||
| CaveMonitor = NewType('CaveMonitor', int) | ||
| """A monitor located in the instrument cave""" | ||
| MonitorType = TypeVar('MonitorType') | ||
| """TypeVar for specifying what monitor some data belongs to. | ||
|
|
||
| This type must be constrained when used in a Sciline pipeline. | ||
| E.g., by passing ``monitor_types`` to :class:`ess.reduce.nexus.GenericNeXusWorkflow`. | ||
|
|
||
| ESSreduce provides the following but custom types can be used: | ||
|
|
||
| - :class:`IncidentMonitor` | ||
| - :class:`TransmissionMonitor` | ||
| - :class:`FrameMonitor0` | ||
| - :class:`FrameMonitor1` | ||
| - :class:`FrameMonitor2` | ||
| - :class:`FrameMonitor3` | ||
| - :class:`CaveMonitor` | ||
| """ | ||
|
|
||
| # The following are legacy types and will be removed in the future. | ||
| # Use the types defined in technique packages instead. | ||
| IncidentMonitor = NewType('IncidentMonitor', int) | ||
| """Incident monitor""" | ||
| TransmissionMonitor = NewType('TransmissionMonitor', int) | ||
| """Transmission monitor""" | ||
| CaveMonitor = NewType('CaveMonitor', int) | ||
| """A monitor located in the instrument cave""" | ||
|
|
||
| # 1.3 Other component types | ||
| Component = TypeVar('Component') | ||
| """A beamline component in a NeXus file.""" | ||
| COMPONENT_CONSTRAINTS = ( | ||
|
|
||
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.
Why is the
SampleRunspecial?Shouldn't we remove all in the future, and sub-packages can decide if they want to name it
SampleRunor something else?Is there any code internally to
essreducethat makes use ofSampleRunor is it only in the tests/docs?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.
It is special in how I and maybe we think about workflows. But that is not a good argument on its own.
There are some uses in
liveandpolarization. Removing the ones inlivemight be tricky. But maybe that code should be inesslivedataanyway? And for polarization, there is this: #615There 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 have thought that everything in
essreducecould just beRunType, unless I am forgetting something?Yes, I would vote to move it there.
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.
@SimonHeybrock ?