Metadata-Version: 2.4
Name: furax
Version: 0.10.2
Summary: Operators and solvers for high-performance computing.
Author: Wassim Kabalan
Author-email: Pierre Chanial <chanial@apc.in2p3.fr>, Simon Biquard <biquard@apc.in2p3.fr>, Wuhyun Sohn <sohn@apc.in2p3.fr>
Maintainer-email: Pierre Chanial <chanial@apc.in2p3.fr>
License-Expression: MIT
Project-URL: homepage, https://scipol.in2p3.fr
Project-URL: repository, https://github.com/CMBSciPol/furax
Keywords: scientific computing
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: astropy
Requires-Dist: equinox
Requires-Dist: healpy>=0.18.1
Requires-Dist: jax!=0.7.*,>=0.4.38
Requires-Dist: jaxtyping
Requires-Dist: jax-healpy>=0.5
Requires-Dist: lineax>=0.0.8
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: typing-extensions; python_version < "3.13"
Provides-Extra: dev
Requires-Dist: ipython; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: pytest-insubprocess>=1.1; extra == "dev"
Requires-Dist: setuptools_scm; extra == "dev"
Requires-Dist: beartype; extra == "dev"
Provides-Extra: comp-sep
Requires-Dist: pysm3; extra == "comp-sep"
Provides-Extra: docs
Requires-Dist: sphinx>=5.0; extra == "docs"
Requires-Dist: sphinx-book-theme>=1.0; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
Requires-Dist: myst-parser>=1.0; extra == "docs"
Requires-Dist: nbsphinx>=0.8; extra == "docs"
Requires-Dist: ipykernel>=6.0; extra == "docs"
Provides-Extra: mapmaking
Requires-Dist: apischema>=0.19.0; extra == "mapmaking"
Requires-Dist: jax-grid-search; extra == "mapmaking"
Requires-Dist: matplotlib; extra == "mapmaking"
Requires-Dist: optax; extra == "mapmaking"
Requires-Dist: pixell>=0.31.7; extra == "mapmaking"
Requires-Dist: pyyaml>=0.6.2; extra == "mapmaking"
Provides-Extra: so
Requires-Dist: cyclopts>=4.6.0; extra == "so"
Requires-Dist: sotodlib[site-pipeline]>=0.6.16; extra == "so"
Requires-Dist: so3g>=0.2.5; extra == "so"
Provides-Extra: toast
Requires-Dist: toast>=3.0.0a42; extra == "toast"
Provides-Extra: lbs
Requires-Dist: litebird_sim>=0.16.1; extra == "lbs"
Provides-Extra: interfaces
Requires-Dist: furax[lbs,so,toast]; extra == "interfaces"
Dynamic: license-file

# Furax

[![PyPI version](https://badge.fury.io/py/furax.svg)](https://badge.fury.io/py/furax)
[![Documentation Status](https://readthedocs.org/projects/furax/badge/?version=latest)](https://furax.readthedocs.io/en/latest/?badge=latest)
[![CI](https://github.com/CMBSciPol/furax/actions/workflows/ci.yml/badge.svg)](https://github.com/CMBSciPol/furax/actions/workflows/ci.yml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

[**Docs**](https://furax.readthedocs.io/en/stable)

Furax: a Framework for Unified and Robust data Analysis with JAX.

This framework provides building blocks for solving inverse problems, in particular in the astrophysical and cosmological domains.

## Installation

You should always use a virtual environment to install packages (e.g. `venv`, `conda` environment, etc.).

Start by installing [`JAX`](https://jax.readthedocs.io/en/latest/installation.html) for the target architecture.

Furax is available as [`furax`](https://pypi.org/project/furax/) on PyPI, and can be installed with:

```bash
pip install furax
```

### Development version

Clone the repository, and navigate to the root directory of the project.
For example:

```bash
git clone git@github.com:CMBSciPol/furax.git
cd furax
```

Then, install the package with:

```bash
pip install .
```

## Developing Furax

After cloning, install in editable mode and with development dependencies:

```bash
pip install -e .[dev]
```

We use [pytest](https://docs.pytest.org/en/stable/) for testing.
You can run the tests with:

```bash
pytest
```

To ensure that your code passes the quality checks,
you can use our [pre-commit](https://pre-commit.com/) configuration:

1. Install the pre-commit hooks with

```bash
pre-commit install
```

2. That's it! Every commit will trigger the code quality checks.

## Running on JeanZay

### Load cuda and and cudnn for JAX

```bash
module load cuda/11.8.0 cudnn/8.9.7.29-cuda
```

### Create Python env (only the first time)

```bash
module load python/3.10.4 && conda deactivate
python -m venv venv
source venv/bin/activate
# install jax
pip install --upgrade "jax[cuda11_local]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
# install furax
pip install -e .[dev]
```

### launch script

To launch only the pytests

```bash
sbatch slurms/astro-sim-v100-testing.slurm
```

To launch your own script

```bash
sbatch slurms/astro-sim-v100-run.slurm yourscript.py
```

You can also allocate ressources and go into bash mode

```bash
srun --pty --account=nih@v100 --nodes=1 --ntasks-per-node=1 --cpus-per-task=10 --gres=gpu:1 --hint=nomultithread bash
module purge
module load python/3.10.4
source venv/bin/activate
module load cuda/11.8.0  cudnn/8.9.7.29-cuda
# Then do your thing
python my_script.py
pytest
```

Don't leave the bash running !! (I would suggest running script with sbatch)

### Specific for nih / SciPol project

The repo is already in the commun WORK folder, the data is downloaded and the environment is ready.

You only need to do this

```bash
cd $ALL_CCFRWORK/furax-main
```

Then launch scripts as you see fit
