-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR does two things 1) refactor test data generation outside of pytest. This is needed to avoid failures due to xcov workers fighting over the output directory. Now to run the tests, you must run python tests/gen_test_data.py pytest 2) Further improve the numerical stability by multiplying the scale distribution by the empirical standard deviation of the intensities. This helps prevent the `--scale-bijector=exp` from overflowing. * revert Exp to Softplus for scale bijector * oops remove silly cruft * add choice scale bijector, set softplus default * add pre-test script, improve numerics * refactor testing data generator outside of pytest * revert Exp to Softplus for scale bijector * oops remove silly cruft * add pre-test script, improve numerics * refactor testing data generator outside of pytest --------- Co-authored-by: Kevin Dalton <[email protected]>
- Loading branch information
Showing
7 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,4 @@ testpaths = [ | |
|
||
[tool.setuptools.dynamic] | ||
version = {file = "careless/VERSION"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" | ||
Generate the test data required for running the careless test suite. | ||
It is required to run this script prior to calling pytest. Here is | ||
an example of how to run the careless tests. | ||
``` | ||
cd careless | ||
pip install -e .[dev] | ||
python tests/gen_test_data.py | ||
pytest | ||
``` | ||
""" | ||
|
||
from os import listdir,mkdir | ||
from os.path import dirname, abspath, join, exists | ||
import numpy as np | ||
import pandas as pd | ||
import re | ||
import reciprocalspaceship as rs | ||
import gemmi | ||
|
||
|
||
|
||
def main(): | ||
rundir = "data/" | ||
rundir = abspath(join(dirname(__file__), rundir)) | ||
|
||
command = """ | ||
careless poly | ||
--disable-progress-bar | ||
--iterations=10 | ||
--merge-half-datasets | ||
--half-dataset-repeats=3 | ||
--test-fraction=0.1 | ||
--disable-gpu | ||
--anomalous | ||
--wavelength-key=Wavelength | ||
dHKL,Hobs,Kobs,Lobs,Wavelength | ||
pyp_off.mtz | ||
pyp_2ms.mtz | ||
output/pyp | ||
""" | ||
if not exists(f"{rundir}/output"): | ||
mkdir(f"{rundir}/output") | ||
from subprocess import call | ||
call(command.split(), cwd=rundir) | ||
|
||
if __name__=="__main__": | ||
main() |