Skip to content

Commit

Permalink
try to support python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
minhuanli committed Jan 20, 2023
1 parent 5087e26 commit 765cbaf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

# Skip CI if 'skip ci' is contained in latest commit message
if: "!contains(github.event.head_commit.message, 'skip ci')"
Expand Down
33 changes: 25 additions & 8 deletions tests/test_Fmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,22 @@ def test_calc_Fprotein(data_pdb, data_mtz_exp, data_mtz_fmodel_ksol0, Return):

if Return:
Fprotein_arr = np.array(Fprotein)
assert pearsonr(np.abs(Fprotein_arr),
Fcalc['FMODEL'].to_numpy()).statistic > 0.99
try:
assert pearsonr(np.abs(Fprotein_arr),
Fcalc['FMODEL'].to_numpy()).statistic > 0.99
except:
assert pearsonr(np.abs(Fprotein_arr),
Fcalc['FMODEL'].to_numpy())[0] > 0.99
else:
assert Fprotein is None
Fprotein_arr = np.array(sfcalculator.Fprotein_HKL)
assert pearsonr(np.abs(Fprotein_arr),
Fcalc['FMODEL'].to_numpy()).statistic > 0.99
try:
assert pearsonr(np.abs(Fprotein_arr),
Fcalc['FMODEL'].to_numpy()).statistic > 0.99
except:
assert pearsonr(np.abs(Fprotein_arr),
Fcalc['FMODEL'].to_numpy())[0] > 0.99



@pytest.mark.parametrize("Return", [True, False])
Expand Down Expand Up @@ -87,13 +96,21 @@ def test_calc_Fsolvent(data_pdb, data_mtz_exp, data_mtz_fmodel_ksol0, data_mtz_f

if Return:
Fsolvent_arr = np.array(Fsolvent)
assert pearsonr(np.abs(Fsolvent_arr), np.abs(
Fmask_complex)).statistic > 0.95
try:
assert pearsonr(np.abs(Fsolvent_arr), np.abs(
Fmask_complex)).statistic > 0.95
except:
assert pearsonr(np.abs(Fsolvent_arr), np.abs(
Fmask_complex))[0] > 0.95
else:
assert Fsolvent is None
Fsolvent_arr = np.array(sfcalculator.Fmask_HKL)
assert pearsonr(np.abs(Fsolvent_arr), np.abs(
Fmask_complex)).statistic > 0.95
try:
assert pearsonr(np.abs(Fsolvent_arr), np.abs(
Fmask_complex)).statistic > 0.95
except:
assert pearsonr(np.abs(Fsolvent_arr), np.abs(
Fmask_complex))[0] > 0.95


@pytest.mark.parametrize("case", [1, 2])
Expand Down

0 comments on commit 765cbaf

Please sign in to comment.