Skip to content

Commit 5266c97

Browse files
committed
pixi-envs
1 parent db1a9f1 commit 5266c97

File tree

10 files changed

+11017
-83
lines changed

10 files changed

+11017
-83
lines changed

README.md

Lines changed: 72 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
[![Github Actions](https://github.com/fluiddyn/fluidsim/actions/workflows/ci-windows.yml/badge.svg?branch=branch/default)](https://github.com/fluiddyn/fluidsim/actions)
1212

1313
Fluidsim is an extensible framework for studying fluid dynamics with numerical
14-
simulations using Python. Fluidsim is an object-oriented library to develop
15-
Fluidsim "solvers" (i.e. Python packages solving equations) by writing mainly
16-
Python code. The result is **very efficient** even compared to a pure Fortran
17-
or C++ code since the time-consuming tasks are performed by optimized compiled
18-
functions.
14+
simulations using Python. Fluidsim is an object-oriented library to develop Fluidsim
15+
"solvers" (i.e. Python packages solving equations) by writing mainly Python code. The
16+
result is **very efficient** even compared to a pure Fortran or C++ code since the
17+
time-consuming tasks are performed by optimized compiled functions.
1918

2019
**Documentation**: <https://fluidsim.readthedocs.io>
2120

@@ -26,90 +25,84 @@ To try fluidsim without installation:
2625

2726
For a **basic installation** it should be sufficient to run:
2827

29-
pip install fluidsim
28+
```sh
29+
pip install fluidsim
30+
```
3031

31-
or with [conda/mamba](https://github.com/conda-forge/miniforge):
32+
There are also conda packages in the conda-forge channel usable with
33+
[Pixi](https://pixi.sh) or [conda/mamba](https://github.com/conda-forge/miniforge).
3234

33-
conda install -c conda-forge fluidsim
34-
35-
Much more detailed instructions are given in [the
36-
documentation](https://fluidsim.readthedocs.io/en/latest/install.html).
35+
Much more detailed instructions are given in
36+
[the documentation](https://fluidsim.readthedocs.io/en/latest/install.html).
3737

3838
## How does it work?
3939

40-
Fluidsim is a
41-
[HPC](https://en.wikipedia.org/wiki/High-performance_computing) code. It
42-
is part of the wider project
43-
[FluidDyn](https://pypi.python.org/pypi/fluiddyn/) and its
44-
pseudospectral solvers rely on the library
45-
[fluidfft](http://fluidfft.readthedocs.io) to use very efficient FFT
46-
libraries. Fluidfft is written in C++, Cython and Python. Fluidfft and
47-
fluidsim take advantage of
48-
[Pythran](https://github.com/serge-sans-paille/pythran), an
49-
ahead-of-time compiler which produces very efficient binaries by
50-
compiling Python via C++11.
51-
52-
An advantage of a CFD code written mostly in Python is that, to run
53-
simulations and analyze the results, the users communicate (possibly
54-
interactively) together and with the machine with Python, which is
55-
nowadays among the best languages to do these tasks. Moreover, it is
56-
much simpler and faster than with pure Fortran or C++ codes to add any
57-
complicated analysis or to write a modified solver. Fluidsim can also be
58-
used to extend existing solvers with Python interfaces such as
59-
[Basilisk](http://basilisk.fr).
60-
61-
We have created fluidsim to be **easy and nice to use and to develop**,
62-
**efficient** and **robust**.
63-
64-
*Keywords and ambitions*: fluid dynamics research with Python (>=3.10);
65-
modular, object-oriented, collaborative, tested and documented, free and
66-
open-source software.
40+
Fluidsim is a [HPC](https://en.wikipedia.org/wiki/High-performance_computing) code. It is
41+
part of the wider project [FluidDyn](https://pypi.python.org/pypi/fluiddyn/) and its
42+
pseudospectral solvers rely on the library [fluidfft](http://fluidfft.readthedocs.io) to
43+
use very efficient FFT libraries. Fluidfft is written in C++, Cython and Python. Fluidfft
44+
and fluidsim take advantage of [Pythran](https://github.com/serge-sans-paille/pythran),
45+
an ahead-of-time compiler which produces very efficient binaries by compiling Python via
46+
C++11.
47+
48+
An advantage of a CFD code written mostly in Python is that, to run simulations and
49+
analyze the results, the users communicate (possibly interactively) together and with the
50+
machine with Python, which is nowadays among the best languages to do these tasks.
51+
Moreover, it is much simpler and faster than with pure Fortran or C++ codes to add any
52+
complicated analysis or to write a modified solver. Fluidsim can also be used to extend
53+
existing solvers with Python interfaces such as [Basilisk](http://basilisk.fr).
54+
55+
We have created fluidsim to be **easy and nice to use and to develop**, **efficient** and
56+
**robust**.
57+
58+
*Keywords and ambitions*: fluid dynamics research with Python (>=3.10); modular,
59+
object-oriented, collaborative, tested and documented, free and open-source software.
6760

6861
## License
6962

70-
FluidSim is distributed under the
71-
[CeCILL](http://www.cecill.info/index.en.html) License, a GPL compatible
72-
french license.
63+
FluidSim is distributed under the [CeCILL](http://www.cecill.info/index.en.html) License,
64+
a GPL compatible french license.
7365

7466
## Metapapers and citations
7567

76-
If you use FluidSim to produce scientific articles, please cite our
77-
metapapers presenting the [FluidDyn
78-
project](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.237/),
79-
[FluidFFT](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.238/),
80-
and
68+
If you use FluidSim to produce scientific articles, please cite our metapapers presenting
69+
the
70+
[FluidDyn project](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.237/),
71+
[FluidFFT](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.238/), and
8172
[FluidSim](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.239/):
8273

83-
@article{fluiddyn,
84-
doi = {10.5334/jors.237},
85-
year = {2019},
86-
publisher = {Ubiquity Press, Ltd.},
87-
volume = {7},
88-
author = {Pierre Augier and Ashwin Vishnu Mohanan and Cyrille Bonamy},
89-
title = {{FluidDyn}: A Python Open-Source Framework for Research and Teaching in Fluid Dynamics
90-
by Simulations, Experiments and Data Processing},
91-
journal = {Journal of Open Research Software}
92-
}
93-
94-
@article{fluidfft,
95-
doi = {10.5334/jors.238},
96-
year = {2019},
97-
publisher = {Ubiquity Press, Ltd.},
98-
volume = {7},
99-
author = {Ashwin Vishnu Mohanan and Cyrille Bonamy and Pierre Augier},
100-
title = {{FluidFFT}: Common {API} (C$\mathplus\mathplus$ and Python)
101-
for Fast Fourier Transform {HPC} Libraries},
102-
journal = {Journal of Open Research Software}
103-
}
104-
105-
@article{fluidsim,
106-
doi = {10.5334/jors.239},
107-
year = {2019},
108-
publisher = {Ubiquity Press, Ltd.},
109-
volume = {7},
110-
author = {Mohanan, Ashwin Vishnu and Bonamy, Cyrille and Linares, Miguel
111-
Calpe and Augier, Pierre},
112-
title = {{FluidSim}: {Modular}, {Object}-{Oriented} {Python} {Package} for
113-
{High}-{Performance} {CFD} {Simulations}},
114-
journal = {Journal of Open Research Software}
115-
}
74+
```bibtex
75+
@article{fluiddyn,
76+
doi = {10.5334/jors.237},
77+
year = {2019},
78+
publisher = {Ubiquity Press, Ltd.},
79+
volume = {7},
80+
author = {Pierre Augier and Ashwin Vishnu Mohanan and Cyrille Bonamy},
81+
title = {{FluidDyn}: A Python Open-Source Framework for Research and Teaching in Fluid Dynamics
82+
by Simulations, Experiments and Data Processing},
83+
journal = {Journal of Open Research Software}
84+
}
85+
86+
@article{fluidfft,
87+
doi = {10.5334/jors.238},
88+
year = {2019},
89+
publisher = {Ubiquity Press, Ltd.},
90+
volume = {7},
91+
author = {Ashwin Vishnu Mohanan and Cyrille Bonamy and Pierre Augier},
92+
title = {{FluidFFT}: Common {API} (C$\mathplus\mathplus$ and Python)
93+
for Fast Fourier Transform {HPC} Libraries},
94+
journal = {Journal of Open Research Software}
95+
}
96+
97+
@article{fluidsim,
98+
doi = {10.5334/jors.239},
99+
year = {2019},
100+
publisher = {Ubiquity Press, Ltd.},
101+
volume = {7},
102+
author = {Mohanan, Ashwin Vishnu and Bonamy, Cyrille and Linares, Miguel
103+
Calpe and Augier, Pierre},
104+
title = {{FluidSim}: {Modular}, {Object}-{Oriented} {Python} {Package} for
105+
{High}-{Performance} {CFD} {Simulations}},
106+
journal = {Journal of Open Research Software}
107+
}
108+
```

doc/install.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,44 @@ or for parallel simulations
8585
mpirun -np 2 pytest --pyargs fluidsim -vx
8686
```
8787

88-
### Install the conda-forge packages with conda or mamba
88+
### Install the conda-forge packages
89+
90+
There are fluidsim and fluidfft conda packages in the [conda-forge] channel.
91+
92+
#### Install with Pixi
93+
94+
We recommend not using `conda` and instead prefer [Pixi]. We maintain two locked Pixi
95+
environments in the Fluidsim repository
96+
(<https://foss.heptapod.net/fluiddyn/fluidsim/-/tree/branch/default/pixi-envs>)
97+
98+
- `env-fluidsim` is for running sequential simulations and post-process results.
99+
100+
- `env-fluidsim-mpi` is for running sequential and parallel (MPI) simulations and
101+
post-process results. It is only available on Linux.
102+
103+
First, get one of these directories locally on your computer (the easiest is to clone the
104+
Mercurial repo <https://foss.heptapod.net/fluiddyn/fluidsim> or the Git mirror
105+
<https://github.com/fluiddyn/fluidsim/>). To install and to use one of these
106+
environments, enter into the directory and run `pixi shell`.
107+
108+
````{admonition} How to activate such environment in shell scripts?
109+
110+
```sh
111+
eval "$(pixi shell-hook --manifest-path ~/dev/fluidsim/pixi-envs/env-fluidsim-mpi)"
112+
```
113+
114+
````
115+
116+
````{admonition} How to register a Jupyter kernel using this environment
117+
118+
```sh
119+
pixi shell --manifest-path ~/dev/fluidsim/pixi-envs/env-fluidsim-mpi
120+
python -m ipykernel install --user --name=env-fluidsim-mpi
121+
```
122+
123+
````
124+
125+
#### Install with Conda
89126

90127
We recommend installing `conda` and `mamba` (using the [conda-forge] channel) with the
91128
[miniforge installer](https://github.com/conda-forge/miniforge).
@@ -202,3 +239,4 @@ details.
202239
[conda-forge]: https://conda-forge.org/
203240
[mpi]: https://fr.wikipedia.org/wiki/Message_Passing_Interface
204241
[mpi4py]: https://mpi4py.readthedocs.io/
242+
[pixi]: https://pixi.sh

pixi-envs/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Pixi environments for Fluidsim
2+
3+
With a local version of the repo:
4+
5+
```sh
6+
cd ~/dev/fluidsim/pixi-envs/env-fluidsim
7+
pixi shell
8+
```
9+
10+
or
11+
12+
```sh
13+
pixi shell --manifest-path ~/dev/fluidsim/pixi-envs/env-fluidsim
14+
```
15+
16+
To record a kernel usable through Jupyter Lab:
17+
18+
```sh
19+
pixi run --manifest-path ~/dev/fluidsim/pixi-envs/env-fluidsim python -m ipykernel install --user --name=env-fluidsim
20+
```

0 commit comments

Comments
 (0)