The slowest tests in our CI suite are within test_dataset_grid.py, and they end up being due to calls to DataSet.expand_to_p1(). Using pytest with --durations=5, we can see that the worst offenders in that file are:
These particular tests involve high-symmetry spacegroups, which are worst-case scenarios for expand_to_p1() due to its for-loop over symmetry operations.
This PR removes that for loop, instead opting for a single call to DataSet.hkl_to_observed() within DataSet.expand_to_p1(). This speeds up the tests by ~10x -- here are the new slowest tests in that file:
The slowest tests in our CI suite are within
test_dataset_grid.py
, and they end up being due to calls toDataSet.expand_to_p1()
. Usingpytest
with--durations=5
, we can see that the worst offenders in that file are:These particular tests involve high-symmetry spacegroups, which are worst-case scenarios for
expand_to_p1()
due to its for-loop over symmetry operations.This PR removes that for loop, instead opting for a single call to
DataSet.hkl_to_observed()
withinDataSet.expand_to_p1()
. This speeds up the tests by ~10x -- here are the new slowest tests in that file: