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

Slicing a reflection table drops the identifier map #2276

Closed
phyy-nx opened this issue Nov 10, 2022 · 2 comments · Fixed by #2371
Closed

Slicing a reflection table drops the identifier map #2276

phyy-nx opened this issue Nov 10, 2022 · 2 comments · Fixed by #2371
Assignees

Comments

@phyy-nx
Copy link
Member

phyy-nx commented Nov 10, 2022

Found while working on #1858, in cctbx.xfel.merge we have a reflection table slice operation, but it turns out that drops the experiment identifier map.

Simple reproducer:

print(list(refls.experiment_identifiers().keys()))
refls = refls[0:10]
print(list(refls.experiment_identifiers().keys()))

Output

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
[]

I think this means that the slice code in flex.reflection_table needs to include a pass through the experiment map. It would like like this in python:

subset = refls[start:stop] # drops identifier map
for expt_id in set(subset['id']):
  subset.experiment_identifiers()[expt_id] = refls.experiment_identifiers()[expt_id]
@phyy-nx
Copy link
Member Author

phyy-nx commented Nov 17, 2022

Note, part of cctbx/cctbx_project#822 can be reverted if this is fixed.

@graeme-winter
Copy link
Contributor

@jbeilstenedmands this just came up in conversation as a "would be useful to fix" - if you have a moment

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 a pull request may close this issue.

3 participants