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

Xfel merge filter by resolution n obs #1030

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dwmoreau
Copy link
Contributor

@dwmoreau dwmoreau commented Dec 2, 2024

Implemented experiment filters by resolution and number of observations within cctbx.xfel.merge

@dwmoreau dwmoreau requested a review from phyy-nx December 2, 2024 15:36
@phyy-nx phyy-nx force-pushed the xfel_merge_filter_by_resolution_n_obs branch from a6f54d9 to b947567 Compare December 2, 2024 22:00
@phyy-nx phyy-nx force-pushed the xfel_merge_filter_by_resolution_n_obs branch from b947567 to 4ca6c71 Compare December 2, 2024 22:01
Copy link
Contributor

@phyy-nx phyy-nx left a comment

Choose a reason for hiding this comment

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

Looks like a good feature. Some review comments added.

filter_by_n_obs = 'n_obs' in self.params.filter.algorithm[0]
filter_by_resolution = 'resolution' in self.params.filter.algorithm[0]
# only "unit_cell" "n_obs" and "resolution" algorithms are supported
if (not filter_by_unit_cell) and (not filter_by_n_obs) and (not filter_by_resolution):
Copy link
Contributor

Choose a reason for hiding this comment

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

These validation steps should likely be in the validate function. validate runs before the program starts execution, which will save time if the parameters are invalid.

{
algorithm = n_obs reindex resolution unit_cell report
.type = choice
.type = strings
.multiple = True
Copy link
Contributor

Choose a reason for hiding this comment

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

If .type = choice and .multiple = true, then params.filter.algorithm should be a list of already validated strings. Is there a reason that doesn't work?


# Do we have any data left?
from xfel.merging.application.utils.data_counter import data_counter
data_counter(self.params).count(new_experiments, new_reflections)
Copy link
Contributor

Choose a reason for hiding this comment

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

data_counter result not checked?

@@ -129,14 +129,18 @@
.help = The filter section defines criteria to accept or reject whole experiments
.help = or to modify the entire experiment by a reindexing operator
.help = refer to the select section for filtering of individual reflections
.help = only unit_cell, resolution, and n_obs are implemented
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's go ahead and drop reindex and report if they aren't implemented.

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.

2 participants