Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aggrathon committed Feb 20, 2024
1 parent dd38bae commit 24cb2e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/python-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ jobs:
- run: python -m pip install --upgrade pip build
- name: Build package
run: |
rm -f dist/*.whl
python -m build
python -c "import os, glob; assert os.path.getsize(sorted(glob.glob('dist/slisemap-*.whl'))[-1]) > 10_000"
python -c "import os, glob; assert os.path.getsize(glob.glob('dist/*.whl')[-1]) > 10_000"
lint:
runs-on: ubuntu-latest
Expand Down
9 changes: 3 additions & 6 deletions tests/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,12 @@ def test_load_slisemap(sm_to_df):

def test_load_slipmap(sm_to_df):
sm, dfm = sm_to_df
sp = Slipmap.convert(sm)
sp = Slipmap.convert(sm, prototypes=10)
dfp = slipmap_to_dataframe(sp, clusters=None, losses=False)
for col in dfm.columns:
if col[0] not in ("L", "B", "Ŷ", "C"):
assert np.allclose(
dfm[col], dfp[col][: dfm.shape[0]], 2e-4
), f"{col} not equal ({np.abs(dfm[col], dfp[col][: dfm.shape[0]]).max()})"
dfp = slipmap_to_dataframe(sp, clusters=range(6, 7), losses=True)
for col in dfp.columns:
if col[0] in ("X", "Y"):
assert np.allclose(dfm[col], dfp[col][: dfm.shape[0]])
if col[:3] == "LT_":
assert np.all(np.isnan(dfp[col][sp.n :]))
assert np.all(np.isfinite(dfp[col][: sp.n]))
Expand Down

0 comments on commit 24cb2e0

Please sign in to comment.