Skip to content

Commit

Permalink
misc maint
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Jul 27, 2023
1 parent 884333b commit 63925af
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 38 deletions.
1 change: 0 additions & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Required:
* ``mne`` (>=1.3)
* ``numpy`` (>=1.20.2)
* ``scipy`` (>=1.6.3)
* ``setuptools`` (>=46.4.0)

Optional:

Expand Down
1 change: 0 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ numpydoc
matplotlib
pillow
pandas
setuptools
mne-nirs
seaborn
10 changes: 1 addition & 9 deletions mne_bids/commands/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@

import pytest

# This is here to handle mne-python <0.20
import warnings

with warnings.catch_warnings():
warnings.filterwarnings(
action="ignore", message="can't resolve package", category=ImportWarning
)
import mne

import mne
from mne.datasets import testing
from mne.utils import ArgvSetter, requires_pandas
from mne.utils._testing import requires_module
Expand Down
8 changes: 1 addition & 7 deletions mne_bids/tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,13 +1150,7 @@ def test_find_empty_room(return_bids_test_dir, tmp_path):
raw.copy().crop(0, 10).save(er_raw_fname, overwrite=True)
er_raw = _read_raw_fif(er_raw_fname)

if not isinstance(er_raw.info["meas_date"], datetime): # pragma: no cover
# mne < v0.20
er_date = datetime.fromtimestamp(er_raw.info["meas_date"][0])
else:
er_date = er_raw.info["meas_date"]

er_date = er_date.strftime("%Y%m%d")
er_date = er_raw.info["meas_date"].strftime("%Y%m%d")
er_bids_path = BIDSPath(
subject="emptyroom", task="noise", session=er_date, suffix="meg", root=bids_root
)
Expand Down
11 changes: 2 additions & 9 deletions mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import codecs
import warnings

from pkg_resources import parse_version

import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal, assert_array_almost_equal
Expand Down Expand Up @@ -858,10 +856,7 @@ def test_chpi(_bids_validate, tmp_path, format):
meg_json = bids_path.copy().update(suffix="meg", extension=".json")
meg_json_data = json.loads(meg_json.fpath.read_text(encoding="utf-8"))

if parse_version(mne.__version__) <= parse_version("0.23"):
assert "ContinuousHeadLocalization" not in meg_json_data
assert "HeadCoilFrequency" not in meg_json_data
elif format in ["fif_no_chpi", "fif"]:
if format in ["fif_no_chpi", "fif"]:
if format == "fif_no_chpi":
assert meg_json_data["ContinuousHeadLocalization"] is False
assert meg_json_data["HeadCoilFrequency"] == []
Expand Down Expand Up @@ -1870,10 +1865,8 @@ def test_bdf(_bids_validate, tmp_path):
if hasattr(raw.info, "_unlock"):
with raw.info._unlock():
raw.info["sfreq"] -= 10 # change raw.times, but retain shape
elif parse_version(mne.__version__) >= parse_version("0.23"):
raw.info["sfreq"] -= 10
else:
raw._times = raw._times / 5
raw.info["sfreq"] -= 10

Check warning on line 1869 in mne_bids/tests/test_write.py

View check run for this annotation

Codecov / codecov/patch

mne_bids/tests/test_write.py#L1869

Added line #L1869 was not covered by tests

with pytest.raises(ValueError, match="raw.times has changed"):
write_raw_bids(raw, bids_path, overwrite=True)
Expand Down
11 changes: 1 addition & 10 deletions mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
from collections import defaultdict, OrderedDict
import warnings

from pkg_resources import parse_version

import numpy as np
from scipy import linalg
import mne
Expand Down Expand Up @@ -599,7 +597,6 @@ def _scans_tsv(raw, raw_fname, fname, keep_source, overwrite=False):
if meas_date is None:
acq_time = "n/a"
elif isinstance(meas_date, datetime):
# for MNE >= v0.20
acq_time = meas_date.strftime("%Y-%m-%dT%H:%M:%S.%fZ")

# for fif files check whether raw file is likely to be split
Expand Down Expand Up @@ -892,7 +889,7 @@ def _sidecar_json(
system, _ = _get_meg_system(raw.info)
chpi = None
hpi_freqs = []
if datatype == "meg" and parse_version(mne.__version__) > parse_version("0.23"):
if datatype == "meg":
# We need to handle different data formats differently
if system == "CTF_275":
try:
Expand All @@ -915,12 +912,6 @@ def _sidecar_json(
hpi_freqs, _, _ = get_chpi_info(info=raw.info, on_missing="ignore")
hpi_freqs = list(hpi_freqs)

elif datatype == "meg":
logger.info(
"Cannot check for & write continuous head localization "
"information: requires MNE-Python >= 0.24"
)

# Define datatype-specific JSON dictionaries
ch_info_json_common = [
("TaskName", task),
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ install_requires =
mne >= 1.3
numpy >= 1.20.2
scipy >= 1.6.3
setuptools
packages = find:
include_package_data = True

Expand Down

0 comments on commit 63925af

Please sign in to comment.