Skip to content

Commit

Permalink
Merge pull request netneurolab#144 from liuzhenqi77/improvements
Browse files Browse the repository at this point in the history
[ENH] Various improvements
  • Loading branch information
liuzhenqi77 authored Nov 20, 2024
2 parents 2c4d288 + 8d56d14 commit 107e2fe
Show file tree
Hide file tree
Showing 17 changed files with 254 additions and 49 deletions.
11 changes: 0 additions & 11 deletions .codecov.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ permissions:

jobs:
deploy_page:
if: github.repository_owner == 'netneurolab'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/tests.yml → .github/workflows/tests-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
check_style:
Expand All @@ -24,9 +26,9 @@ jobs:
python -m pip install --upgrade pip
python -m pip install ruff
- name: Run style checks
run: ruff check .
run: ruff check --output-format=github .

run_tests:
run_basic_tests:
needs: check_style
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -44,21 +46,14 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
- name: Install netneurotools
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
python -m pip install -r requirements.txt
- name: Install netneurotools
run: python -m pip install .
python -m pip install '.[test]'
- name: Print netneurotools version
run: python -c "import netneurotools; print(netneurotools.__version__)"
- name: Run tests
run: pytest --doctest-modules --cov=netneurotools --cov-report=xml --junitxml=junit/test-results.xml --verbose --pyargs netneurotools
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: coverage.xml
run: pytest --doctest-modules --junitxml=junit/test-results.xml --verbose -m "not (fetcher or pyvista or pysurfer)" netneurotools
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/tests-datasets-fetcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: netneurotools-tests

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'netneurotools/datasets/**'
pull_request:
branches:
- main
paths:
- 'netneurotools/datasets/**'

jobs:
run_fetcher_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install netneurotools
run: |
python -m pip install --upgrade pip
python -m pip install '.[test]'
- name: Print netneurotools version
run: python -c "import netneurotools; print(netneurotools.__version__)"
- name: Run tests
run: pytest --doctest-modules --junitxml=junit/test-results.xml --verbose -m fetcher netneurotools
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit/test-results.xml
46 changes: 46 additions & 0 deletions .github/workflows/tests-plotting-pyvista.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: netneurotools-tests

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'netneurotools/plotting/pyvista_plotters.py'
pull_request:
branches:
- main
paths:
- 'netneurotools/plotting/pyvista_plotters.py'

jobs:
run_pyvista_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install netneurotools
run: |
python -m pip install --upgrade pip
python -m pip install '.[test,pyvista]'
- name: Print netneurotools version
run: python -c "import netneurotools; print(netneurotools.__version__)"
- name: Run tests
run: pytest --doctest-modules --junitxml=junit/test-results.xml --verbose -m pyvista netneurotools
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit/test-results.xml
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
'sklearn': ('https://scikit-learn.org/stable', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'pyvista': ('https://docs.pyvista.org/', None),
}

doctest_global_setup = """\
Expand Down
File renamed without changes.
41 changes: 34 additions & 7 deletions netneurotools/datasets/fetch_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ def fetch_hansen_receptors(force=False, data_dir=None, verbose=1):
If you used this data, please cite [1]_.
.. important::
If you use this dataset, please also cite the original data sources.
See the original publication or `neuromaps <https://netneurolab.github.io/neuromaps/listofmaps.html>`_
for more information.
Returns
-------
filenames : :class:`sklearn.utils.Bunch`
Expand All @@ -208,7 +213,12 @@ def fetch_hansen_receptors(force=False, data_dir=None, verbose=1):
References
----------
.. [1]
.. [1] Justine Y Hansen, Golia Shafiei, Ross D Markello, Kelly Smart, Sylvia
ML Cox, Martin N\u00f8rgaard, Vincent Beliveau, Yanjun Wu,
Jean-Dominique Gallezot, \u00c9tienne Aumont, and others. Mapping
neurotransmitter systems to the structural and functional organization
of the human neocortex. Nature neuroscience, 25(11):1569\u20131581,
2022.
"""
dataset_name = "ds-hansen_receptors"
_get_reference_info(dataset_name, verbose=verbose)
Expand Down Expand Up @@ -244,7 +254,10 @@ def fetch_hansen_genescognition(force=False, data_dir=None, verbose=1):
References
----------
.. [1]
.. [1] Justine Y Hansen, Ross D Markello, Jacob W Vogel, Jakob Seidlitz,
Danilo Bzdok, and Bratislav Misic. Mapping gene transcription and
neurocognition across human neocortex. Nature Human Behaviour,
5(9):1240\u20131250, 2021.
"""
dataset_name = "ds-hansen_genescognition"
_get_reference_info(dataset_name, verbose=verbose)
Expand Down Expand Up @@ -280,7 +293,10 @@ def fetch_hansen_brainstemfc(force=False, data_dir=None, verbose=1):
References
----------
.. [1]
.. [1] Justine Y Hansen, Simone Cauzzo, Kavita Singh, Mar\u00eda Guadalupe
Garc\u00eda-Gomar, James M Shine, Marta Bianciardi, and Bratislav Misic.
Integrating brainstem and cortical functional architectures. Nature
Neuroscience, pages 1\u201312, 2024.
"""
dataset_name = "ds-hansen_brainstemfc"
_get_reference_info(dataset_name, verbose=verbose)
Expand Down Expand Up @@ -316,7 +332,10 @@ def fetch_shafiei_megfmrimapping(force=False, data_dir=None, verbose=1):
References
----------
.. [1]
.. [1] Golia Shafiei, Sylvain Baillet, and Bratislav Misic. Human
electromagnetic and haemodynamic networks systematically converge in
unimodal cortex and diverge in transmodal cortex. PLoS biology,
20(8):e3001735, 2022.
"""
dataset_name = "ds-shafiei_megfmrimapping"
_get_reference_info(dataset_name, verbose=verbose)
Expand Down Expand Up @@ -352,7 +371,10 @@ def fetch_shafiei_megdynamics(force=False, data_dir=None, verbose=1):
References
----------
.. [1]
.. [1] Golia Shafiei, Ben D Fulcher, Bradley Voytek, Theodore D
Satterthwaite, Sylvain Baillet, and Bratislav Misic. Neurophysiological
signatures of cortical micro-architecture. Nature communications,
14(1):6000, 2023.
"""
dataset_name = "ds-shafiei_megdynamics"
_get_reference_info(dataset_name, verbose=verbose)
Expand All @@ -367,7 +389,7 @@ def fetch_suarez_mami(force=False, data_dir=None, verbose=1):
This dataset contains
If you used this data, please cite [1]_.
If you used this data, please cite [1]_ and [2]_.
Returns
-------
Expand All @@ -388,7 +410,12 @@ def fetch_suarez_mami(force=False, data_dir=None, verbose=1):
References
----------
.. [1]
.. [1] Laura E Suarez, Yossi Yovel, Martijn P van den Heuvel, Olaf Sporns,
Yaniv Assaf, Guillaume Lajoie, and Bratislav Misic. A connectomics-based
taxonomy of mammals. Elife, 11:e78635, 2022.
.. [2] Yaniv Assaf, Arieli Bouznach, Omri Zomet, Assaf Marom, and Yossi
Yovel. Conservation of brain connectivity and wiring across the
mammalian class. Nature Neuroscience, 23(7):805\u2013808, 2020.
"""
dataset_name = "ds-suarez_mami"
_get_reference_info(dataset_name, verbose=verbose)
Expand Down
74 changes: 74 additions & 0 deletions netneurotools/datasets/netneurotools.bib
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,77 @@ @article{markello2022neuromaps
year={2022},
publisher={Nature Publishing Group US New York}
}

@article{hansen2021mapping,
title={Mapping gene transcription and neurocognition across human neocortex},
author={Hansen, Justine Y and Markello, Ross D and Vogel, Jacob W and Seidlitz, Jakob and Bzdok, Danilo and Misic, Bratislav},
journal={Nature Human Behaviour},
volume={5},
number={9},
pages={1240--1250},
year={2021},
publisher={Nature Publishing Group UK London}
}

@article{hansen2022mapping,
title={Mapping neurotransmitter systems to the structural and functional organization of the human neocortex},
author={Hansen, Justine Y and Shafiei, Golia and Markello, Ross D and Smart, Kelly and Cox, Sylvia ML and N{\o}rgaard, Martin and Beliveau, Vincent and Wu, Yanjun and Gallezot, Jean-Dominique and Aumont, {\'E}tienne and others},
journal={Nature neuroscience},
volume={25},
number={11},
pages={1569--1581},
year={2022},
publisher={Nature Publishing Group US New York}
}

@article{hansen2024integrating,
title={Integrating brainstem and cortical functional architectures},
author={Hansen, Justine Y and Cauzzo, Simone and Singh, Kavita and Garc{\'\i}a-Gomar, Mar{\'\i}a Guadalupe and Shine, James M and Bianciardi, Marta and Misic, Bratislav},
journal={Nature Neuroscience},
pages={1--12},
year={2024},
publisher={Nature Publishing Group US New York}
}

@article{shafiei2023neurophysiological,
title={Neurophysiological signatures of cortical micro-architecture},
author={Shafiei, Golia and Fulcher, Ben D and Voytek, Bradley and Satterthwaite, Theodore D and Baillet, Sylvain and Misic, Bratislav},
journal={Nature communications},
volume={14},
number={1},
pages={6000},
year={2023},
publisher={Nature Publishing Group UK London}
}

@article{shafiei2022human,
title={Human electromagnetic and haemodynamic networks systematically converge in unimodal cortex and diverge in transmodal cortex},
author={Shafiei, Golia and Baillet, Sylvain and Misic, Bratislav},
journal={PLoS biology},
volume={20},
number={8},
pages={e3001735},
year={2022},
publisher={Public Library of Science San Francisco, CA USA}
}

@article{suarez2022connectomics,
title={A connectomics-based taxonomy of mammals},
author={Suarez, Laura E and Yovel, Yossi and van den Heuvel, Martijn P and Sporns, Olaf and Assaf, Yaniv and Lajoie, Guillaume and Misic, Bratislav},
journal={Elife},
volume={11},
pages={e78635},
year={2022},
publisher={eLife Sciences Publications Limited}
}

@article{assaf2020conservation,
title={Conservation of brain connectivity and wiring across the mammalian class},
author={Assaf, Yaniv and Bouznach, Arieli and Zomet, Omri and Marom, Assaf and Yovel, Yossi},
journal={Nature Neuroscience},
volume={23},
number={7},
pages={805--808},
year={2020},
publisher={Nature Publishing Group US New York}
}
Loading

0 comments on commit 107e2fe

Please sign in to comment.