Skip to content

Commit

Permalink
[MRG] Explicitly set dtype=object when generating permutations (#534)
Browse files Browse the repository at this point in the history
* Explicitly set dtype=object

* Try uninstall/install instead of upgrade

* Upgrade scipy and numpy
  • Loading branch information
aaronreidsmith committed Dec 20, 2022
1 parent dde2742 commit 587c380
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
# Runs tests and checks for a numpy regression by upgrading numpy and running tests again
CIBW_TEST_COMMAND: >
pytest --showlocals --durations=20 --pyargs pmdarima &&
pip install --upgrade numpy &&
pip install --upgrade scipy numpy &&
pytest --showlocals --durations=20 --pyargs pmdarima
# Avoid testing on emulated architectures
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64"
Expand Down
6 changes: 4 additions & 2 deletions pmdarima/arima/_auto_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ def __init__(self, y, X, fit_partial, d, D, m, max_order,
if random:
random_state = check_random_state(random_state)

# make a list to scramble...
gen = random_state.permutation(list(gen))[:n_fits]
# make a list to scramble... `gen` may have a ragged nested
# sequence, so we have to explicitly use dtype='object', otherwise
# it will raise a ValueError on numpy >= 1.24
gen = random_state.permutation(np.array(list(gen), dtype='object'))[:n_fits] # noqa: E501

self.gen = gen
self.n_jobs = n_jobs
Expand Down

0 comments on commit 587c380

Please sign in to comment.