Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ noted in the changelog (e.g., new functions or parameters, changes in parameter
improvements/enhancements. All fixes and modifications are backwards compatible.
- *.postN* : Consists of documentation changes or metadata-related updates, such as modifications to type hints.

## [0.37.3] - 2026-04-16
### ♻ Changed
- Added support for the ``NEUROCAPS_DATA`` environment variable to override the default data directory location used by fetch_preset_parcel_approach. Defaults to "~/neurocaps_data" when unset.

## [0.37.2] - 2026-02-19
### 💻 Metadata
- Update metadata on Pypi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version](https://img.shields.io/pypi/v/neurocaps.svg)](https://pypi.python.org/pypi/neurocaps/)
[![Python Versions](https://img.shields.io/pypi/pyversions/neurocaps.svg)](https://pypi.python.org/pypi/neurocaps/)
[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.11642615-teal)](https://doi.org/10.5281/zenodo.18529846)
[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.11642615-teal)](https://doi.org/10.5281/zenodo.19602764)
[![Test Status](https://github.com/donishadsmith/neurocaps/actions/workflows/testing.yaml/badge.svg)](https://github.com/donishadsmith/neurocaps/actions/workflows/testing.yaml)
[![Documentation Status](https://readthedocs.org/projects/neurocaps/badge/?version=stable)](http://neurocaps.readthedocs.io/en/stable/?badge=stable)
[![codecov](https://codecov.io/github/donishadsmith/neurocaps/branch/main/graph/badge.svg?token=WS2V7I16WF)](https://codecov.io/github/donishadsmith/neurocaps)
Expand Down
39 changes: 18 additions & 21 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,26 @@ RUN apt-get update && apt-get install -y \
ln -sf /usr/bin/python3.12 /usr/bin/python3 && \
curl https://bootstrap.pypa.io/get-pip.py | python3.12

# Create user and home directory;
# recursively change ownership of home directory to user;
# add user to sudo group
# Append no password requirement for sudo users to sudoers
RUN useradd -md /home/user user && \
chown -R user /home/user && \
adduser user sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV NILEARN_SHARED_DATA=/opt/neurocaps/data/nilearn_data \
NEUROMAPS_DATA=/opt/neurocaps/data/neuromaps-data \
NEUROCAPS_DATA=/opt/neurocaps/data/neurocaps_data

WORKDIR /home/user
ENV HOME="/home/user"
RUN mkdir -p /opt/neurocaps/src \
/opt/neurocaps/demos \
$NILEARN_SHARED_DATA \
$NEUROMAPS_DATA \
$NEUROCAPS_DATA

WORKDIR /opt/neurocaps

COPY neurocaps/ src/neurocaps/
COPY demos/* demos/
COPY docker/scripts/entrypoint.sh /usr/local/bin
COPY pyproject.toml src/
COPY tests/data/nilearn_data /home/user/nilearn_data
COPY tests/data/neuromaps-data /home/user/neuromaps-data
COPY demos/* demos/
COPY tests/data/nilearn_data $NILEARN_SHARED_DATA
COPY tests/data/neuromaps-data $NEUROMAPS_DATA
COPY docker/scripts/entrypoint.sh /usr/local/bin/

RUN chown -R user:user /home/user/ && \
chmod -R 775 /home/user/ && \
chown user /usr/local/bin/entrypoint.sh && \
sed -i "s/\r$//" /usr/local/bin/entrypoint.sh && \
RUN sed -i "s/\r$//" /usr/local/bin/entrypoint.sh && \
chmod +x /usr/local/bin/entrypoint.sh

RUN pip install --upgrade pip setuptools && \
Expand All @@ -66,12 +63,12 @@ RUN pip install --upgrade pip setuptools && \

RUN yes | plotly_get_chrome

EXPOSE 9999
LABEL maintainer="Donisha Smith <donishasmith@outlook.com>"
RUN chmod -R a+rwX /opt/neurocaps

RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix

USER user
EXPOSE 9999
LABEL maintainer="Donisha Smith <donishasmith@outlook.com>"

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

Expand Down
6 changes: 1 addition & 5 deletions docker/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

Xvfb :0 -screen 0 1600x1200x24 & export DISPLAY=:0

while !xset q &> /dev/null; do
sleep 0.1
done

if [ "$1" = "notebook" ]; then
if [[ "$1" == "notebook" || "$1" == "jupyter" || "$1" == "jupyter-notebook" ]]; then
exec jupyter notebook --allow-root --no-browser --ip=0.0.0.0 --port=9999
else
exec "$@"
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:alt: Python Versions

.. image:: https://img.shields.io/badge/DOI-10.5281%2Fzenodo.11642615-teal
:target: https://doi.org/10.5281/zenodo.18529846
:target: https://doi.org/10.5281/zenodo.19602764
:alt: DOI

.. image:: https://img.shields.io/badge/Source%20Code-neurocaps-purple
Expand Down
2 changes: 1 addition & 1 deletion neurocaps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
__all__ = ["analysis", "extraction", "exceptions", "utils"]

# Version in single place
__version__ = "0.37.2"
__version__ = "0.37.3"
9 changes: 6 additions & 3 deletions neurocaps/utils/datasets/_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ def is_valid_preset(name: str) -> None:

def get_data_dir() -> str:
"""
Gets the full path for 'neurocaps_data' in the users home directory. If it does not
exist, then the directory and the subfolders are created.
Gets the full path for 'neurocaps_data' in the users home directory or path set by
environmental variable. If it does not exist, then the directory and the subfolders
are created.
"""
data_dir = os.path.expanduser(os.path.join("~", "neurocaps_data"))
if not (data_dir := os.environ.get("NEUROCAPS_DATA")):
data_dir = os.path.expanduser(os.path.join("~", "neurocaps_data"))

# Create manually instead of using `fetch_files` to notify user that a directory was created
io_utils.makedir(data_dir)

Expand Down
4 changes: 4 additions & 0 deletions neurocaps/utils/parcellations.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def fetch_preset_parcel_approach(
Open Science Framework (OSF) if the corresponding files are not present in the
directory.

.. versionchanged:: 0.37.3
The data directory location can now be overridden via the ``NEUROCAPS_DATA``
environment variable. If unset, the default ``~/neurocaps_data`` location is used.

Parameters
----------
name : :obj:`str`
Expand Down
Loading