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

Retire use of the thaumatin_i04 dataset in tests #1406

Merged
merged 2 commits into from
Sep 21, 2020

Conversation

Anthchirp
Copy link
Member

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.)

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.
Copy link
Contributor

@rjgildea rjgildea left a 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 👍

Comment on lines +98 to +112
# 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")
Copy link
Contributor

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:

params, options = parser.parse_args(show_diff_phil=True)

Copy link
Member Author

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
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #1406 into master will not change coverage.
The diff coverage is n/a.

@@           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           

@Anthchirp Anthchirp merged commit 8fea9eb into master Sep 21, 2020
@Anthchirp Anthchirp deleted the retire-thaumatin-test branch September 21, 2020 14:30
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