diff --git a/environment.yml b/environment.yml index 172a5ed9748..4dc45788af1 100644 --- a/environment.yml +++ b/environment.yml @@ -47,7 +47,7 @@ dependencies: - qdarkstyle !=3.2.2 - qtpy - scikit-learn - - scipy >=1.11.1 + - scipy >=1.11 - sip - snirf - statsmodels diff --git a/mne/commands/mne_flash_bem.py b/mne/commands/mne_flash_bem.py index b6c7a1b795d..63bcb79d9d8 100644 --- a/mne/commands/mne_flash_bem.py +++ b/mne/commands/mne_flash_bem.py @@ -95,17 +95,6 @@ def run(): "been registered with the T1.mgz file." ), ) - parser.add_option( - "-n", - "--noconvert", - dest="noconvert", - action="store_true", - default=False, - help=( - "[DEPRECATED] Assume that the Flash MRI images " - "have already been converted to mgz files" - ), - ) parser.add_option( "-u", "--unwarp", @@ -139,15 +128,6 @@ def run(): help="Use copies instead of symlinks for surfaces", action="store_true", ) - parser.add_option( - "-p", - "--flash-path", - dest="flash_path", - default=None, - help="[DEPRECATED] The directory containing flash5.mgz " - "files (defaults to " - "$SUBJECTS_DIR/$SUBJECT/mri/flash/parameter_maps", - ) options, _ = parser.parse_args() diff --git a/mne/report/report.py b/mne/report/report.py index 7cab9774c8e..732c1a5c8b3 100644 --- a/mne/report/report.py +++ b/mne/report/report.py @@ -3415,6 +3415,7 @@ def _add_raw( init_kwargs.setdefault("fmax", fmax) plot_kwargs.setdefault("show", False) with warnings.catch_warnings(): + # SciPy warning about too short a data segment given the window size warnings.simplefilter(action="ignore", category=FutureWarning) fig = raw.compute_psd(**init_kwargs).plot(**plot_kwargs) self._add_figure( diff --git a/mne/time_frequency/tests/test_spectrum.py b/mne/time_frequency/tests/test_spectrum.py index 2f612357e70..69c8a7713d4 100644 --- a/mne/time_frequency/tests/test_spectrum.py +++ b/mne/time_frequency/tests/test_spectrum.py @@ -306,8 +306,6 @@ def test_unaggregated_spectrum_to_data_frame(raw, long_format, method, output): pytest.importorskip("pandas") from pandas.testing import assert_frame_equal - from mne.utils.dataframe import _inplace - # aggregated spectrum → dataframe orig_df = raw.compute_psd(method=method).to_data_frame(long_format=long_format) # unaggregated welch or complex multitaper → @@ -329,7 +327,7 @@ def test_unaggregated_spectrum_to_data_frame(raw, long_format, method, output): orig_df = orig_df.loc[subset(orig_df["freq"])] # sort orig_df, because at present we can't actually prevent pandas from # sorting at the agg step *sigh* - _inplace(orig_df, "sort_values", by=grouping_cols, ignore_index=True) + orig_df.sort_values(by=grouping_cols, ignore_index=True) # aggregate df = df.drop(columns=drop_cols) gb = df.groupby(grouping_cols, as_index=False, observed=False) diff --git a/mne/utils/dataframe.py b/mne/utils/dataframe.py index 43c680727e2..3d72399382a 100644 --- a/mne/utils/dataframe.py +++ b/mne/utils/dataframe.py @@ -8,7 +8,6 @@ from ..defaults import _handle_default from ._logging import logger, verbose -from .check import check_version @verbose @@ -48,17 +47,6 @@ def _convert_times(times, time_format, meas_date=None, first_time=0): return times -def _inplace(df, method, **kwargs): - _meth = getattr(df, method) # used for set_index() and rename() - - # TODO: deprecation in Pandas 3.0, can remove once we require 3+ - if check_version("pandas", "3.0"): - return _meth(**kwargs) - else: - # "copy" in signature(_meth).parameters - return _meth(**kwargs, copy=False) - - @verbose def _build_data_frame( inst, @@ -86,16 +74,16 @@ def _build_data_frame( df.insert(i, k, v) # build Index if long_format: - df = _inplace(df, "set_index", keys=default_index) + df.set_index(keys=default_index) df.columns.name = col_kind elif index is not None: - df = _inplace(df, "set_index", keys=index) + df.set_index(keys=index) if set(index) == set(default_index): df.columns.name = col_kind # long format if long_format: df = df.stack().reset_index() - df = _inplace(df, "rename", columns={0: "value"}) + df.rename(columns={0: "value"}) # add column for channel types (as appropriate) ch_map = ( None @@ -113,7 +101,7 @@ def _build_data_frame( df.insert(col_index, "ch_type", ch_type) # restore index if index is not None: - df = _inplace(df, "set_index", keys=index) + df.set_index(keys=index) # convert channel/vertex/ch_type columns to factors to_factor = [ c for c in df.columns.tolist() if c not in ("freq", "time", "value") diff --git a/pyproject.toml b/pyproject.toml index dd29118fb3f..1447b44f644 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "numpy >= 1.25,<3", # 2023/06/17 "packaging", "pooch >= 1.5", - "scipy >= 1.11.1", # 2023/06/25 + "scipy >= 1.11", # 2023/06/25 "tqdm", ] description = "MNE-Python project for MEG and EEG data analysis." diff --git a/tools/environment_old.yml b/tools/environment_old.yml index de79d26eed6..46826bdbcf4 100644 --- a/tools/environment_old.yml +++ b/tools/environment_old.yml @@ -5,7 +5,7 @@ channels: dependencies: - python =3.10 - numpy =1.25 - - scipy =1.11.1 + - scipy =1.11 - matplotlib =3.7 - pandas =2.0 - scikit-learn