-
Notifications
You must be signed in to change notification settings - Fork 15
Allow passing a detector name to extra-data-make-virtual-cxi #599
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: master
Are you sure you want to change the base?
Conversation
This is necessary for runs with multiple multi-module detectors.
| 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) |
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.
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 😓
| if (detector_name is None | ||
| or detector_name in name | ||
| ): | ||
| res.add((name, cls)) |
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 suggest this change to 'identify_multimod_detectors' function to solve my previous comment.
| for name in cls._find_detector_names(data): | ||
| res.add((name, cls)) | ||
| if (detector_name is None | ||
| or detector_name in name |
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 think if you're specifying a name, it should be exact; this matches how thedetector_name is used when instatiating a component.
| or detector_name in name | |
| or detector_name == name |
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.
Thanks Thomas, looks good to me. James, would you like to commit this?
This is necessary for runs with multiple multi-module detectors.