Skip to content

refactor: use parameter models from esslivedata#654

Draft
jokasimr wants to merge 1 commit into
mainfrom
refactor-widget-models
Draft

refactor: use parameter models from esslivedata#654
jokasimr wants to merge 1 commit into
mainfrom
refactor-widget-models

Conversation

@jokasimr

Copy link
Copy Markdown
Contributor

Fixes #653

This is a codex rewrite of the parameter / workflow widget system using the models from esslivedata.

@jokasimr jokasimr requested a review from SimonHeybrock June 26, 2026 13:14
@github-actions github-actions Bot added essdiffraction Issues for essdiffraction. essreduce Issues for essreduce. esssans Issues for esssans. labels Jun 26, 2026
Comment on lines +52 to +67
DetectorBank.south: {'y': 200, 'x': 500},
DetectorBank.north: {'y': 200, 'x': 500},
},
KeepEvents[RunType]: KeepEvents(False),
TwoThetaMask: lambda two_theta: (
(two_theta < sc.scalar(float('inf'), unit=two_theta.unit))
| (two_theta > sc.scalar(float('-inf'), unit=two_theta.unit))
),
TofMask: None,
WavelengthMask: None,
MaskedDetectorIDs: MaskedDetectorIDs({}),
NeXusDetectorName: "detector",
DetectorBank: DetectorBank.south,
Filename[SampleRun]: str(mcstas_powder_silicon_in_vanadium_can()),
Filename[VanadiumRun]: str(mcstas_powder_vanadium()),
Filename[EmptyCanRun]: str(mcstas_powder_empty_can()),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These changes will be revisited or removed.

They were added mainly for debugging purposes.

stop=self.stop,
num=self.num_bins + 1,
unit=self.unit.value,
)

@jokasimr jokasimr Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why does this have to be re-implemented here?
Looks like only the dim and descriptions should need to be specified.

# TODO: for now, we leave the mapping over detector banks out, because we do not have a
# method to merge the I(Q) of different banks, and we thus cannot compute a single
# result from the workflow. So only a single detector bank can be processed at a time.
# parameter_mappers[NeXusDetectorName] = with_banks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment should not be removed.

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. esssans Issues for esssans.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate workflow specifications, parameter models, and metadata mechanisms

1 participant