Skip to content

Commit 16843aa

Browse files
authored
Fix CI & latest Numpy version (#3306)
1 parent 4b06c1c commit 16843aa

File tree

6 files changed

+10
-26
lines changed

6 files changed

+10
-26
lines changed

.github/workflows/platform-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu-latest]
21-
python-version: [3.8-kubernetes, 3.8-hadoop, 3.8-ray, 3.8-ray-deploy, 3.8-ray-dag, 3.8-vineyard, 3.8-dask]
21+
python-version: [3.8-ray, 3.8-ray-deploy, 3.8-ray-dag, 3.8-vineyard, 3.8-dask]
2222
include:
23-
- { os: ubuntu-latest, python-version: 3.8-kubernetes, no-common-tests: 1,
23+
- { os: ubuntu-20.04, python-version: 3.8-kubernetes, no-common-tests: 1,
2424
no-deploy: 1, with-kubernetes: "with Kubernetes" }
25-
- { os: ubuntu-latest, python-version: 3.8-hadoop, no-common-tests: 1,
25+
- { os: ubuntu-20.04, python-version: 3.8-hadoop, no-common-tests: 1,
2626
no-deploy: 1, with-hadoop: "with hadoop" }
2727
- { os: ubuntu-latest, python-version: 3.8-vineyard, no-common-tests: 1,
2828
no-deploy: 1, with-vineyard: "with vineyard" }
@@ -72,7 +72,7 @@ jobs:
7272
7373
source ./ci/rewrite-cov-config.sh
7474
75-
pip install numpy scipy cython
75+
pip install numpy scipy cython "scikit-learn<1.2.0"
7676
7777
pip install -e ".[dev,extra]"
7878

azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
source ./ci/rewrite-cov-config.sh
6161
6262
if [[ "$(mars.test.module)" == "learn" ]]; then
63-
pip install numpy\<1.20.0 scipy cython
63+
pip install numpy\<1.20.0 scipy cython scikit-learn\<1.2.0
6464
else
6565
pip install numpy scipy cython
6666
fi
@@ -94,6 +94,7 @@ jobs:
9494
9595
# do compatibility test for earliest supported pandas release
9696
if [[ "$(mars.test.module)" == "dataframe" ]]; then
97+
pip install numpy\<1.24.0
9798
pip install -i https://pkgs.dev.azure.com/mars-project/mars/_packaging/pandas/pypi/simple/ pandas==1.0.5
9899
pytest $PYTEST_CONFIG -m pd_compat mars/dataframe
99100
mv .coverage build/.coverage.pd_compat.file

mars/dataframe/reduction/tests/test_reduction_execution.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,9 @@
4242
def check_ref_counts():
4343
yield
4444

45-
import functools
4645
import gc
4746

48-
# In https://github.com/pandas-dev/pandas/pull/48023, pandas cache current frame in this PR
49-
# which leads to failure of decref mechanism.
5047
gc.collect()
51-
wrappers = []
52-
tp = functools._lru_cache_wrapper
53-
for a in gc.get_objects():
54-
try:
55-
if isinstance(a, tp):
56-
wrappers.append(a)
57-
except ReferenceError:
58-
# a may raises ReferenceError: weakly-referenced object no longer exists
59-
# please refer to: https://github.com/mars-project/mars/issues/3290
60-
pass
61-
62-
for wrapper in wrappers:
63-
wrapper.cache_clear()
6448

6549
sess = get_default_session()
6650
assert len(sess._get_ref_counts()) == 0

mars/tensor/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
# suppress numpy warnings on types
378378
with warnings.catch_warnings():
379379
warnings.simplefilter("ignore", DeprecationWarning)
380+
warnings.simplefilter("ignore", FutureWarning)
380381
# noinspection PyUnresolvedReferences
381382
from numpy import object, int, bool, float
382383
except ImportError: # pragma: no cover

mars/tensor/base/transpose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
def _reorder(x, axes):
2929
if x is None:
3030
return
31-
return type(x)(np.array(x)[list(axes)].tolist())
31+
return type(x)(x[ax] for ax in axes)
3232

3333

3434
class TensorTranspose(TensorHasInput, TensorOperandMixin):

mars/tensor/indexing/fill_diagonal.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,8 @@ def _tile_nd(cls, op, val):
184184
# if more than 3d, we will rechunk the tensor into square chunk
185185
# on the diagonal direction
186186
in_tensor = op.input
187-
nsplits = np.array(in_tensor.nsplits)
188-
if not np.issubdtype(nsplits.dtype, np.integer) or not np.all(
189-
np.diff(nsplits, axis=1) == 0
190-
):
187+
nsplits = [tuple(np.array(split)) for split in in_tensor.nsplits]
188+
if len(set(nsplits)) != 1:
191189
# need rechunk
192190
nsplit = decide_unify_split(*in_tensor.nsplits)
193191
in_tensor = yield from recursive_tile(

0 commit comments

Comments
 (0)