-
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
Retire use of the thaumatin_i04 dataset in tests #1406
Conversation
This is a massively large dataset taking up a lot of resources in the Azure CI. We can easily use a much smaller dataset that is used elsewhere - in fact we don't even need a raw dataset for this test at all.
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.
No real good reason for this test to depend on a 3 Gb data set 👍
# load the original experiment and perturbate the beam centre by a small offset | ||
experiments = load.experiment_list(insulin / "imported.expt", check_format=False) | ||
original_origin = experiments[0].detector.hierarchy().get_origin() | ||
shifted_origin = ( | ||
original_origin[0] - 1.3, | ||
original_origin[1] + 1.5, | ||
original_origin[2], | ||
) | ||
print(shift) | ||
experiments[0].detector.hierarchy().set_local_frame( | ||
experiments[0].detector.hierarchy().get_fast_axis(), | ||
experiments[0].detector.hierarchy().get_slow_axis(), | ||
shifted_origin, | ||
) | ||
assert experiments[0].detector.hierarchy().get_origin() == shifted_origin | ||
experiments.as_file(run_in_tmpdir / "shifted.expt") |
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.
You can probably just use the code from dials.modify_geometry
to do this. Something like:
from dials.command_line import modify_geometry
modify_geometry.run([insulin/"imported.expt", "mosflm_beam_centre=96,97"])
which should output a new file "modified.expt" with the updated beam centre.
Note: I think you'll have to pass along the args
variable at this line:
dials/command_line/modify_geometry.py
Line 33 in 38aefdf
params, options = parser.parse_args(show_diff_phil=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.
I'm not too familiar with the geometry modification code - I'll just use what I have for now. Feel free to open a ticket for this if you think it'd be useful to follow up
Codecov Report
@@ Coverage Diff @@
## master #1406 +/- ##
=======================================
Coverage 64.69% 64.69%
=======================================
Files 617 617
Lines 69587 69587
Branches 9550 9550
=======================================
Hits 45018 45018
Misses 22787 22787
Partials 1782 1782 |
The
thaumatin_i04
dataset is a very large dataset (3.1 GB) taking up a lot of resources in the Azure CI.This PR rewrites the test to use a much smaller dataset that is already used elsewhere - in fact it just uses pre-processed data and does not look at a raw dataset at all.
(
thaumatin_i04
is still used in the tutorials, but that is not relevant for running the tests.)