Skip to content

Move types to subpackages - #607

Merged
jl-wynen merged 3 commits into
mainfrom
move-types-to-subpackages
Jun 9, 2026
Merged

jl-wynen merged 3 commits into
mainfrom
move-types-to-subpackages

Conversation

@jl-wynen

Copy link
Copy Markdown
Member

First step of #70

@jl-wynen
jl-wynen requested a review from nvaytet May 28, 2026 08:50
@github-actions github-actions Bot added essdiffraction Issues for essdiffraction. essreduce Issues for essreduce. essreflectometry Issues for essreflectometry. esssans Issues for esssans. essspectroscopy Issues for essspectroscopy. labels May 28, 2026
@github-actions

Copy link
Copy Markdown

Hi! Your PR was missing some labels 🔖 so I added them: essdiffraction essreduce essreflectometry esssans essspectroscopy

@nvaytet nvaytet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks good but I am worried the changes are going to clash a lot with #603 😬
Which one should we merge first?

@jl-wynen

jl-wynen commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Depends on how close that PR is to merging? Resolving conflicts should be simple

@nvaytet

nvaytet commented Jun 1, 2026 •

Copy link
Copy Markdown
Member

My guess is that it will still take a while to figure everything out correctly in that PR.
So that answers my question...

"""Incident monitor"""
TransmissionMonitor = NewType('TransmissionMonitor', int)
"""Transmission monitor"""
FrameMonitor0 = NewType('FrameMonitor0', int)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would there be any use in providing a default set of monitors? (Monitor1-4?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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.

like ``SampleRun`` or ``BackgroundRun``.
"""

SampleRun = NewType('SampleRun', int)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is the SampleRun special?
Shouldn't we remove all in the future, and sub-packages can decide if they want to name it SampleRun or something else?

Is there any code internally to essreduce that makes use of SampleRun or is it only in the tests/docs?

Copy link
Copy Markdown
Member Author

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 live and polarization. Removing the ones in live might be tricky. But maybe that code should be in esslivedata anyway? And for polarization, there is this: #615

Copy link
Copy Markdown
Member

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 essreduce could just be RunType, unless I am forgetting something?

But maybe that code should be in esslivedata anyway?

Yes, I would vote to move it there.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think every instrument does sample-runs, so having a unified name makes sense (or else every instrument will have their own naming convention)?

In ESSlivedata I actually just used this as a default in some cases. Defining AnyRun would be more thruthful. But there are probably also uses via technique packages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

or else every instrument will have their own naming convention

They seem to already do that with BackgroundRun, OpenBeamRun, EmptyRun, DirectRun... so maybe leaving the freedom to define a sample run is not so different?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So was the conclusion here to keep SampleRun and move forwards with the changes as they are?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think so.

@jl-wynen
jl-wynen force-pushed the move-types-to-subpackages branch from 64cc4ae to 883f409 Compare June 8, 2026 12:39
@jl-wynen
jl-wynen force-pushed the move-types-to-subpackages branch from 883f409 to cccaf77 Compare June 8, 2026 12:46
@jl-wynen
jl-wynen added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 1045bea Jun 9, 2026
24 checks passed
@jl-wynen
jl-wynen deleted the move-types-to-subpackages branch June 9, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essdiffraction Issues for essdiffraction. essreduce Issues for essreduce. essreflectometry Issues for essreflectometry. esssans Issues for esssans. essspectroscopy Issues for essspectroscopy.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants