Skip to content
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

Add require_any keyword argument to source selection #400

Merged
merged 1 commit into from May 5, 2023

Conversation

philsmt
Copy link
Contributor

@philsmt philsmt commented May 4, 2023

Complementing the earlier support to match data during a selection, this PR adds a require_any keyword argument as a weaker version of require_all. Rather than requiring all source to have data for each train, it only requires one source to have data for each train. The use cases for this are definitely smaller, but it seemed trivial to add to the existing require_all code by tweaking the logic only slightly.

Also used the opportunity to fix an oversight from #367 with require_all not actually being forwarded from run.alias.select() to run.select().

An open question is whether this should be ported to run.trains() as well.

@philsmt philsmt force-pushed the feat/select-require-any branch 2 times, most recently from c9708e8 to 66a83f5 Compare May 5, 2023 09:48
train_ids = self.train_ids
if require_all:
train_ids = self.train_ids
else:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
else:
else: # require_any

Comment on lines 614 to 615
.deselect([('SA3_XTD10_MCP/ADC/1:*', '*'),
('SA3_XTD10_IMGFEL/CAM/BEAMVIEW:*', '*')])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These deselections aren't needed here.

@takluyver
Copy link
Member

Reviewed in person, LGTM

@philsmt
Copy link
Contributor Author

philsmt commented May 5, 2023

Thanks! Pushed one last typo change in a test comment 🙈

@philsmt philsmt merged commit beed42d into master May 5, 2023
5 of 6 checks passed
@takluyver takluyver deleted the feat/select-require-any branch May 5, 2023 10:56
@takluyver takluyver added this to the 1.13 milestone May 8, 2023
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.

None yet

2 participants