Skip to content

Commit d2cc4a1

Browse files
authored
Be more strict with requirements: scipy, pandas (#318)
* Be more strict with requirements: scipy, pandas Closes #317 * Fix * Fix * moar fix
1 parent 7ec38ae commit d2cc4a1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

ci/minimal-requirements.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ dependencies:
1010
- pytest-pretty
1111
- pytest-xdist
1212
- numpy==1.22
13-
- scipy
13+
- scipy==1.9.0
1414
- numpy_groupies==0.9.19
15-
- pandas
15+
- pandas==1.5
1616
- pooch
1717
- toolz

flox/core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import numpy_groupies as npg
2424
import pandas as pd
2525
import toolz as tlz
26-
from scipy.sparse import csc_array
26+
from scipy.sparse import csc_array, csr_array
2727

2828
from . import xrdtypes
2929
from .aggregate_flox import _prepare_for_flox
@@ -328,7 +328,7 @@ def invert(x) -> tuple[np.ndarray, ...]:
328328
# - S is the existing set
329329
MIN_CONTAINMENT = 0.75 # arbitrary
330330
asfloat = bitmask.astype(float)
331-
containment = ((asfloat.T @ asfloat) / chunks_per_label).tocsr()
331+
containment = csr_array((asfloat.T @ asfloat) / chunks_per_label)
332332
mask = containment.data < MIN_CONTAINMENT
333333
containment.data[mask] = 0
334334
containment.eliminate_zeros()

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ test = ["netCDF4"]
3939

4040
[build-system]
4141
requires = [
42-
"pandas",
42+
"pandas>=1.5",
4343
"numpy>=1.22",
4444
"numpy_groupies>=0.9.19",
45-
"scipy",
45+
"scipy>=1.9",
4646
"toolz",
4747
"setuptools>=61.0.0",
4848
"setuptools_scm[toml]>=7.0",

tests/test_core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,8 @@ def test_verify_complex_cohorts(chunksize: int) -> None:
876876
chunk_cohorts = find_group_cohorts(by - 1, (chunks,))
877877
chunks_ = np.sort(np.concatenate(tuple(chunk_cohorts.keys())))
878878
groups = np.sort(np.concatenate(tuple(chunk_cohorts.values())))
879-
assert_equal(np.unique(chunks_), np.arange(len(chunks), dtype=int))
880-
assert_equal(groups, np.arange(366, dtype=int))
879+
assert_equal(np.unique(chunks_).astype(np.int64), np.arange(len(chunks), dtype=np.int64))
880+
assert_equal(groups.astype(np.int64), np.arange(366, dtype=np.int64))
881881

882882

883883
@requires_dask

0 commit comments

Comments
 (0)