-
Notifications
You must be signed in to change notification settings - Fork 46
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
Remove unrefined reflections in index #1350
Conversation
If indexing works and refinement fails in multi-lattice case, can have expt ids assigned which do not correspond to experiments in the output. This change simply removes the experiment ids where there is no refined experiment. Fixes #1349
Can add a test once dials/data#210 merged Test can use
to ensure all indexed reflections have experiments |
Codecov Report
@@ Coverage Diff @@
## master #1350 +/- ##
==========================================
+ Coverage 64.22% 64.31% +0.09%
==========================================
Files 616 616
Lines 69811 69833 +22
Branches 9536 9542 +6
==========================================
+ Hits 44834 44913 +79
+ Misses 23211 23135 -76
- Partials 1766 1785 +19
Continue to review full report at Codecov.
|
Added test which depends on dials_data PR |
@rjgildea test data added so will welcome your review |
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.
Looks to be a useful corner case to catch, however I think the code to reset the reflection indexed status should probably be better part of the try/except where the failed refinement was actually trapped, i.e. right after the failed experiment was deleted:
dials/algorithms/indexing/indexer.py
Lines 641 to 648 in e7e5292
except (DialsRefineConfigError, DialsRefineRuntimeError) as e: | |
if len(experiments) == 1: | |
raise DialsIndexRefineError(str(e)) | |
had_refinement_error = True | |
logger.info("Refinement failed:") | |
logger.info(e) | |
del experiments[-1] | |
break |
Is there any reason to put the new test in a separate file to the rest of the existing high-level indexing tests?
https://github.com/dials/dials/blob/master/algorithms/indexing/test_index.py
Co-authored-by: Richard Gildea <rjgildea@users.noreply.github.com>
Co-authored-by: Richard Gildea <rjgildea@users.noreply.github.com>
This is a test of the command-line program so I put the tests where I would expect the test go to... which I think is reasonable. |
@rjgildea changes made according to your suggestions |
Whether this is right or wrong is a matter of opinion, but having the tests together makes more sense probably
mmk well moved over - we can revisit this more widely I guess but this is consistent with the code base as it stands. |
Rerunning all tests before squash merging. |
@ndevenish will leave this one to rest for a bit on master but will want to pick across to release branch I think (not so sure about backport) |
That is backporting |
Sorry, I meant back to 2.2 series 🙂 |
This was merged with failing tests. |
If indexing works and refinement fails in multi-lattice case, can have experiment ids assigned which do not correspond to experiments in the output. This change simply removes the experiment ids where there is no refined experiment.
Fixes #1349