diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index c7eda47..52ae171 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -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 diff --git a/tests/test_load.py b/tests/test_load.py index 1ea6c99..f03ff34 100644 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -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]))