py-pluto 1.1.4__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {py_pluto-1.1.4 → py_pluto-1.2.0}/PKG-INFO +74 -85
- {py_pluto-1.1.4 → py_pluto-1.2.0}/README.md +58 -48
- py_pluto-1.2.0/pyproject.toml +269 -0
- py_pluto-1.2.0/src/pyPLUTO/__init__.py +44 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/amr.py +108 -94
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/baseloadmixin.py +88 -25
- py_pluto-1.2.0/src/pyPLUTO/baseloadstate.py +55 -0
- py_pluto-1.2.0/src/pyPLUTO/codes/echo_load.py +263 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/app_state.py +34 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/custom_var.py +272 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/custom_var_engine.py +523 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/gui/globals.py +2 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/load_controller.py +221 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/gui/main.py +7 -2
- py_pluto-1.2.0/src/pyPLUTO/gui/main_window.py +261 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/panels.py +201 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/plot_controller.py +352 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/services.py +193 -0
- py_pluto-1.2.0/src/pyPLUTO/gui/state_accessors.py +152 -0
- py_pluto-1.2.0/src/pyPLUTO/image.py +489 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/colorbar.py +103 -41
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/contour.py +324 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/create_axes.py +104 -93
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/display.py +143 -108
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/figure.py +125 -104
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/imagetools.py +184 -102
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/interactive.py +630 -0
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/legend.py +291 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/plot.py +142 -98
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/range.py +38 -44
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/scatter.py +374 -0
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/set_axis.py +648 -0
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/streamplot.py +357 -0
- py_pluto-1.2.0/src/pyPLUTO/imagefuncs/zoom.py +719 -0
- py_pluto-1.2.0/src/pyPLUTO/imagekwargs.py +231 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagemixin.py +7 -6
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagestate.py +5 -4
- py_pluto-1.2.0/src/pyPLUTO/load.py +593 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/baseloadtools.py +24 -13
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/codeselection.py +81 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/descriptor.py +34 -32
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/findfiles.py +69 -57
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/findformat.py +37 -39
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/initload.py +261 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/loadvars.py +162 -62
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/offsetdata.py +31 -25
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/offsetfluid.py +156 -101
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/offsetpart.py +251 -0
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/read_files.py +151 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/readdefplini.py +47 -27
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/readgridalone.py +245 -0
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/readgridfile.py +292 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/readtab.py +36 -28
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/storepart.py +185 -0
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/write_files.py +191 -0
- py_pluto-1.2.0/src/pyPLUTO/loadkwargs.py +141 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadmixin.py +49 -71
- py_pluto-1.2.0/src/pyPLUTO/loadpart.py +273 -0
- py_pluto-1.2.0/src/pyPLUTO/loadstate.py +65 -0
- py_pluto-1.2.0/src/pyPLUTO/py.typed +0 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/compute_units.py +233 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/findlines.py +475 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/fourier.py +143 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/loadtools.py +150 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/nabla.py +739 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/parttools.py +179 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/set_units.py +160 -0
- py_pluto-1.2.0/src/pyPLUTO/toolfuncs/transform.py +545 -0
- {py_pluto-1.1.4/pyPLUTO → py_pluto-1.2.0/src/pyPLUTO/utils}/configure.py +66 -15
- py_pluto-1.2.0/src/pyPLUTO/utils/examples_api.py +186 -0
- py_pluto-1.2.0/src/pyPLUTO/utils/examples_cli.py +87 -0
- {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/utils/inspector.py +45 -29
- {py_pluto-1.1.4/pyPLUTO → py_pluto-1.2.0/src/pyPLUTO/utils}/pytools.py +8 -11
- py_pluto-1.2.0/src/pyPLUTO/utils/resolver.py +150 -0
- py_pluto-1.1.4/pyPLUTO/__init__.py +0 -22
- py_pluto-1.1.4/pyPLUTO/baseloadstate.py +0 -45
- py_pluto-1.1.4/pyPLUTO/codes/echo_load.py +0 -161
- py_pluto-1.1.4/pyPLUTO/gui/config.py +0 -174
- py_pluto-1.1.4/pyPLUTO/gui/custom_var.py +0 -435
- py_pluto-1.1.4/pyPLUTO/gui/main_window.py +0 -177
- py_pluto-1.1.4/pyPLUTO/gui/panels.py +0 -66
- py_pluto-1.1.4/pyPLUTO/gui/utils.py +0 -273
- py_pluto-1.1.4/pyPLUTO/h_pypluto.py +0 -84
- py_pluto-1.1.4/pyPLUTO/image.py +0 -302
- py_pluto-1.1.4/pyPLUTO/imagefuncs/contour.py +0 -254
- py_pluto-1.1.4/pyPLUTO/imagefuncs/interactive.py +0 -403
- py_pluto-1.1.4/pyPLUTO/imagefuncs/legend.py +0 -250
- py_pluto-1.1.4/pyPLUTO/imagefuncs/scatter.py +0 -270
- py_pluto-1.1.4/pyPLUTO/imagefuncs/set_axis.py +0 -497
- py_pluto-1.1.4/pyPLUTO/imagefuncs/streamplot.py +0 -297
- py_pluto-1.1.4/pyPLUTO/imagefuncs/zoom.py +0 -428
- py_pluto-1.1.4/pyPLUTO/load.py +0 -447
- py_pluto-1.1.4/pyPLUTO/loadfuncs/codeselection.py +0 -48
- py_pluto-1.1.4/pyPLUTO/loadfuncs/defpluto.py +0 -123
- py_pluto-1.1.4/pyPLUTO/loadfuncs/initload.py +0 -203
- py_pluto-1.1.4/pyPLUTO/loadfuncs/read_files.py +0 -213
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readdata.py +0 -619
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readdata_old.py +0 -567
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readfluid.py +0 -479
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readformat.py +0 -277
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readgridalone.py +0 -224
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readgridfile.py +0 -255
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readgridout.py +0 -451
- py_pluto-1.1.4/pyPLUTO/loadfuncs/readpart.py +0 -419
- py_pluto-1.1.4/pyPLUTO/loadfuncs/write_files.py +0 -283
- py_pluto-1.1.4/pyPLUTO/loadpart.py +0 -233
- py_pluto-1.1.4/pyPLUTO/loadstate.py +0 -68
- py_pluto-1.1.4/pyPLUTO/newload.py +0 -81
- py_pluto-1.1.4/pyPLUTO/toolfuncs/findlines.py +0 -551
- py_pluto-1.1.4/pyPLUTO/toolfuncs/fourier.py +0 -149
- py_pluto-1.1.4/pyPLUTO/toolfuncs/nabla.py +0 -676
- py_pluto-1.1.4/pyPLUTO/toolfuncs/parttools.py +0 -152
- py_pluto-1.1.4/pyPLUTO/toolfuncs/transform.py +0 -638
- py_pluto-1.1.4/pyPLUTO/utils/annotator.py +0 -27
- py_pluto-1.1.4/pyPLUTO/utils/make_docstrings.py +0 -3
- py_pluto-1.1.4/py_pluto.egg-info/PKG-INFO +0 -218
- py_pluto-1.1.4/py_pluto.egg-info/SOURCES.txt +0 -76
- py_pluto-1.1.4/py_pluto.egg-info/dependency_links.txt +0 -1
- py_pluto-1.1.4/py_pluto.egg-info/entry_points.txt +0 -2
- py_pluto-1.1.4/py_pluto.egg-info/requires.txt +0 -41
- py_pluto-1.1.4/py_pluto.egg-info/top_level.txt +0 -1
- py_pluto-1.1.4/pyproject.toml +0 -150
- py_pluto-1.1.4/setup.cfg +0 -4
- {py_pluto-1.1.4 → py_pluto-1.2.0}/LICENSE +0 -0
|
@@ -1,62 +1,38 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: py-pluto
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: PyPLUTO: Plotting routines for PLUTO
|
|
5
5
|
Author: D. Crocco, D. Melon Fuksman, M. Bugli, V. Berta, E. Puzzoni, A. Mignone, B. Vaidya
|
|
6
6
|
Author-email: "G. Mattia" <mattia@mpia.de>
|
|
7
|
-
|
|
8
|
-
Requires-Python: >=3.12
|
|
7
|
+
Requires-Python: >=3.11
|
|
9
8
|
Description-Content-Type: text/markdown
|
|
10
9
|
License-File: LICENSE
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
15
|
-
Requires-Dist:
|
|
16
|
-
Requires-Dist:
|
|
17
|
-
Requires-Dist: h5py
|
|
18
|
-
Requires-Dist: inifix>=
|
|
19
|
-
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Provides-Extra: test
|
|
26
|
-
Requires-Dist: pytest; extra == "test"
|
|
27
|
-
Requires-Dist: pytest-doctestplus; extra == "test"
|
|
28
|
-
Requires-Dist: coverage; extra == "test"
|
|
29
|
-
Requires-Dist: pytest-cov; extra == "test"
|
|
30
|
-
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
31
|
-
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: uv; extra == "dev"
|
|
33
|
-
Requires-Dist: pandas-stubs; extra == "dev"
|
|
34
|
-
Requires-Dist: h5py-stubs; extra == "dev"
|
|
35
|
-
Requires-Dist: pre-commit; extra == "dev"
|
|
36
|
-
Requires-Dist: pyright; extra == "dev"
|
|
37
|
-
Requires-Dist: pyrefly; extra == "dev"
|
|
38
|
-
Requires-Dist: ruff; extra == "dev"
|
|
39
|
-
Requires-Dist: ty>=0.0.17; extra == "dev"
|
|
40
|
-
Requires-Dist: radon; extra == "dev"
|
|
41
|
-
Requires-Dist: pydata-sphinx-theme; extra == "dev"
|
|
42
|
-
Provides-Extra: notebook
|
|
43
|
-
Requires-Dist: ipython; extra == "notebook"
|
|
10
|
+
Requires-Dist: astropy>=7.2.0
|
|
11
|
+
Requires-Dist: contourpy>=1.2.1
|
|
12
|
+
Requires-Dist: numpy>=2.0.0
|
|
13
|
+
Requires-Dist: matplotlib>=3.8.4
|
|
14
|
+
Requires-Dist: scipy>=1.13.0
|
|
15
|
+
Requires-Dist: numexpr>=2.10.0
|
|
16
|
+
Requires-Dist: h5py>=3.11.0
|
|
17
|
+
Requires-Dist: inifix>=7.0.0
|
|
18
|
+
Requires-Dist: PySide6 ; extra == "gui"
|
|
19
|
+
Requires-Dist: pastamarkers ; extra == "pasta"
|
|
20
|
+
Project-URL: Changelog, https://github.com/GiMattia/PyPLUTO/blob/main/CHANGELOG.md
|
|
21
|
+
Project-URL: Examples, https://github.com/GiMattia/PyPLUTO/tree/main/Examples
|
|
22
|
+
Project-URL: Homepage, https://github.com/GiMattia/PyPLUTO
|
|
23
|
+
Provides-Extra: gui
|
|
44
24
|
Provides-Extra: pasta
|
|
45
|
-
Requires-Dist: pastamarkers; extra == "pasta"
|
|
46
|
-
Dynamic: license-file
|
|
47
25
|
|
|
48
26
|
# PyPLUTO: a data analysis Python package for the PLUTO code
|
|
49
27
|
|
|
50
28
|
| Category | Badges |
|
|
51
29
|
| --- | --- |
|
|
52
|
-
| Package |  [ [](https://pypi.org/project/py-pluto/) |
|
|
53
31
|
| Reliability | [](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_windows.yml) [](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_macos.yml) [](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_linux.yml)  |
|
|
54
|
-
| Docs & Community | [](https://www.repostatus.org/#active) [](https://pypluto.readthedocs.io/en/latest/?badge=latest)
|
|
32
|
+
| Docs & Community | [](https://www.repostatus.org/#active) [](https://pypluto.readthedocs.io/en/latest/?badge=latest) [](https://discord.gg/63A3sM9UtX) [](https://opensource.org/licenses/BSD-3-Clause) |
|
|
55
33
|
| Citation | [](https://doi.org/10.21105/joss.08448) [](https://doi.org/10.48550/arXiv.2501.09748) [](https://doi.org/10.5281/zenodo.19650848) |
|
|
56
34
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
PyPLUTO is a Python library which loads and plots the data obtain from the
|
|
35
|
+
PyPLUTO is a Python library which loads and plots the data obtained from the
|
|
60
36
|
PLUTO code simulations.
|
|
61
37
|
The aim of this package is to simplify some non-trivial python routines in order
|
|
62
38
|
to quickly recover effective plots that are suited for scientific publications.
|
|
@@ -69,18 +45,26 @@ The package is structured as follow:
|
|
|
69
45
|
- the Load class is used to load the data from the PLUTO simulation fluid files.
|
|
70
46
|
- the LoadPart class is used to load the data from the PLUTO simulation particle files.
|
|
71
47
|
- the Image class is used to visualize the loaded data.
|
|
72
|
-
-
|
|
48
|
+
- the GUI subpackage allows for a quick interactive script-free visualization.
|
|
49
|
+
- physical units can be attached to loaded variables via the `astropy` library.
|
|
50
|
+
- additional functions (e.g., to show the images) are included in the package.
|
|
73
51
|
|
|
74
52
|
The package includes a set of examples in the `Examples` directory.
|
|
75
53
|
|
|
76
|
-
The package
|
|
54
|
+
The package requires Python 3.11 or newer (CI tests 3.12, 3.13, and 3.14)
|
|
55
|
+
and the following core dependencies:
|
|
77
56
|
|
|
78
|
-
- `
|
|
57
|
+
- `astropy`
|
|
58
|
+
- `contourpy`
|
|
59
|
+
- `h5py`
|
|
60
|
+
- `inifix`
|
|
79
61
|
- `matplotlib`
|
|
62
|
+
- `numexpr`
|
|
63
|
+
- `numpy`
|
|
80
64
|
- `scipy`
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
65
|
+
|
|
66
|
+
The GUI requires the optional dependency `PySide6`, installable via
|
|
67
|
+
`pip install py-pluto[gui]`.
|
|
84
68
|
|
|
85
69
|
The package is provided with a `LICENSE` file which contains the license terms.
|
|
86
70
|
|
|
@@ -90,16 +74,18 @@ The package is provided with an extensive documentation in the `Docs` directory.
|
|
|
90
74
|
|
|
91
75
|
To install the PyPLUTO package, you can use the following methods:
|
|
92
76
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
The easiest way to install PyPLUTO is through pip. Open your terminal and run the following command:
|
|
77
|
+
The easiest way to install PyPLUTO is through uv. Open your terminal and run the following command:
|
|
96
78
|
|
|
97
79
|
```bash
|
|
98
|
-
|
|
80
|
+
uv add py-pluto
|
|
99
81
|
```
|
|
100
82
|
|
|
101
|
-
Ensure that you are using Python 3.
|
|
102
|
-
Installation through
|
|
83
|
+
Ensure that you are using Python 3.11 or newer, as the package is compatible from this version onwards.
|
|
84
|
+
Installation through pip is also possible through the command:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install py-pluto
|
|
88
|
+
```
|
|
103
89
|
|
|
104
90
|
This method allows installation in a non-editable mode, and it is recommended to use a virtual environment to avoid conflicts with other packages.
|
|
105
91
|
|
|
@@ -118,7 +104,7 @@ print(D)
|
|
|
118
104
|
```
|
|
119
105
|
|
|
120
106
|
Relevant simulations attributes (such as the computational grid, the geometry and the variables to load) are found automatically.
|
|
121
|
-
The data can be plotted through the Image class, which acts as a simplified
|
|
107
|
+
The data can be plotted through the Image class, which acts as a simplified matplotlib wrapper.
|
|
122
108
|
An example of 1D plot of the density can be:
|
|
123
109
|
|
|
124
110
|
```python
|
|
@@ -143,10 +129,40 @@ In this way, PyPLUTO can be explored without any knowledge of the PLUTO code.
|
|
|
143
129
|
All the tests are located in the `Examples` directory and are aimed at showing
|
|
144
130
|
how to exploit the package capabilities.
|
|
145
131
|
|
|
132
|
+
From an installed package, examples are available through:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pypluto-examples list
|
|
136
|
+
pypluto-examples copy
|
|
137
|
+
pypluto-examples run test01_sod
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Equivalent Python API:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
import pyPLUTO as pp
|
|
144
|
+
|
|
145
|
+
print(pp.examples_path()) # installed examples directory
|
|
146
|
+
pp.copy_examples() # creates ./pypluto_examples
|
|
147
|
+
pp.run_example("test01_sod") # runs one example script
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Maintainer notes for examples
|
|
151
|
+
|
|
152
|
+
- Canonical sources stay in `Examples/` (repo root).
|
|
153
|
+
- Installed users fetch a cached copy from GitHub (matching package version tag when available).
|
|
154
|
+
- Before release, keep `Examples/` in sync with the release tag and verify CLI:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
python3 -m build
|
|
158
|
+
pip install dist/py_pluto-*.whl
|
|
159
|
+
pypluto-examples list
|
|
160
|
+
```
|
|
161
|
+
|
|
146
162
|
## The GUI
|
|
147
163
|
|
|
148
164
|
A Graphical User Interface has been implemented in order to simplify and enhance the visualization and analysis of simulation data.
|
|
149
|
-
The GUI is built with
|
|
165
|
+
The GUI is built with PySide6 and allows users to load and visualize 1D and 2D fluid data (or slices) from PLUTO simulations.
|
|
150
166
|
To run the GUI after the package installation, one should simply run the command
|
|
151
167
|
|
|
152
168
|
```bash
|
|
@@ -187,32 +203,5 @@ We recommend to put one the following expressions in your manuscript:
|
|
|
187
203
|
|
|
188
204
|
If you have any questions, suggestions or find a bug, feel free to open an issue or fork the repository and create a pull request.
|
|
189
205
|
Any contribution aimed at helping the PLUTO code community to have better plots with less efforts will be greatly appreciated.
|
|
190
|
-
If you want to contribute to PyPLUTO please
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
pip install -r requirements_dev.txt
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Rules for Contributing
|
|
197
|
-
|
|
198
|
-
We use pre-commit to ensure that the code is consistent with the code guidelines, through uv, ruff, pyrefly and ty.
|
|
199
|
-
You can either link the pre-commit to the repository through the command
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
pre-commit install
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
or by enforcing the guide styles manually through the command
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
pre-commit run --all-files
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
Before opening a pull request,there is the possibility to run a deeper series of checks, including tests with coverage, pylint check, docstring coverage and so through the command
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
pre-commit run --all-files --hook-stage manual
|
|
215
|
-
```
|
|
206
|
+
If you want to contribute to PyPLUTO please follow the instruction present in the CONTRIBUTING.md file.
|
|
216
207
|
|
|
217
|
-
If one or more tests do not pass the automatic code checks anforced through github actions will not allow the pull request to pass, so is higly recommended to run the full pre-commit before every pull request.
|
|
218
|
-
For any question or enquiry, please contact one of the administrators.
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
| Category | Badges |
|
|
4
4
|
| --- | --- |
|
|
5
|
-
| Package |  [ [](https://pypi.org/project/py-pluto/) |
|
|
6
6
|
| Reliability | [](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_windows.yml) [](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_macos.yml) [](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_linux.yml)  |
|
|
7
|
-
| Docs & Community | [](https://www.repostatus.org/#active) [](https://pypluto.readthedocs.io/en/latest/?badge=latest)
|
|
7
|
+
| Docs & Community | [](https://www.repostatus.org/#active) [](https://pypluto.readthedocs.io/en/latest/?badge=latest) [](https://discord.gg/63A3sM9UtX) [](https://opensource.org/licenses/BSD-3-Clause) |
|
|
8
8
|
| Citation | [](https://doi.org/10.21105/joss.08448) [](https://doi.org/10.48550/arXiv.2501.09748) [](https://doi.org/10.5281/zenodo.19650848) |
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
PyPLUTO is a Python library which loads and plots the data obtain from the
|
|
10
|
+
PyPLUTO is a Python library which loads and plots the data obtained from the
|
|
13
11
|
PLUTO code simulations.
|
|
14
12
|
The aim of this package is to simplify some non-trivial python routines in order
|
|
15
13
|
to quickly recover effective plots that are suited for scientific publications.
|
|
@@ -22,18 +20,26 @@ The package is structured as follow:
|
|
|
22
20
|
- the Load class is used to load the data from the PLUTO simulation fluid files.
|
|
23
21
|
- the LoadPart class is used to load the data from the PLUTO simulation particle files.
|
|
24
22
|
- the Image class is used to visualize the loaded data.
|
|
25
|
-
-
|
|
23
|
+
- the GUI subpackage allows for a quick interactive script-free visualization.
|
|
24
|
+
- physical units can be attached to loaded variables via the `astropy` library.
|
|
25
|
+
- additional functions (e.g., to show the images) are included in the package.
|
|
26
26
|
|
|
27
27
|
The package includes a set of examples in the `Examples` directory.
|
|
28
28
|
|
|
29
|
-
The package
|
|
29
|
+
The package requires Python 3.11 or newer (CI tests 3.12, 3.13, and 3.14)
|
|
30
|
+
and the following core dependencies:
|
|
30
31
|
|
|
31
|
-
- `
|
|
32
|
+
- `astropy`
|
|
33
|
+
- `contourpy`
|
|
34
|
+
- `h5py`
|
|
35
|
+
- `inifix`
|
|
32
36
|
- `matplotlib`
|
|
37
|
+
- `numexpr`
|
|
38
|
+
- `numpy`
|
|
33
39
|
- `scipy`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
40
|
+
|
|
41
|
+
The GUI requires the optional dependency `PySide6`, installable via
|
|
42
|
+
`pip install py-pluto[gui]`.
|
|
37
43
|
|
|
38
44
|
The package is provided with a `LICENSE` file which contains the license terms.
|
|
39
45
|
|
|
@@ -43,16 +49,18 @@ The package is provided with an extensive documentation in the `Docs` directory.
|
|
|
43
49
|
|
|
44
50
|
To install the PyPLUTO package, you can use the following methods:
|
|
45
51
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
The easiest way to install PyPLUTO is through pip. Open your terminal and run the following command:
|
|
52
|
+
The easiest way to install PyPLUTO is through uv. Open your terminal and run the following command:
|
|
49
53
|
|
|
50
54
|
```bash
|
|
51
|
-
|
|
55
|
+
uv add py-pluto
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
Ensure that you are using Python 3.
|
|
55
|
-
Installation through
|
|
58
|
+
Ensure that you are using Python 3.11 or newer, as the package is compatible from this version onwards.
|
|
59
|
+
Installation through pip is also possible through the command:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install py-pluto
|
|
63
|
+
```
|
|
56
64
|
|
|
57
65
|
This method allows installation in a non-editable mode, and it is recommended to use a virtual environment to avoid conflicts with other packages.
|
|
58
66
|
|
|
@@ -71,7 +79,7 @@ print(D)
|
|
|
71
79
|
```
|
|
72
80
|
|
|
73
81
|
Relevant simulations attributes (such as the computational grid, the geometry and the variables to load) are found automatically.
|
|
74
|
-
The data can be plotted through the Image class, which acts as a simplified
|
|
82
|
+
The data can be plotted through the Image class, which acts as a simplified matplotlib wrapper.
|
|
75
83
|
An example of 1D plot of the density can be:
|
|
76
84
|
|
|
77
85
|
```python
|
|
@@ -96,10 +104,40 @@ In this way, PyPLUTO can be explored without any knowledge of the PLUTO code.
|
|
|
96
104
|
All the tests are located in the `Examples` directory and are aimed at showing
|
|
97
105
|
how to exploit the package capabilities.
|
|
98
106
|
|
|
107
|
+
From an installed package, examples are available through:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pypluto-examples list
|
|
111
|
+
pypluto-examples copy
|
|
112
|
+
pypluto-examples run test01_sod
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Equivalent Python API:
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
import pyPLUTO as pp
|
|
119
|
+
|
|
120
|
+
print(pp.examples_path()) # installed examples directory
|
|
121
|
+
pp.copy_examples() # creates ./pypluto_examples
|
|
122
|
+
pp.run_example("test01_sod") # runs one example script
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Maintainer notes for examples
|
|
126
|
+
|
|
127
|
+
- Canonical sources stay in `Examples/` (repo root).
|
|
128
|
+
- Installed users fetch a cached copy from GitHub (matching package version tag when available).
|
|
129
|
+
- Before release, keep `Examples/` in sync with the release tag and verify CLI:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
python3 -m build
|
|
133
|
+
pip install dist/py_pluto-*.whl
|
|
134
|
+
pypluto-examples list
|
|
135
|
+
```
|
|
136
|
+
|
|
99
137
|
## The GUI
|
|
100
138
|
|
|
101
139
|
A Graphical User Interface has been implemented in order to simplify and enhance the visualization and analysis of simulation data.
|
|
102
|
-
The GUI is built with
|
|
140
|
+
The GUI is built with PySide6 and allows users to load and visualize 1D and 2D fluid data (or slices) from PLUTO simulations.
|
|
103
141
|
To run the GUI after the package installation, one should simply run the command
|
|
104
142
|
|
|
105
143
|
```bash
|
|
@@ -140,32 +178,4 @@ We recommend to put one the following expressions in your manuscript:
|
|
|
140
178
|
|
|
141
179
|
If you have any questions, suggestions or find a bug, feel free to open an issue or fork the repository and create a pull request.
|
|
142
180
|
Any contribution aimed at helping the PLUTO code community to have better plots with less efforts will be greatly appreciated.
|
|
143
|
-
If you want to contribute to PyPLUTO please
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
pip install -r requirements_dev.txt
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Rules for Contributing
|
|
150
|
-
|
|
151
|
-
We use pre-commit to ensure that the code is consistent with the code guidelines, through uv, ruff, pyrefly and ty.
|
|
152
|
-
You can either link the pre-commit to the repository through the command
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
pre-commit install
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
or by enforcing the guide styles manually through the command
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
pre-commit run --all-files
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Before opening a pull request,there is the possibility to run a deeper series of checks, including tests with coverage, pylint check, docstring coverage and so through the command
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
pre-commit run --all-files --hook-stage manual
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
If one or more tests do not pass the automatic code checks anforced through github actions will not allow the pull request to pass, so is higly recommended to run the full pre-commit before every pull request.
|
|
171
|
-
For any question or enquiry, please contact one of the administrators.
|
|
181
|
+
If you want to contribute to PyPLUTO please follow the instruction present in the CONTRIBUTING.md file.
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["flit_core >=3.11,<4"]
|
|
3
|
+
build-backend = "flit_core.buildapi"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "py-pluto"
|
|
7
|
+
version = "1.2.0"
|
|
8
|
+
description = "PyPLUTO: Plotting routines for PLUTO"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = { text = "BSD-3-Clause" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "G. Mattia", email = "mattia@mpia.de" },
|
|
14
|
+
{ name = "D. Crocco" },
|
|
15
|
+
{ name = "D. Melon Fuksman" },
|
|
16
|
+
{ name = "M. Bugli" },
|
|
17
|
+
{ name = "V. Berta" },
|
|
18
|
+
{ name = "E. Puzzoni" },
|
|
19
|
+
{ name = "A. Mignone" },
|
|
20
|
+
{ name = "B. Vaidya" }
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"astropy>=7.2.0",
|
|
24
|
+
"contourpy>=1.2.1",
|
|
25
|
+
"numpy>=2.0.0",
|
|
26
|
+
"matplotlib>=3.8.4",
|
|
27
|
+
"scipy>=1.13.0",
|
|
28
|
+
"numexpr>=2.10.0",
|
|
29
|
+
"h5py>=3.11.0",
|
|
30
|
+
"inifix>=7.0.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
gui = [
|
|
35
|
+
"PySide6",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
pasta = [
|
|
39
|
+
"pastamarkers"
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[dependency-groups]
|
|
43
|
+
docs = [
|
|
44
|
+
"sphinx>=9.0.0",
|
|
45
|
+
"sphinx-automodapi>=0.20.0",
|
|
46
|
+
"numpydoc>=1.0.0"
|
|
47
|
+
]
|
|
48
|
+
test = [
|
|
49
|
+
"pytest>=9.0.0",
|
|
50
|
+
"pytest-doctestplus>=1.5.0",
|
|
51
|
+
"coverage>=7.3.0",
|
|
52
|
+
"pytest-cov>=7.0.0",
|
|
53
|
+
"pytest-xdist>=3.8.0",
|
|
54
|
+
]
|
|
55
|
+
dev = [
|
|
56
|
+
"uv",
|
|
57
|
+
"auto-walrus",
|
|
58
|
+
"pandas-stubs",
|
|
59
|
+
"h5py-stubs",
|
|
60
|
+
"pre-commit",
|
|
61
|
+
"pyright",
|
|
62
|
+
"ruff",
|
|
63
|
+
"radon",
|
|
64
|
+
"pydata-sphinx-theme",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
# Type checkers we keep installable but do NOT yet use as the source of truth.
|
|
68
|
+
# pyright (in the `dev` group) is the standard checker for PyPLUTO. Every issue
|
|
69
|
+
# these would report is already covered by pyright; they are kept here so we can
|
|
70
|
+
# switch to one of them once they are mature enough to validate the patterns
|
|
71
|
+
# PyPLUTO relies on (Generic + overloaded __new__, Unpack[TypedDict] extra-key
|
|
72
|
+
# rejection, etc.).
|
|
73
|
+
typefuture = [
|
|
74
|
+
"pyrefly",
|
|
75
|
+
"ty",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
notebook = [
|
|
79
|
+
"ipython>=9.0.0",
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
dev-test = [
|
|
83
|
+
{ include-group = "dev" },
|
|
84
|
+
{ include-group = "test" },
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
dev-docs = [
|
|
88
|
+
{ include-group = "dev" },
|
|
89
|
+
|
|
90
|
+
{ include-group = "docs" },
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
local-dev = [
|
|
94
|
+
{ include-group = "dev" },
|
|
95
|
+
{ include-group = "test" },
|
|
96
|
+
{ include-group = "docs" },
|
|
97
|
+
{ include-group = "notebook" },
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
[project.scripts]
|
|
101
|
+
pypluto-gui = "pyPLUTO.gui.main:main"
|
|
102
|
+
pypluto-examples = "pyPLUTO.utils.examples_cli:main"
|
|
103
|
+
|
|
104
|
+
[tool.flit.module]
|
|
105
|
+
name = "pyPLUTO"
|
|
106
|
+
|
|
107
|
+
[project.urls]
|
|
108
|
+
Homepage = "https://github.com/GiMattia/PyPLUTO"
|
|
109
|
+
Changelog = "https://github.com/GiMattia/PyPLUTO/blob/main/CHANGELOG.md"
|
|
110
|
+
Examples = "https://github.com/GiMattia/PyPLUTO/tree/main/Examples"
|
|
111
|
+
|
|
112
|
+
[tool.coverage.run]
|
|
113
|
+
source = ["src"]
|
|
114
|
+
branch = true
|
|
115
|
+
|
|
116
|
+
[tool.coverage.report]
|
|
117
|
+
omit = [
|
|
118
|
+
"*/Tests/*",
|
|
119
|
+
"*/Docs/*",
|
|
120
|
+
"*/.venv/*",
|
|
121
|
+
"*/site-packages/*",
|
|
122
|
+
]
|
|
123
|
+
exclude_lines = [
|
|
124
|
+
"pragma: no cover",
|
|
125
|
+
"@overload",
|
|
126
|
+
"if TYPE_CHECKING:",
|
|
127
|
+
"def __repr__",
|
|
128
|
+
"def __str__",
|
|
129
|
+
"raise NotImplementedError"
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
[tool.ruff]
|
|
133
|
+
target-version = "py311"
|
|
134
|
+
line-length = 80
|
|
135
|
+
respect-gitignore = true
|
|
136
|
+
fix = true
|
|
137
|
+
fix-only = true
|
|
138
|
+
|
|
139
|
+
[tool.ruff.lint]
|
|
140
|
+
select = [
|
|
141
|
+
"E", # pycodestyle (errors)
|
|
142
|
+
"F", # pyflakes (logical errors)
|
|
143
|
+
"W", # warnings
|
|
144
|
+
"I", # isort (import sorting)
|
|
145
|
+
"UP", # pyupgrade (e.g. f-strings for older format)
|
|
146
|
+
"D", # pydocstyle (docstring conventions)
|
|
147
|
+
"PL", # pylint (careful coding style)
|
|
148
|
+
"B", # flake8-bugbear (likely bugs and design flaws)
|
|
149
|
+
"A", # flake8-builtins (avoid shadowing built-ins)
|
|
150
|
+
"C4", # flake8-comprehensions (inefficient comprehensions)
|
|
151
|
+
"SIM",# flake8-simplify (simplify complex logic)
|
|
152
|
+
"PT", # flake8-pytest-style (if you use pytest)
|
|
153
|
+
"RUF",# Ruff-specific rules
|
|
154
|
+
"ANN",# ruff-annotations (type annotations)
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
ignore = [
|
|
158
|
+
"D203", # Conflicts with D211 (one-blank-line-before-class)
|
|
159
|
+
"D213" # Conflicts with D212 (summary on first vs second line)
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
[tool.ruff.lint.pydocstyle]
|
|
163
|
+
convention = "numpy"
|
|
164
|
+
|
|
165
|
+
[tool.ruff.lint.per-file-ignores]
|
|
166
|
+
"__init__.py" = ["F401"]
|
|
167
|
+
"Tests/*" = ["D", "PLR2004"]
|
|
168
|
+
|
|
169
|
+
[tool.ruff.format]
|
|
170
|
+
quote-style = "double"
|
|
171
|
+
indent-style = "space"
|
|
172
|
+
line-ending = "auto"
|
|
173
|
+
|
|
174
|
+
[tool.setuptools.package-data]
|
|
175
|
+
pyPLUTO = ["py.typed"]
|
|
176
|
+
|
|
177
|
+
[tool.uv]
|
|
178
|
+
no-build-package = [
|
|
179
|
+
# mandatory deps
|
|
180
|
+
"contourpy",
|
|
181
|
+
"coverage",
|
|
182
|
+
"h5py",
|
|
183
|
+
"kiwisolver",
|
|
184
|
+
"matplotlib",
|
|
185
|
+
"numexpr",
|
|
186
|
+
"numpy",
|
|
187
|
+
"pandas",
|
|
188
|
+
"pillow",
|
|
189
|
+
"scipy",
|
|
190
|
+
|
|
191
|
+
# dev deps
|
|
192
|
+
"ruff",
|
|
193
|
+
"pre-commit",
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
# transitive deps
|
|
197
|
+
"decorator",
|
|
198
|
+
"docutils",
|
|
199
|
+
"markupsafe",
|
|
200
|
+
"jinja2",
|
|
201
|
+
"setuptools",
|
|
202
|
+
"simplejson",
|
|
203
|
+
]
|
|
204
|
+
constraint-dependencies = [
|
|
205
|
+
"jsonschema>=4.26.0",
|
|
206
|
+
"pillow>=12.2.0",
|
|
207
|
+
]
|
|
208
|
+
[tool.pixi.workspace]
|
|
209
|
+
channels = ["conda-forge"]
|
|
210
|
+
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
|
|
211
|
+
|
|
212
|
+
[tool.pixi.dependencies]
|
|
213
|
+
python = "3.11.*"
|
|
214
|
+
|
|
215
|
+
[tool.pixi.pypi-dependencies]
|
|
216
|
+
py-pluto = { path = ".", editable = true }
|
|
217
|
+
|
|
218
|
+
[tool.pixi.feature.gui.pypi-dependencies]
|
|
219
|
+
py-pluto = { path = ".", editable = true, extras = ["gui"] }
|
|
220
|
+
|
|
221
|
+
[tool.pixi.feature.pasta.pypi-dependencies]
|
|
222
|
+
py-pluto = { path = ".", editable = true, extras = ["pasta"] }
|
|
223
|
+
|
|
224
|
+
[tool.pixi.feature.full.pypi-dependencies]
|
|
225
|
+
py-pluto = { path = ".", editable = true, extras = ["gui", "pasta"] }
|
|
226
|
+
|
|
227
|
+
[tool.pixi.environments]
|
|
228
|
+
default = { features = [] }
|
|
229
|
+
gui = { features = ["gui"] }
|
|
230
|
+
pasta = { features = ["pasta"] }
|
|
231
|
+
full = { features = ["full"] }
|
|
232
|
+
|
|
233
|
+
dev = { features = ["dev"] }
|
|
234
|
+
typefuture = { features = ["typefuture"] }
|
|
235
|
+
test = { features = ["test"] }
|
|
236
|
+
docs = { features = ["docs"] }
|
|
237
|
+
notebook = { features = ["notebook"] }
|
|
238
|
+
dev-test = { features = ["dev", "test"] }
|
|
239
|
+
dev-docs = { features = ["dev", "docs"] }
|
|
240
|
+
local-dev = { features = ["dev", "test", "docs", "notebook"] }
|
|
241
|
+
|
|
242
|
+
# pyright is the standard type checker for PyPLUTO (run via the `dev` dependency
|
|
243
|
+
# group). See CONTRIBUTING for the rationale.
|
|
244
|
+
[tool.pyright]
|
|
245
|
+
pythonVersion = "3.11"
|
|
246
|
+
typeCheckingMode = "standard"
|
|
247
|
+
include = ["src"]
|
|
248
|
+
exclude = [
|
|
249
|
+
"**/__pycache__",
|
|
250
|
+
"**/node_modules",
|
|
251
|
+
"**/.*",
|
|
252
|
+
"**/.venv",
|
|
253
|
+
"Tests",
|
|
254
|
+
]
|
|
255
|
+
|
|
256
|
+
# NOTE: pyrefly and ty (the `typefuture` dependency group) are kept available
|
|
257
|
+
# but are NOT the source of truth yet; pyright already covers every issue they
|
|
258
|
+
# would report. We will switch once they mature on the patterns PyPLUTO uses.
|
|
259
|
+
[tool.pyrefly]
|
|
260
|
+
project-includes = [
|
|
261
|
+
"**/*.py*",
|
|
262
|
+
"**/*.ipynb",
|
|
263
|
+
]
|
|
264
|
+
project-excludes = [
|
|
265
|
+
"Tests/**/*.py*",
|
|
266
|
+
"Tests/**/*.ipynb",
|
|
267
|
+
]
|
|
268
|
+
python-version = "3.11"
|
|
269
|
+
preset = "basic"
|