[DOC]: Add Zenodo shield and improve documentation #247

Merged
synchon merged 7 commits from chore/update-docs into main 2023-07-24 13:42:45 +00:00
10 changed files with 43 additions and 40 deletions

View file

@ -11,10 +11,11 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8176570.svg)](https://doi.org/10.5281/zenodo.8176570)
## About ## About
junifer is a data handling and feature extraction library targeted towards neuroimaging data specifically functional MRI data. `junifer` is a data handling and feature extraction library targeted towards neuroimaging data specifically functional MRI data.
It is currently being developed and maintained at the [Applied Machine Learning](https://www.fz-juelich.de/en/inm/inm-7/research-groups/applied-machine-learning-aml) group at [Forschungszentrum Juelich](https://www.fz-juelich.de/en), Germany. Although the library is designed for people working at [Institute of Neuroscience and Medicine - Brain and Behaviour (INM-7)](https://www.fz-juelich.de/en/inm/inm-7), it is designed to be as modular as possible thus enabling others to extend it easily. It is currently being developed and maintained at the [Applied Machine Learning](https://www.fz-juelich.de/en/inm/inm-7/research-groups/applied-machine-learning-aml) group at [Forschungszentrum Juelich](https://www.fz-juelich.de/en), Germany. Although the library is designed for people working at [Institute of Neuroscience and Medicine - Brain and Behaviour (INM-7)](https://www.fz-juelich.de/en/inm/inm-7), it is designed to be as modular as possible thus enabling others to extend it easily.
@ -55,12 +56,12 @@ conda install -c conda-forge junifer
## Citation ## Citation
If you use junifer in a scientific publication, we would appreciate if you cite our work. Currently, we do not have a publication, so feel free to use the project [URL](https://juaml.github.io/junifer). If you use `junifer` in a scientific publication, we would appreciate if you cite our work. Currently, we do not have a publication, so feel free to use the project's [Zenodo URL](https://doi.org/10.5281/zenodo.8176569).
## Funding ## Funding
We thank the [Helmholtz Imaging Platform](https://helmholtz-imaging.de/) and We thank the [Helmholtz Imaging Platform](https://helmholtz-imaging.de/) and
[SMHB](https://www.fz-juelich.de/en/smhb) for supporting development of Junifer. [SMHB](https://www.fz-juelich.de/en/smhb) for supporting development of `junifer`.
(The funding sources had no role in the design, implementation and evaluation of the pipeline.) (The funding sources had no role in the design, implementation and evaluation of the pipeline.)
## Contribution ## Contribution
@ -72,7 +73,7 @@ Contributions are welcome and greatly appreciated. Please read the [guidelines](
junifer is released under the AGPL v3 license: junifer is released under the AGPL v3 license:
junifer, FZJuelich AML neuroimaging feature extraction library. junifer, FZJuelich AML neuroimaging feature extraction library.
Copyright (C) 2022, authors of junifer. Copyright (C) 2023, authors of junifer.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by

View file

@ -0,0 +1 @@
Add Zenodo badge in ``README`` and improve general documentation by `Synchon Mandal`_

View file

@ -2,8 +2,8 @@
.. _contribution_guidelines: .. _contribution_guidelines:
Contributing to junifer Contributing
======================= ============
Setting up the local development environment Setting up the local development environment
-------------------------------------------- --------------------------------------------

View file

@ -30,58 +30,58 @@ before proceeding.
#. Make sure you are in sync with the main branch. #. Make sure you are in sync with the main branch.
.. code-block:: bash .. code-block:: bash
git checkout main git checkout main
git pull --rebase origin main git pull --rebase origin main
#. Run the following to check changelog is properly generated: #. Run the following to check changelog is properly generated:
.. code-block:: bash .. code-block:: bash
towncrier build --draft towncrier build --draft
#. Then, run: #. Then, run:
.. code-block:: bash .. code-block:: bash
towncrier towncrier
to generate the proper changelog that should be reflected in to generate the proper changelog that should be reflected in
``docs/whats_new.rst``. ``docs/whats_new.rst``.
#. Commit the changes, make a PR and merge via a merge commit. #. Commit the changes, make a PR and merge via a merge commit.
#. Make sure you are in sync with the main branch. #. Make sure you are in sync with the main branch.
.. code-block:: bash .. code-block:: bash
git checkout main git checkout main
git pull --rebase origin main git pull --rebase origin main
#. Create tag (replace ``X.Y.Z`` with the proper version) on the merged PR's #. Create tag (replace ``X.Y.Z`` with the proper version) on the merged PR's
merge commit. merge commit.
.. code-block:: bash .. code-block:: bash
git tag -a vX.Y.Z -m "Release X.Y.Z" git tag -a vX.Y.Z -m "Release X.Y.Z"
#. Check that the build system is creating the proper version #. Check that the build system is creating the proper version
.. code-block:: bash .. code-block:: bash
SETUPTOOLS_SCM_DEBUG=1 python -m build --source --binary --out-dir dist/ . SETUPTOOLS_SCM_DEBUG=1 python -m build --outdir dist/ .
#. Push the tag #. Push the tag
.. code-block:: bash .. code-block:: bash
git push origin --follow-tags git push origin --follow-tags
#. Optional: bump the *MAJOR* or *MINOR* segment of next release (replace #. Optional: bump the *MAJOR* or *MINOR* segment of next release (replace
``D.E.0`` with the proper version). ``D.E.0`` with the proper version).
.. code-block:: bash .. code-block:: bash
git tag -a vD.E.0.dev -m "Set next release to D.E.0" git tag -a vD.E.0.dev -m "Set next release to D.E.0"
git push origin --follow-tags git push origin --follow-tags

View file

@ -213,7 +213,7 @@ def get_mask(
all_masks = [] all_masks = []
for t_mask in true_masks: for t_mask in true_masks:
if isinstance(t_mask, dict): if isinstance(t_mask, dict):
mask_name = list(t_mask.keys())[0] mask_name = next(iter(t_mask.keys()))
mask_params = t_mask[mask_name] mask_params = t_mask[mask_name]
else: else:
mask_name = t_mask mask_name = t_mask

View file

@ -411,7 +411,7 @@ def test_get_mask_multiple(
computed = get_mask(masks=junifer_masks, target_data=input["BOLD"]) computed = get_mask(masks=junifer_masks, target_data=input["BOLD"])
masks_names = [ masks_names = [
list(x.keys())[0] if isinstance(x, dict) else x for x in masks next(iter(x.keys())) if isinstance(x, dict) else x for x in masks
] ]
mask_funcs = [ mask_funcs = [

View file

@ -197,7 +197,7 @@ def test_marker_collection_storage(tmp_path: Path) -> None:
features = storage.list_features() features = storage.list_features()
assert len(features) == 3 assert len(features) == 3
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
t_feature = storage.read_df(feature_md5=feature_md5) t_feature = storage.read_df(feature_md5=feature_md5)
fname = "gmd_schaefer100x7_mean" fname = "gmd_schaefer100x7_mean"
t_data = out[fname]["VBM_GM"]["data"] # type: ignore t_data = out[fname]["VBM_GM"]["data"] # type: ignore

View file

@ -114,7 +114,8 @@ class PandasBaseFeatureStorage(BaseFeatureStorage):
if len(elem_idx) == 1: if len(elem_idx) == 1:
# Create normal index for vector # Create normal index for vector
index = pd.Index( index = pd.Index(
data=list(elem_idx.values())[0], name=list(elem_idx.keys())[0] data=next(iter(elem_idx.values())),
name=next(iter(elem_idx.keys())),
) )
else: else:
# Create multiindex for timeseries # Create multiindex for timeseries

View file

@ -175,7 +175,7 @@ def test_store_metadata_and_list_features(tmp_path: Path) -> None:
# List the stored features # List the stored features
features = storage.list_features() features = storage.list_features()
# Get the first MD5 # Get the first MD5
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
# Check the MD5 # Check the MD5
assert meta_md5 == feature_md5 assert meta_md5 == feature_md5

View file

@ -335,7 +335,7 @@ def test_store_df_and_read_df(tmp_path: Path) -> None:
with pytest.raises(ValueError, match="Only one"): with pytest.raises(ValueError, match="Only one"):
storage.read_df(feature_name="wrong_name", feature_md5="wrong_md5") storage.read_df(feature_name="wrong_name", feature_md5="wrong_md5")
# Get MD5 hash of features # Get MD5 hash of features
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "feature_md5" == feature_md5 assert "feature_md5" == feature_md5
# Check for key # Check for key
assert "BOLD_markername" == features[feature_md5]["name"] assert "BOLD_markername" == features[feature_md5]["name"]
@ -373,7 +373,7 @@ def test_store_metadata(tmp_path: Path) -> None:
meta_md5=meta_md5, element=element_to_store, meta=meta_to_store meta_md5=meta_md5, element=element_to_store, meta=meta_to_store
) )
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert meta_md5 == feature_md5 assert meta_md5 == feature_md5
@ -474,7 +474,7 @@ def test_store_matrix(tmp_path: Path) -> None:
stored_names = [f"{i}~{j}" for i in row_names for j in col_names] stored_names = [f"{i}~{j}" for i in row_names for j in col_names]
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "BOLD_fc" == features[feature_md5]["name"] assert "BOLD_fc" == features[feature_md5]["name"]
read_df = storage.read_df(feature_md5=feature_md5) read_df = storage.read_df(feature_md5=feature_md5)
@ -498,7 +498,7 @@ def test_store_matrix(tmp_path: Path) -> None:
for j in range(data.shape[1]) for j in range(data.shape[1])
] ]
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "BOLD_fc" == features[feature_md5]["name"] assert "BOLD_fc" == features[feature_md5]["name"]
read_df = storage.read_df(feature_md5=feature_md5) read_df = storage.read_df(feature_md5=feature_md5)
assert list(read_df.columns) == stored_names assert list(read_df.columns) == stored_names
@ -563,7 +563,7 @@ def test_store_matrix(tmp_path: Path) -> None:
] ]
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "BOLD_fc" == features[feature_md5]["name"] assert "BOLD_fc" == features[feature_md5]["name"]
read_df = storage.read_df(feature_md5=feature_md5) read_df = storage.read_df(feature_md5=feature_md5)
assert list(read_df.columns) == stored_names assert list(read_df.columns) == stored_names
@ -595,7 +595,7 @@ def test_store_matrix(tmp_path: Path) -> None:
] ]
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "BOLD_fc" == features[feature_md5]["name"] assert "BOLD_fc" == features[feature_md5]["name"]
read_df = storage.read_df(feature_md5=feature_md5) read_df = storage.read_df(feature_md5=feature_md5)
assert list(read_df.columns) == stored_names assert list(read_df.columns) == stored_names
@ -632,7 +632,7 @@ def test_store_matrix(tmp_path: Path) -> None:
] ]
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "BOLD_fc" == features[feature_md5]["name"] assert "BOLD_fc" == features[feature_md5]["name"]
read_df = storage.read_df(feature_md5=feature_md5) read_df = storage.read_df(feature_md5=feature_md5)
assert list(read_df.columns) == stored_names assert list(read_df.columns) == stored_names
@ -663,7 +663,7 @@ def test_store_matrix(tmp_path: Path) -> None:
] ]
features = storage.list_features() features = storage.list_features()
feature_md5 = list(features.keys())[0] feature_md5 = next(iter(features.keys()))
assert "BOLD_fc" == features[feature_md5]["name"] assert "BOLD_fc" == features[feature_md5]["name"]
read_df = storage.read_df(feature_md5=feature_md5) read_df = storage.read_df(feature_md5=feature_md5)
assert list(read_df.columns) == stored_names assert list(read_df.columns) == stored_names