Skip to content

Commit

Permalink
[MNT] Update pyproject.toml (#142)
Browse files Browse the repository at this point in the history
* [MNT] Update pyproject.toml

Update `pyproject.toml` to Addressing #141, updating `pyproject.toml` so that `examples` and `resources` folders will not appear in the top-level of `site-packages`.

* Update tests.yml

Fix ruff

* Update colors.py

* Update colors.py

* Update stats.py
  • Loading branch information
liuzhenqi77 authored Nov 8, 2024
1 parent 117af21 commit 672d402
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install ruff
- name: Run style checks
run: ruff .
run: ruff check .

run_tests:
needs: check_style
Expand Down Expand Up @@ -67,4 +67,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit/test-results.xml
path: junit/test-results.xml
5 changes: 2 additions & 3 deletions netneurotools/colors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""Useful colormaps."""

import matplotlib
from matplotlib.colors import LinearSegmentedColormap, ListedColormap

__all__ = ['parula', 'justine', 'dinosaur']
Expand Down Expand Up @@ -94,10 +95,8 @@ def available_cmaps():

def _register_cmaps():
"""Register all colormaps in module so they are accessible via matplotlib."""
from matplotlib.cm import register_cmap

for cmap in __all__:
register_cmap(cmap, globals()[cmap])
matplotlib.colormaps.register(globals()[cmap], name=cmap)


_register_cmaps()
2 changes: 1 addition & 1 deletion netneurotools/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def permtest_rel(a, b, axis=0, n_perm=1000, seed=0):
abs_true = np.abs(true_diff)

# idx array
reidx = np.meshgrid(*[range(f) for f in ab.shape], indexing='ij')
reidx = list(np.meshgrid(*[range(f) for f in ab.shape], indexing='ij'))

permutations = np.ones(true_diff.shape)
for _ in range(n_perm):
Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ test = [
requires = ["setuptools", "versioneer[toml]"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages]
find = {}
[tool.setuptools.packages.find]
include = [
"netneurotools",
"netneurotools.*"
]

[tool.setuptools.dynamic]
version = {attr = "netneurotools.__version__"}
Expand Down Expand Up @@ -109,4 +112,4 @@ omit = [

[tool.codespell]
skip = '.git,*.pdf,*.svg,versioneer.py'
# ignore-words-list = ''
# ignore-words-list = ''

0 comments on commit 672d402

Please sign in to comment.