Skip to content

Commit

Permalink
Move more metadata and build flags from setup.py to pyproject.toml (#…
Browse files Browse the repository at this point in the history
…12060)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
  • Loading branch information
3 people authored Oct 3, 2023
1 parent a8b4638 commit b069d4a
Show file tree
Hide file tree
Showing 23 changed files with 125 additions and 126 deletions.
2 changes: 1 addition & 1 deletion mne/_ola.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def __init__(
window="hann",
tol=1e-10,
*,
verbose=None
verbose=None,
):
n_samples = _ensure_int(n_samples, "n_samples")
n_overlap = _ensure_int(n_overlap, "n_overlap")
Expand Down
2 changes: 1 addition & 1 deletion mne/beamformer/_lcmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def make_lcmv(
noise_cov=noise_cov,
rank=rank,
pca=False,
**depth
**depth,
)
ch_names = list(info["ch_names"])

Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/brainstorm/bst_auditory.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def data_path(
download=True,
accept=False,
*,
verbose=None
verbose=None,
): # noqa: D103
return _download_mne_dataset(
name="bst_auditory",
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/brainstorm/bst_phantom_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def data_path(
download=True,
accept=False,
*,
verbose=None
verbose=None,
): # noqa: D103
return _download_mne_dataset(
name="bst_phantom_ctf",
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/brainstorm/bst_phantom_elekta.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def data_path(
download=True,
accept=False,
*,
verbose=None
verbose=None,
): # noqa: D103
return _download_mne_dataset(
name="bst_phantom_elekta",
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/brainstorm/bst_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def data_path(
download=True,
accept=False,
*,
verbose=None
verbose=None,
): # noqa: D103
return _download_mne_dataset(
name="bst_raw",
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/brainstorm/bst_resting.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def data_path(
download=True,
accept=False,
*,
verbose=None
verbose=None,
): # noqa: D103
return _download_mne_dataset(
name="bst_resting",
Expand Down
6 changes: 3 additions & 3 deletions mne/datasets/sleep_physionet/age.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def fetch_data(
base_url=BASE_URL,
on_missing="raise",
*,
verbose=None
verbose=None,
): # noqa: D301, E501
"""Get paths to local copies of PhysioNet Polysomnography dataset files.
Expand Down Expand Up @@ -134,12 +134,12 @@ def fetch_data(
psg_fname, pdl = _fetch_one(
psg_records["fname"][idx].decode(),
psg_records["sha"][idx].decode(),
*params
*params,
)
hyp_fname, hdl = _fetch_one(
hyp_records["fname"][idx].decode(),
hyp_records["sha"][idx].decode(),
*params
*params,
)
fnames.append([psg_fname, hyp_fname])
if pdl:
Expand Down
4 changes: 2 additions & 2 deletions mne/datasets/sleep_physionet/temazepam.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def fetch_data(
psg_fname, pdl = _fetch_one(
records["psg fname"][idx].decode(),
records["psg sha"][idx].decode(),
*params
*params,
)
hyp_fname, hdl = _fetch_one(
records["hyp fname"][idx].decode(),
records["hyp sha"][idx].decode(),
*params
*params,
)
fnames.append([psg_fname, hyp_fname])
if pdl:
Expand Down
2 changes: 1 addition & 1 deletion mne/datasets/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_fetch_parcellations(tmp_path):
labels,
parc="HCPMMP1_round",
table_name="./left.fsaverage164.label.gii",
**kwargs
**kwargs,
)
orig = op.join(this_subjects_dir, "fsaverage", "label", "lh.HCPMMP1.annot")
first = hashfunc(orig)
Expand Down
2 changes: 1 addition & 1 deletion mne/decoding/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def _fit_and_score(
error_score="raise",
*,
verbose=None,
position=0
position=0,
):
"""Fit estimator and compute scores for a given dataset split."""
# This code is adapted from sklearn
Expand Down
4 changes: 2 additions & 2 deletions mne/decoding/csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def plot_patterns(
name_format="CSP%01d",
nrows=1,
ncols="auto",
show=True
show=True,
):
"""Plot topographic patterns of components.
Expand Down Expand Up @@ -412,7 +412,7 @@ def plot_filters(
name_format="CSP%01d",
nrows=1,
ncols="auto",
show=True
show=True,
):
"""Plot topographic filters of components.
Expand Down
6 changes: 3 additions & 3 deletions mne/decoding/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def __init__(
n_jobs=None,
normalization="length",
*,
verbose=None
verbose=None,
): # noqa: D102
self.sfreq = sfreq
self.fmin = fmin
Expand Down Expand Up @@ -512,7 +512,7 @@ def __init__(
iir_params=None,
fir_design="firwin",
*,
verbose=None
verbose=None,
): # noqa: D102
self.info = info
self.l_freq = l_freq
Expand Down Expand Up @@ -838,7 +838,7 @@ def __init__(
fir_window="hamming",
fir_design="firwin",
*,
verbose=None
verbose=None,
): # noqa: D102
self.l_freq = l_freq
self.h_freq = h_freq
Expand Down
6 changes: 3 additions & 3 deletions mne/minimum_norm/resolution_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _get_psf_ctf(
norm,
return_pca_vars,
vector=False,
verbose=None
verbose=None,
):
"""Get point-spread (PSFs) or cross-talk (CTFs) functions."""
# check for consistencies in input parameters
Expand Down Expand Up @@ -302,7 +302,7 @@ def get_point_spread(
norm=False,
return_pca_vars=False,
vector=False,
verbose=None
verbose=None,
):
"""Get point-spread (PSFs) functions for vertices.
Expand Down Expand Up @@ -351,7 +351,7 @@ def get_cross_talk(
norm=False,
return_pca_vars=False,
vector=False,
verbose=None
verbose=None,
):
"""Get cross-talk (CTFs) function for vertices.
Expand Down
2 changes: 1 addition & 1 deletion mne/preprocessing/ecg.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _make_ecg(inst, start, stop, reject_by_annotation=False, verbose=None):
picks,
return_times=True,
**kwargs,
reject_by_annotation=reject_by_annotation
reject_by_annotation=reject_by_annotation,
)
elif isinstance(inst, BaseEpochs):
ecg = np.hstack(inst.copy().get_data(picks, **kwargs))
Expand Down
4 changes: 2 additions & 2 deletions mne/time_frequency/multitaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def psd_array_multitaper(
n_jobs=None,
*,
max_iter=150,
verbose=None
verbose=None,
):
r"""Compute power spectral density (PSD) using a multi-taper method.
Expand Down Expand Up @@ -475,7 +475,7 @@ def tfr_array_multitaper(
output="complex",
n_jobs=None,
*,
verbose=None
verbose=None,
):
"""Compute Time-Frequency Representation (TFR) using DPSS tapers.
Expand Down
2 changes: 1 addition & 1 deletion mne/viz/montage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def plot_montage(
sphere=None,
*,
axes=None,
verbose=None
verbose=None,
):
"""Plot a montage.
Expand Down
93 changes: 90 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
[project]
name = "mne"
description = "MNE-Python project for MEG and EEG data analysis."
maintainers = [
{ name = "Alexandre Gramfort", email = "alexandre.gramfort@inria.fr" },
]
dynamic = ["version"]
license = { text = "BSD-3-Clause" }
readme = { file = "README.rst", content-type = "text/x-rst" }
requires-python = ">=3.8"
keywords = [
"neuroscience",
"neuroimaging",
"MEG",
"EEG",
"ECoG",
"fNIRS",
"brain",
]
classifiers = [
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
]

[project.scripts]
mne = "mne.commands.utils:main"

[project.urls]
Homepage = "https://mne.tools/"
Download = "https://pypi.org/project/scikit-learn/#files"
"Bug Tracker" = "https://github.com/mne-tools/mne-python/issues/"
Documentation = "https://mne.tools/"
Forum = "https://mne.discourse.group/"
"Source Code" = "https://github.com/mne-tools/mne-python/"

[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "mne/_version.py"
version_scheme = "release-branch-semver"

[options]
zip_safe = false # the package can run out of an .egg file
include_package_data = true

[tool.setuptools.package-data]
"mne" = [
"data/eegbci_checksums.txt",
"data/*.sel",
"data/icos.fif.gz",
"data/coil_def*.dat",
"data/helmets/*.fif.gz",
"data/FreeSurferColorLUT.txt",
"data/image/*gif",
"data/image/*lout",
"data/fsaverage/*.fif",
"channels/data/layouts/*.lout",
"channels/data/layouts/*.lay",
"channels/data/montages/*.sfp",
"channels/data/montages/*.txt",
"channels/data/montages/*.elc",
"channels/data/neighbors/*.mat",
"datasets/sleep_physionet/SHA1SUMS",
"datasets/_fsaverage/*.txt",
"datasets/_infant/*.txt",
"datasets/_phantom/*.txt",
"html/*.js",
"html/*.css",
"html_templates/repr/*.jinja",
"html_templates/report/*.jinja",
"icons/*.svg",
"icons/*.png",
"io/artemis123/resources/*.csv",
"io/edf/gdf_encodes.txt",
]

[tool.codespell]
ignore-words = "ignore_words.txt"
builtin = "clear,rare,informal,names,usage"
Expand All @@ -19,12 +106,12 @@ ignore-decorators = [
"setter",
"mne.utils.copy_function_doc_to_method_doc",
"mne.utils.copy_doc",
"mne.utils.deprecated"
"mne.utils.deprecated",
]

[tool.ruff.per-file-ignores]
"tutorials/time-freq/10_spectrum_class.py" = [
"E501" # line too long
"E501", # line too long
]
"mne/datasets/*/*.py" = [
"D103", # Missing docstring in public function
Expand Down Expand Up @@ -52,4 +139,4 @@ junit_family = "xunit2"
exclude = "(dist/)|(build/)|(.*\\.ipynb)"

[tool.bandit.assert_used]
skips = ["*/test_*.py"] # assert statements are good practice with pytest
skips = ["*/test_*.py"] # assert statements are good practice with pytest
Loading

0 comments on commit b069d4a

Please sign in to comment.