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
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: true

steps:
Expand Down Expand Up @@ -46,11 +46,22 @@ jobs:
rm "${{ github.workspace }}\hdf\HDF5-1.10.7-win64.msi"
rm "${{ github.workspace }}\msi.log"
}
- name: Install HDF5 (macOS)
- name: Install HDF5 and CVXOPT (macOS)
if: ${{ runner.os == 'macOS' }}
env:
# see https://github.com/cvxopt/cvxopt/blob/master/.github/workflows/macos_build.yml
CVXOPT_SUITESPARSE_LIB_DIR: /opt/homebrew/lib
CVXOPT_SUITESPARSE_INC_DIR: /opt/homebrew/include/suitesparse
CVXOPT_BLAS_LIB_DIR: /opt/homebrew/opt/openblas/lib
CVXOPT_BLAS_LIB: openblas
CVXOPT_LAPACK_LIB: openblas
LDFLAGS: -L/opt/homebrew/opt/openblas/lib
CPPFLAGS: -I/opt/homebrew/opt/openblas/include
run: |
brew update
brew install hdf5
brew --prefix
brew install hdf5 openblas gsl fftw suite-sparse glpk
python -m pip install --upgrade pip
python -m pip install cvxopt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ An attempt to rewrite the project documentation is available as a [separate proj

## Installation

You will need Python >= 3.6.
You will need Python >= 3.8.

### Windows users

Expand All @@ -26,10 +26,10 @@ pip install tramway
Note that the HDF5 library can usually be installed using any OS' package manager.
Only Windows users may have to [manually download and install the HDF5 library](https://tramway.readthedocs.io/en/latest/libhdf5.html), if they do not wish to use Conda instead of pip.

Several installation targets are available, including `full`, that install optional dependencies:
Several installation targets are available; they install optional dependencies. For example (recommended):

```
pip install tramway[full]
pip install tramway[roi,animate]
```

Most of the functionalities and code examples described in the documentation will run without optional dependencies.
Expand Down
77 changes: 77 additions & 0 deletions containers/available_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,80 @@ urllib3==1.25.8
wheel==0.43.0 # py312 only
zipp==3.18.1 # py<310 only
```

* tramway-hpc-250124-py3{[8](https://dl.pasteur.fr/fop/xVjMGhTa/tramway-hpc-2501024-py38.sif),[9](https://dl.pasteur.fr/fop/AyK3JTC0/tramway-hpc-2501024-py39.sif),[10](https://dl.pasteur.fr/fop/jEmrwWhp/tramway-hpc-2501024-py310.sif),[11](https://dl.pasteur.fr/fop/QmL7TE6w/tramway-hpc-2501024-py311.sif),[12](https://dl.pasteur.fr/fop/elytCrRB/tramway-hpc-2501024-py312.sif),[13](https://dl.pasteur.fr/fop/hSeIMslv/tramway-hpc-2501024-py313.sif)}.sif

*tramway0.6.9* image with targets *hpc-minimal* and *animate*, and *scikit-learn* as an additional package.
Python is available as *python3.x*, with *x* any of *8*, *9*, *10*, *11*, *12*, *13* depending on the container file.
The run command admits option *-s*, passed to Python,
resulting in command (e.g.) `python3.x -s -m tramway $@`.
The included Python dependencies are the following:

```
certifi==2019.11.28
chardet==3.0.4
contourpy==1.1.1 # py == 3.8
contourpy==1.3.0 # py == 3.9
contourpy==1.3.1 # py >= 3.10
cvxopt==1.3.2
cycler==0.12.1
dbus-python==1.2.16
fonttools==4.55.5
h5py==3.11.0 # py == 3.8
h5py==3.12.1 # py >= 3.9
idna==2.8
imageio==2.35.1 # py == 3.8
imageio==2.37.0 # py >= 3.9
importlib_resources==6.4.5 # py == 3.8
importlib_resources==6.5.2 # py == 3.9
joblib==1.4.2
kiwisolver==1.4.7 # py <= 3.9
kiwisolver==1.4.8 # py >= 3.10
lazy_loader==0.4
matplotlib==3.7.5 # py == 3.8
matplotlib==3.9.4 # py == 3.9
matplotlib==3.10.0 # py >= 3.10
networkx==3.1 # py == 3.8
networkx==3.2.1 # py == 3.9
networkx==3.4.2 # py >= 3.10
numpy==1.24.4 # py == 3.8
numpy==2.0.2 # py == 3.9
numpy==2.2.2 # py >= 3.10
opencv-python==4.11.0.86
packaging==24.2
pandas==2.0.3 # py == 3.8
pandas==2.2.3 # py >= 3.9
pillow==10.4.0 # py == 3.8
pillow==11.1.0 # py >= 3.9
polytope==0.2.5
PyGObject==3.36.0
pyparsing==3.1.4 # py == 3.8
pyparsing==3.2.1 # py >= 3.9
python-apt==2.0.1+ubuntu0.20.4.1
python-dateutil==2.9.0.post0
pytz==2024.2
requests==2.22.0
requests-unixsocket==0.2.0
rwa-python==0.9.5
scikit-image==0.21.0 # py == 3.8
scikit-image==0.24.0 # py == 3.9
scikit-image==0.25.0 # py >= 3.10
scikit-learn==1.3.2 # py == 3.8
scikit-learn==1.6.1 # py >= 3.9
scipy==1.10.1 # py == 3.8
scipy==1.13.1 # py == 3.9
scipy==1.15.1 # py >= 3.10
setuptools==75.8.0 # py >= 3.11
six==1.17.0
stopit==1.1.2
threadpoolctl==3.5.0
tifffile==2023.7.10 # py == 3.8
tifffile==2024.8.30 # py == 3.9
tifffile==2025.1.10 # py >= 3.10
tqdm==4.67.1
tzdata==2025.1
urllib3==1.25.8
zipp==3.20.2 # py == 3.8
zipp==3.21.0 # py == 3.9
```

12 changes: 8 additions & 4 deletions containers/container-pip-freeze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ CONTAINER=$1
shift

if [ -z $1 ]; then
SINGULARITY="singularity"
SINGULARITY="singularity exec"
else
SINGULARITY=$1
SINGULARITY="$1 exec"
fi

PYTHON=$($SINGULARITY exec "$CONTAINER" ./detect_python.sh)
if [ -d /pasteur ]; then
SINGULARITY="$SINGULARITY -B /pasteur"
fi

PYTHON=$($SINGULARITY "$CONTAINER" ./detect_python.sh)
echo $PYTHON

$SINGULARITY exec "$CONTAINER" $PYTHON -s -m pip freeze
$SINGULARITY "$CONTAINER" $PYTHON -s -m pip freeze

9 changes: 4 additions & 5 deletions containers/detect_python.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/bin/bash

for ((minor=12;6<=minor;minor--)); do
for ((minor=13;6<=minor;minor--)); do
py=python3.$minor
if [ -x "$(command -v $py)" ]; then
if [ -z "$($py -m pip show -q tramway 2>&1)" ]; then
if command -v $py &>/dev/null; then
if $py -m pip freeze | grep tramway &>/dev/null; then
echo $py
exit 0
fi
fi
done

py=python2.7
if [ -x "$(command -v $py)" ]; then
if command -v $py &>/dev/null; then
if [ -z "$($py -m pip show -q tramway 2>&1)" ]; then
echo $py
exit 0
fi
fi

exit 1

74 changes: 74 additions & 0 deletions containers/tramway-hpc-py313
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Bootstrap: docker
From: ubuntu:focal

%help
TRamWAy is available in the python3.13 environment:
python3.13 -m tramway
The container OS is Ubuntu Focal Fossa.

%setup

#echo "fr_FR.UTF-8 UTF-8" > ${SINGULARITY_ROOTFS}/etc/locale.gen
echo "en_GB.UTF-8 UTF-8" > ${SINGULARITY_ROOTFS}/etc/locale.gen
if ! [ -f ${SINGULARITY_ROOTFS}/root/get-pip.py ]; then
wget -P ${SINGULARITY_ROOTFS}/root/ -- https://bootstrap.pypa.io/get-pip.py
fi

# TRamWAy can be installed in any of the following 3 ways:
# 1. using `pip install tramway` (stable release)
# 2. using `git clone`+`pip install .` (git version, default)
# 3. copying your own copy of TRamWAy into the container (local version)

# (3.) test local changes that have not been committed yet:
LOCAL=/path/to/local/TRamWAy
if [ -d $LOCAL ]; then
CONTAINED=${SINGULARITY_ROOTFS}/root/TRamWAy
mkdir -p ${CONTAINED}
cp -u -t ${CONTAINED}/ ${LOCAL}/setup.py ${LOCAL}/requirements.txt ${LOCAL}/README.md
cp -ru -t ${CONTAINED}/ ${LOCAL}/tramway ${LOCAL}/scripts
fi

%post

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
apt-get update -y
apt-get install -y --no-install-recommends locales
locale-gen
apt-get install -y --no-install-recommends libhdf5-103 ffmpeg \
build-essential git software-properties-common libopenblas0 glpk-utils

# Python 3.13
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update -y
apt-get install -y --no-install-recommends python3.13 python3.13-venv
rm -rf /var/lib/apt/lists/*
python3.13 /root/get-pip.py
export LC_ALL=C
#pip3.13 install --upgrade pip
pip3.13 uninstall -qy tramway || true

# (2.) and (3.)
cd /root
if ! [ -d TRamWAy ]; then
git clone https://github.com/DecBayComp/TRamWAy -b dev --single-branch --depth 1 --no-tags
fi
cd TRamWAy
pip3.13 install .[hpc-minimal,animate]

# (1.)
#pip3.13 install tramway[hpc-minimal,animate]

pip3.13 install scikit-learn

mkdir -p /pasteur

%runscript

cmd="tramway"
python="python3.13"
if [ -n "$1" -a "$1" = "-s" ]; then
cmd="${python} -s -m tramway"
shift
fi
exec $cmd $@

6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sys.path.insert(0, os.path.abspath('..'))


# mocking out rwa (and hopefully h5py) for readthedocs to successfully compile the project and
# mocking out rwa (and hopefully h5py) for readthedocs to successfully compile the project and
# generate the doc
mock_ok = True
try:
Expand Down Expand Up @@ -75,7 +75,7 @@ def __getattr__(cls, name):

# General information about the project.
project = u'TRamWAy'
copyright = u'2017-2021, Institut Pasteur'
copyright = u'2017-2025, Institut Pasteur'
author = u'François Laurent'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -85,7 +85,7 @@ def __getattr__(cls, name):
# The short X.Y version.
version = u'0.6'
# The full version, including alpha/beta/rc tags.
release = u'0.6.3'
release = u'0.6.9'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
14 changes: 4 additions & 10 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

You will need Python >= 3.6.
You will need Python >= 3.8.

Windows users
-------------
Expand All @@ -22,9 +22,9 @@ From PyPI
Note that the HDF5 library can usually be installed using any OS' package manager.
Only Windows users may have to :ref:`manually download and install the HDF5 library <hdf5_install>`, if they do not wish to use Conda instead of pip.

Several installation targets are available, including ``full``, that install optional dependencies::
Several installation targets are available; they install optional dependencies. For example (recommended)::

pip install tramway[full]
pip install tramway[roi,animate]

Most of the functionalities and code examples described in this documentation will run without the optional dependencies this target installs in addition to the required dependencies.
It is safe to first install |tramway| with minimal requirements and then ``pip install`` the missing dependencies as you hit ``ImportError`` while using |tramway|.
Expand All @@ -47,7 +47,7 @@ Initial install::

git clone https://github.com/DecBayComp/TRamWAy
cd TRamWAy
pip install -e .
pip install -e .[roi,animate]

Can be updated with ``git pull`` run in the local repository.

Expand All @@ -63,9 +63,3 @@ The generated documentation will be available at ``_build/html/index.html`` from

Building the documentation requires Sphinx.


OS and version specific notes
-----------------------------

Some modules require *Python>=3.7*.
These are *bayes_factor* for force “detection” based on Bayesian statistics, *snr* that extracts signal-to-noise ratios required by the *bayes_factor* module, and *d.conj_prior* which estimates the diffusion similarly to *ddrift* with no regularization but with additional confidence intervals.
26 changes: 20 additions & 6 deletions notebooks/RWAnalyzer tour.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102789,23 +102789,37 @@
"output_type": "stream",
"text": [
"Traceback (most recent call last):\n",
" File \"<stdin>\", line 2, in <module>\n",
"ModuleNotFoundError: No module named 'tramway'\n"
" File \"...\", line 11, in <module>\n",
" a.spt_data = spt_data.from_dataframe(df)\n",
" ^^^^^^^^^^\n",
" File \".../tramway/analyzer/__init__.py\", line 577, in __setattr__\n",
" warnings.warn(\n",
" ~~~~~~~~~~~~~^\n",
" \"attribute '{}' is already initialized; side effects may occur\".format(\n",
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
" ...<2 lines>...\n",
" SideEffectWarning,\n",
" ^^^^^^^^^^^^^^^^^^\n",
" )\n",
" ^\n",
"tramway.core.exceptions.SideEffectWarning: attribute 'spt_data' is already initialized; side effects may occur"
]
}
],
"source": [
"%%script python3 --no-raise-error\n",
"\n",
"from tramway.analyzer import *\n",
"import traceback\n",
"\n",
"a = RWAnalyzer()\n",
"a.spt_data = spt_data.from_ascii_file('data-examples/demo1.txt')\n",
"\n",
"df = a.spt_data.dataframe\n",
"\n",
"# not allowed!\n",
"a.spt_data = spt_data.from_dataframe(df)"
"try:\n",
" # not allowed!\n",
" a.spt_data = spt_data.from_dataframe(df)\n",
"except:\n",
" traceback.print_exc()"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[tool.poetry]
name = "tramway"
version = "0.6.8"
version = "0.6.9"
description = ""
authors = ["François Laurent <francois.laurent@pasteur.fr>"]
license = "CECILL-2.1"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.8,<3.13"
python = ">=3.8,<4"
setuptools = ">=69.1.0,<99"
six = ">=1.16,<2"
numpy = ">=1.24.3,<2"
numpy = ">=1.24.3,<3"
scipy = ">=1.9.1,<2"
pandas = ">=2.0.2,<3"
matplotlib = ">=3.7.1,<4"
Expand Down
Loading
Loading