Skip to content

Allow passing a detector name to extra-data-make-virtual-cxi#599

Open
JamesWrigley wants to merge 2 commits intomasterfrom
vds
Open

Allow passing a detector name to extra-data-make-virtual-cxi#599
JamesWrigley wants to merge 2 commits intomasterfrom
vds

Conversation

@JamesWrigley
Copy link
Copy Markdown
Member

This is necessary for runs with multiple multi-module detectors.

This is necessary for runs with multiple multi-module detectors.
@JamesWrigley JamesWrigley self-assigned this Feb 19, 2025
run = RunDirectory(run_dir, inc_suspect_trains=inc_suspect)

_, det_class = identify_multimod_detectors(run, single=True)
_, det_class = identify_multimod_detectors(run, detector_name=args.detector_name, single=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi James,
I'm afraid this would not work in the current implementation, because this argument, 'detector_name', is not currently used by the 'identify_multimod_detectors' function at all 😓

Comment thread extra_data/components.py
Comment on lines +2016 to +2019
if (detector_name is None
or detector_name in name
):
res.add((name, cls))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest this change to 'identify_multimod_detectors' function to solve my previous comment.

Comment thread extra_data/components.py
for name in cls._find_detector_names(data):
res.add((name, cls))
if (detector_name is None
or detector_name in name
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 if you're specifying a name, it should be exact; this matches how thedetector_name is used when instatiating a component.

Suggested change
or detector_name in name
or detector_name == name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Thomas, looks good to me. James, would you like to commit this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants