Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Fixing numpy #665

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading