Skip to content

Commit

Permalink
Change tests a little, show versions of packages in GitHub Actions, use
Browse files Browse the repository at this point in the history
ubuntu 20.04
  • Loading branch information
noscode committed Dec 1, 2022
1 parent d012e7f commit 3ed482c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
os: [ubuntu-20.04, windows-2019, macos-10.15]
python-version: [3.6, 3.8]
include:
- os: windows-2019
Expand Down Expand Up @@ -93,6 +93,7 @@ jobs:
- name: Install momentsLD engine.
run: |
pip3 uninstall -y moments
pip3 install Cython==0.29.18 # the last version cause erros on Windows and MacOS
git clone --depth 1 --branch moments-1.1.11 https://bitbucket.org/simongravel/moments.git
cd moments
Expand All @@ -114,6 +115,9 @@ jobs:
python3 -c "import moments"
python3 -c "import gadma"
- name: Show versions of all installed packages.
run: python3 -m pip freeze

- name: Show available engines and optimizations in gadma.
run: |
python3 -c "import gadma;print(gadma.engines.engine._registered_engines.keys())"
Expand Down
4 changes: 3 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,12 @@ def test_code_generation(self):
else:
new_model.Nanc_size = Nanc
new_model.mutation_rate = 1.25e-8
new_model.recombination_rate = 1.5e-8
engine.model = new_model
moments.LD.Inference._varcov_inv_cache = {}

cmd = engine.generate_code(input_values, None, *args, nanc=Nanc)
#print(cmd)
print(cmd)
if engine.can_evaluate:
# read data
engine.data = data
Expand All @@ -758,6 +759,7 @@ def test_code_generation(self):
exec(cmd, d)

msg += f": {true_ll} != {d['ll_model']}"
print(true_ll, d["ll_model"])
if true_ll is None: # if we have None
assert engine.id in ['dadi', 'moments']
max_ll = engine.base_module.Inference.ll(
Expand Down

0 comments on commit 3ed482c

Please sign in to comment.