Skip to content

Commit

Permalink
[MNT] Fixing numpy (#665)
Browse files Browse the repository at this point in the history
* MNT: fixing the numpy 2.0

* DOC: fixing the docstring

* DOC: fixing the docstring

* DOC: fixing more numpy

* DOC: fixing whats_new.rst

* DOC: reverting numpy
  • Loading branch information
bruAristimunha authored Oct 18, 2024
1 parent ca79b90 commit eb222df
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Bugs

- Fix Stieger2021 dataset bugs (:gh:`651` by `Martin Wimpff`_)
- Unpinning major version Scikit-learn and numpy (:gh:`652` by `Bruno Aristimunha`_)
- Replacing the func:`numpy.string_` to func:`numpy.bytes_` (:gh:`665` by `Bruno Aristimunha`_)

API changes
~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions moabb/analysis/meta_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ def find_significant_differences(df, perm_cutoff=20):
nsubs = np.array([df.loc[df.dataset == d, "nsub"].mean() for d in dsets])
P_full = df.pivot_table(values="p", index=["dataset", "pipe1"], columns="pipe2")
T_full = df.pivot_table(values="smd", index=["dataset", "pipe1"], columns="pipe2")
P = np.full((len(algs), len(algs)), np.NaN)
T = np.full((len(algs), len(algs)), np.NaN)
P = np.full((len(algs), len(algs)), np.nan)
T = np.full((len(algs), len(algs)), np.nan)
for i in range(len(algs)):
for j in range(len(algs)):
if i != j:
Expand Down
2 changes: 1 addition & 1 deletion moabb/analysis/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __init__(

if not osp.isfile(self.filepath):
with h5py.File(self.filepath, "w") as f:
f.attrs["create_time"] = np.string_(
f.attrs["create_time"] = np.bytes_(
"{:%Y-%m-%d, %H:%M}".format(datetime.now())
)

Expand Down
2 changes: 1 addition & 1 deletion moabb/evaluations/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _evaluate(
if _carbonfootprint:
emissions = tracker.stop()
if emissions is None:
emissions = np.NaN
emissions = np.nan
duration = time() - t_start

nchan = X.info["nchan"] if isinstance(X, BaseEpochs) else X.shape[1]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license = "BSD-3-Clause"

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
numpy = ">=1.22"
numpy = "^1.22"
scipy = "^1.9.3"
mne = "^1.7.0"
pandas = ">=1.5.2"
Expand Down

0 comments on commit eb222df

Please sign in to comment.