-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modern packaging + ruff + numpy 2 compat (#187)
* Modern packaging + ruff (NPY201) * move to src folder + ruff * Better pyproject + add tests for 3.12 * Fix install Windows * fix ruff for some docstring * Disable docstring formatting * disable py312 * ruff fixes * re-enable macos * disable macos * fix missing line code block rst * add tests folder to coverage * remove test folder from coverage * add libomp for macos-latest * 2nd attempt * re-enable lspopt * add setuptools dep * fix numpy deprecation * Merge branch 'master' into modern_packaging * Including manual conflict resolution on [test_]staging.py --------- Co-authored-by: Remington Mallett <[email protected]>
- Loading branch information
1 parent
6e6a067
commit 4dcd72d
Showing
55 changed files
with
307 additions
and
277 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Ruff | ||
on: [push, pull_request] | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Linting" | ||
uses: astral-sh/ruff-action@v1 | ||
- name: "Formatting" | ||
uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: "format --check" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
# Add README, LICENSE and requirements : | ||
# Add README and LICENSE : | ||
include README.rst | ||
include LICENSE | ||
include requirements.txt | ||
|
||
# Add trained classifiers | ||
# v0.4.0 | ||
include yasa/classifiers/clf_eeg_lgb_0.4.0.joblib | ||
include yasa/classifiers/clf_eeg+eog_lgb_0.4.0.joblib | ||
include yasa/classifiers/clf_eeg+eog+emg_lgb_0.4.0.joblib | ||
include yasa/classifiers/clf_eeg+eog+emg+demo_lgb_0.4.0.joblib | ||
|
||
# v0.5.0 | ||
include yasa/classifiers/clf_eeg_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+demo_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+eog_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+eog+demo_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+emg_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+emg+demo_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+eog+emg_lgb_0.5.0.joblib | ||
include yasa/classifiers/clf_eeg+eog+emg+demo_lgb_0.5.0.joblib | ||
recursive-include yasa/classifiers/ *.joblib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Build and upload a new version of YASA | ||
|
||
```bash | ||
python -m build | ||
twine upload dist/yasa-<VERSION> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,132 @@ | ||
[tool.black] | ||
[build-system] | ||
requires = ["setuptools>=70.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "yasa" | ||
description = "YASA: Analysis of polysomnography recordings." | ||
readme = "README.rst" | ||
license = {text = "BSD (3-clause)"} | ||
authors = [ | ||
{name = "Raphael Vallat", email = "[email protected]"}, | ||
{name = "Remington Mallett", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{name = "Raphael Vallat", email = "[email protected]"}, | ||
{name = "Remington Mallett", email = "[email protected]"}, | ||
] | ||
classifiers = [ | ||
"Intended Audience :: Science/Research", | ||
"Operating System :: MacOS", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
dynamic = ["version"] | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"numpy>=1.18.1", | ||
"scipy", | ||
"pandas", | ||
"matplotlib", | ||
"seaborn", | ||
"mne>=1.3", | ||
"numba>=0.57.1", | ||
"antropy", | ||
"scikit-learn", | ||
"tensorpac>=0.6.5", | ||
"pyriemann>=0.2.7", | ||
"sleepecg>=0.5.0", | ||
"setuptools>=70", | ||
"lspopt", | ||
"ipywidgets", | ||
"joblib", | ||
"lightgbm", | ||
] | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest>=6", | ||
"pytest-cov", | ||
# Ensure coverage is new enough for `source_pkgs`. | ||
"coverage[toml]>=5.3", | ||
"ruff" | ||
] | ||
docs = [ | ||
"sphinx>7.0.0", | ||
"pydata_sphinx_theme", | ||
"numpydoc", | ||
"sphinx-copybutton", | ||
"sphinx-design", | ||
"sphinx-notfound-page", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/raphaelvallat/yasa/" | ||
Downloads = "https://github.com/raphaelvallat/yasa/" | ||
|
||
[tool.setuptools] | ||
py-modules = ["yasa"] | ||
include-package-data = true | ||
|
||
[tool.setuptools.package-data] | ||
yasa = [ | ||
"classifiers/*.joblib", | ||
] | ||
|
||
[tool.setuptools.packages.find] | ||
namespaces = false | ||
where = ["src"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "yasa.__version__"} | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "--showlocals --durations=10 --maxfail=2 --cov" | ||
doctest_optionflags= ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"] | ||
filterwarnings = [ | ||
"ignore::UserWarning", | ||
"ignore::RuntimeWarning", | ||
"ignore::FutureWarning", | ||
] | ||
markers = ["slow"] | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
omit = [ | ||
"*/tests/*", | ||
] | ||
source_pkgs = ["yasa"] | ||
|
||
[tool.coverage.paths] | ||
source = ["src"] | ||
|
||
[tool.coverage.report] | ||
show_missing = true | ||
# sort = "Cover" | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
target-version = ['py311'] | ||
include = '\.pyi?$' | ||
target-version = "py311" | ||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. | ||
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or | ||
# McCabe complexity (`C901`) by default. | ||
lint.select = ["E4", "E7", "E9", "F", "I", "NPY201"] | ||
exclude = [ | ||
"notebooks", # Skip jupyter notebook examples | ||
"docs", | ||
] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"__init__.py" = ["F401", "F403"] # Ignore star and unused import violations for __init__.py files | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "numpy" | ||
|
||
[tool.ruff.format] | ||
docstring-code-format = false | ||
docstring-code-line-length = 90 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.