py-pluto 1.1.5__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.5/README.md → py_pluto-1.2.0/PKG-INFO +71 -10
- py_pluto-1.1.5/PKG-INFO → py_pluto-1.2.0/README.md +44 -31
- {py_pluto-1.1.5 → py_pluto-1.2.0}/pyproject.toml +58 -9
- py_pluto-1.2.0/src/pyPLUTO/__init__.py +44 -0
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/amr.py +108 -94
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/baseloadmixin.py +76 -13
- 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.5 → 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.5 → py_pluto-1.2.0}/src/pyPLUTO/gui/main.py +6 -1
- 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.5 → 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.5 → py_pluto-1.2.0}/src/pyPLUTO/imagefuncs/create_axes.py +104 -93
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/imagefuncs/display.py +143 -108
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/imagefuncs/figure.py +125 -104
- {py_pluto-1.1.5 → 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.5 → py_pluto-1.2.0}/src/pyPLUTO/imagefuncs/plot.py +142 -98
- {py_pluto-1.1.5 → 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.5 → py_pluto-1.2.0}/src/pyPLUTO/imagemixin.py +7 -6
- {py_pluto-1.1.5 → 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.5 → 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.5 → py_pluto-1.2.0}/src/pyPLUTO/loadfuncs/descriptor.py +34 -32
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/loadfuncs/findfiles.py +69 -57
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/loadfuncs/findformat.py +36 -38
- py_pluto-1.2.0/src/pyPLUTO/loadfuncs/initload.py +261 -0
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/loadfuncs/loadvars.py +162 -62
- {py_pluto-1.1.5 → py_pluto-1.2.0}/src/pyPLUTO/loadfuncs/offsetdata.py +31 -25
- {py_pluto-1.1.5 → 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.5 → 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.5 → 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.5 → 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.5/src/pyPLUTO → py_pluto-1.2.0/src/pyPLUTO/utils}/configure.py +60 -13
- 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.5 → py_pluto-1.2.0}/src/pyPLUTO/utils/inspector.py +45 -29
- {py_pluto-1.1.5/src/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.5/src/pyPLUTO/__init__.py +0 -28
- py_pluto-1.1.5/src/pyPLUTO/baseloadstate.py +0 -45
- py_pluto-1.1.5/src/pyPLUTO/codes/echo_load.py +0 -161
- py_pluto-1.1.5/src/pyPLUTO/gui/config.py +0 -211
- py_pluto-1.1.5/src/pyPLUTO/gui/custom_var.py +0 -435
- py_pluto-1.1.5/src/pyPLUTO/gui/main_window.py +0 -177
- py_pluto-1.1.5/src/pyPLUTO/gui/panels.py +0 -66
- py_pluto-1.1.5/src/pyPLUTO/gui/utils.py +0 -273
- py_pluto-1.1.5/src/pyPLUTO/h_pypluto.py +0 -87
- py_pluto-1.1.5/src/pyPLUTO/image.py +0 -302
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/contour.py +0 -254
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/interactive.py +0 -403
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/legend.py +0 -252
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/scatter.py +0 -270
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/set_axis.py +0 -497
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/streamplot.py +0 -297
- py_pluto-1.1.5/src/pyPLUTO/imagefuncs/zoom.py +0 -428
- py_pluto-1.1.5/src/pyPLUTO/load.py +0 -447
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/codeselection.py +0 -48
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/defpluto.py +0 -123
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/initload.py +0 -203
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/read_files.py +0 -213
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readdata.py +0 -619
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readdata_old.py +0 -567
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readfluid.py +0 -479
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readformat.py +0 -277
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readgridalone.py +0 -224
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readgridfile.py +0 -255
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readgridout.py +0 -451
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/readpart.py +0 -419
- py_pluto-1.1.5/src/pyPLUTO/loadfuncs/write_files.py +0 -283
- py_pluto-1.1.5/src/pyPLUTO/loadpart.py +0 -233
- py_pluto-1.1.5/src/pyPLUTO/loadstate.py +0 -68
- py_pluto-1.1.5/src/pyPLUTO/newload.py +0 -81
- py_pluto-1.1.5/src/pyPLUTO/toolfuncs/findlines.py +0 -551
- py_pluto-1.1.5/src/pyPLUTO/toolfuncs/fourier.py +0 -149
- py_pluto-1.1.5/src/pyPLUTO/toolfuncs/nabla.py +0 -676
- py_pluto-1.1.5/src/pyPLUTO/toolfuncs/parttools.py +0 -152
- py_pluto-1.1.5/src/pyPLUTO/toolfuncs/transform.py +0 -638
- py_pluto-1.1.5/src/pyPLUTO/utils/annotator.py +0 -31
- py_pluto-1.1.5/src/pyPLUTO/utils/make_docstrings.py +0 -146
- py_pluto-1.1.5/src/pyPLUTO/utils/pypluto_function_parameters.json +0 -2954
- {py_pluto-1.1.5 → py_pluto-1.2.0}/LICENSE +0 -0
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-pluto
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: PyPLUTO: Plotting routines for PLUTO
|
|
5
|
+
Author: D. Crocco, D. Melon Fuksman, M. Bugli, V. Berta, E. Puzzoni, A. Mignone, B. Vaidya
|
|
6
|
+
Author-email: "G. Mattia" <mattia@mpia.de>
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
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
|
|
24
|
+
Provides-Extra: pasta
|
|
25
|
+
|
|
1
26
|
# PyPLUTO: a data analysis Python package for the PLUTO code
|
|
2
27
|
|
|
3
28
|
| Category | Badges |
|
|
@@ -7,7 +32,7 @@
|
|
|
7
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) |
|
|
8
33
|
| Citation | [](https://doi.org/10.21105/joss.08448) [](https://doi.org/10.48550/arXiv.2501.09748) [](https://doi.org/10.5281/zenodo.19650848) |
|
|
9
34
|
|
|
10
|
-
PyPLUTO is a Python library which loads and plots the data
|
|
35
|
+
PyPLUTO is a Python library which loads and plots the data obtained from the
|
|
11
36
|
PLUTO code simulations.
|
|
12
37
|
The aim of this package is to simplify some non-trivial python routines in order
|
|
13
38
|
to quickly recover effective plots that are suited for scientific publications.
|
|
@@ -20,21 +45,26 @@ The package is structured as follow:
|
|
|
20
45
|
- the Load class is used to load the data from the PLUTO simulation fluid files.
|
|
21
46
|
- the LoadPart class is used to load the data from the PLUTO simulation particle files.
|
|
22
47
|
- the Image class is used to visualize the loaded data.
|
|
23
|
-
- the GUI subpackage allows for a
|
|
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.
|
|
24
50
|
- additional functions (e.g., to show the images) are included in the package.
|
|
25
51
|
|
|
26
52
|
The package includes a set of examples in the `Examples` directory.
|
|
27
53
|
|
|
28
|
-
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:
|
|
29
56
|
|
|
30
|
-
- `
|
|
57
|
+
- `astropy`
|
|
31
58
|
- `contourpy`
|
|
59
|
+
- `h5py`
|
|
60
|
+
- `inifix`
|
|
32
61
|
- `matplotlib`
|
|
33
62
|
- `numexpr`
|
|
63
|
+
- `numpy`
|
|
34
64
|
- `scipy`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
65
|
+
|
|
66
|
+
The GUI requires the optional dependency `PySide6`, installable via
|
|
67
|
+
`pip install py-pluto[gui]`.
|
|
38
68
|
|
|
39
69
|
The package is provided with a `LICENSE` file which contains the license terms.
|
|
40
70
|
|
|
@@ -50,7 +80,7 @@ The easiest way to install PyPLUTO is through uv. Open your terminal and run the
|
|
|
50
80
|
uv add py-pluto
|
|
51
81
|
```
|
|
52
82
|
|
|
53
|
-
Ensure that you are using Python 3.
|
|
83
|
+
Ensure that you are using Python 3.11 or newer, as the package is compatible from this version onwards.
|
|
54
84
|
Installation through pip is also possible through the command:
|
|
55
85
|
|
|
56
86
|
```bash
|
|
@@ -74,7 +104,7 @@ print(D)
|
|
|
74
104
|
```
|
|
75
105
|
|
|
76
106
|
Relevant simulations attributes (such as the computational grid, the geometry and the variables to load) are found automatically.
|
|
77
|
-
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.
|
|
78
108
|
An example of 1D plot of the density can be:
|
|
79
109
|
|
|
80
110
|
```python
|
|
@@ -99,6 +129,36 @@ In this way, PyPLUTO can be explored without any knowledge of the PLUTO code.
|
|
|
99
129
|
All the tests are located in the `Examples` directory and are aimed at showing
|
|
100
130
|
how to exploit the package capabilities.
|
|
101
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
|
+
|
|
102
162
|
## The GUI
|
|
103
163
|
|
|
104
164
|
A Graphical User Interface has been implemented in order to simplify and enhance the visualization and analysis of simulation data.
|
|
@@ -143,4 +203,5 @@ We recommend to put one the following expressions in your manuscript:
|
|
|
143
203
|
|
|
144
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.
|
|
145
205
|
Any contribution aimed at helping the PLUTO code community to have better plots with less efforts will be greatly appreciated.
|
|
146
|
-
If you want to contribute to PyPLUTO please follow the instruction present in the CONTRIBUTING.md file.
|
|
206
|
+
If you want to contribute to PyPLUTO please follow the instruction present in the CONTRIBUTING.md file.
|
|
207
|
+
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: py-pluto
|
|
3
|
-
Version: 1.1.5
|
|
4
|
-
Summary: PyPLUTO: Plotting routines for PLUTO
|
|
5
|
-
Author: D. Crocco, D. Melon Fuksman, M. Bugli, V. Berta, E. Puzzoni, A. Mignone, B. Vaidya
|
|
6
|
-
Author-email: "G. Mattia" <mattia@mpia.de>
|
|
7
|
-
Requires-Python: >=3.11
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Dist: contourpy>=1.2.1
|
|
11
|
-
Requires-Dist: numpy>=2.0.0
|
|
12
|
-
Requires-Dist: matplotlib>=3.8.4
|
|
13
|
-
Requires-Dist: scipy>=1.13.0
|
|
14
|
-
Requires-Dist: numexpr>=2.10.0
|
|
15
|
-
Requires-Dist: pandas>=2.2.2
|
|
16
|
-
Requires-Dist: h5py>=3.11.0
|
|
17
|
-
Requires-Dist: inifix>=5.1.0
|
|
18
|
-
Requires-Dist: PySide6 ; extra == "gui"
|
|
19
|
-
Requires-Dist: pastamarkers ; extra == "pasta"
|
|
20
|
-
Provides-Extra: gui
|
|
21
|
-
Provides-Extra: pasta
|
|
22
|
-
|
|
23
1
|
# PyPLUTO: a data analysis Python package for the PLUTO code
|
|
24
2
|
|
|
25
3
|
| Category | Badges |
|
|
@@ -29,7 +7,7 @@ Provides-Extra: pasta
|
|
|
29
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) |
|
|
30
8
|
| Citation | [](https://doi.org/10.21105/joss.08448) [](https://doi.org/10.48550/arXiv.2501.09748) [](https://doi.org/10.5281/zenodo.19650848) |
|
|
31
9
|
|
|
32
|
-
PyPLUTO is a Python library which loads and plots the data
|
|
10
|
+
PyPLUTO is a Python library which loads and plots the data obtained from the
|
|
33
11
|
PLUTO code simulations.
|
|
34
12
|
The aim of this package is to simplify some non-trivial python routines in order
|
|
35
13
|
to quickly recover effective plots that are suited for scientific publications.
|
|
@@ -42,21 +20,26 @@ The package is structured as follow:
|
|
|
42
20
|
- the Load class is used to load the data from the PLUTO simulation fluid files.
|
|
43
21
|
- the LoadPart class is used to load the data from the PLUTO simulation particle files.
|
|
44
22
|
- the Image class is used to visualize the loaded data.
|
|
45
|
-
- the GUI subpackage allows for a
|
|
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.
|
|
46
25
|
- additional functions (e.g., to show the images) are included in the package.
|
|
47
26
|
|
|
48
27
|
The package includes a set of examples in the `Examples` directory.
|
|
49
28
|
|
|
50
|
-
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:
|
|
51
31
|
|
|
52
|
-
- `
|
|
32
|
+
- `astropy`
|
|
53
33
|
- `contourpy`
|
|
34
|
+
- `h5py`
|
|
35
|
+
- `inifix`
|
|
54
36
|
- `matplotlib`
|
|
55
37
|
- `numexpr`
|
|
38
|
+
- `numpy`
|
|
56
39
|
- `scipy`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
40
|
+
|
|
41
|
+
The GUI requires the optional dependency `PySide6`, installable via
|
|
42
|
+
`pip install py-pluto[gui]`.
|
|
60
43
|
|
|
61
44
|
The package is provided with a `LICENSE` file which contains the license terms.
|
|
62
45
|
|
|
@@ -72,7 +55,7 @@ The easiest way to install PyPLUTO is through uv. Open your terminal and run the
|
|
|
72
55
|
uv add py-pluto
|
|
73
56
|
```
|
|
74
57
|
|
|
75
|
-
Ensure that you are using Python 3.
|
|
58
|
+
Ensure that you are using Python 3.11 or newer, as the package is compatible from this version onwards.
|
|
76
59
|
Installation through pip is also possible through the command:
|
|
77
60
|
|
|
78
61
|
```bash
|
|
@@ -96,7 +79,7 @@ print(D)
|
|
|
96
79
|
```
|
|
97
80
|
|
|
98
81
|
Relevant simulations attributes (such as the computational grid, the geometry and the variables to load) are found automatically.
|
|
99
|
-
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.
|
|
100
83
|
An example of 1D plot of the density can be:
|
|
101
84
|
|
|
102
85
|
```python
|
|
@@ -121,6 +104,36 @@ In this way, PyPLUTO can be explored without any knowledge of the PLUTO code.
|
|
|
121
104
|
All the tests are located in the `Examples` directory and are aimed at showing
|
|
122
105
|
how to exploit the package capabilities.
|
|
123
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
|
+
|
|
124
137
|
## The GUI
|
|
125
138
|
|
|
126
139
|
A Graphical User Interface has been implemented in order to simplify and enhance the visualization and analysis of simulation data.
|
|
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "py-pluto"
|
|
7
|
-
|
|
7
|
+
version = "1.2.0"
|
|
8
8
|
description = "PyPLUTO: Plotting routines for PLUTO"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -20,14 +20,14 @@ authors = [
|
|
|
20
20
|
{ name = "B. Vaidya" }
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
+
"astropy>=7.2.0",
|
|
23
24
|
"contourpy>=1.2.1",
|
|
24
25
|
"numpy>=2.0.0",
|
|
25
26
|
"matplotlib>=3.8.4",
|
|
26
27
|
"scipy>=1.13.0",
|
|
27
28
|
"numexpr>=2.10.0",
|
|
28
|
-
"pandas>=2.2.2",
|
|
29
29
|
"h5py>=3.11.0",
|
|
30
|
-
"inifix>=
|
|
30
|
+
"inifix>=7.0.0",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
33
|
[project.optional-dependencies]
|
|
@@ -54,17 +54,27 @@ test = [
|
|
|
54
54
|
]
|
|
55
55
|
dev = [
|
|
56
56
|
"uv",
|
|
57
|
+
"auto-walrus",
|
|
57
58
|
"pandas-stubs",
|
|
58
59
|
"h5py-stubs",
|
|
59
60
|
"pre-commit",
|
|
60
61
|
"pyright",
|
|
61
|
-
"pyrefly",
|
|
62
62
|
"ruff",
|
|
63
|
-
"ty>=0.0.17",
|
|
64
63
|
"radon",
|
|
65
64
|
"pydata-sphinx-theme",
|
|
66
65
|
]
|
|
67
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
|
+
|
|
68
78
|
notebook = [
|
|
69
79
|
"ipython>=9.0.0",
|
|
70
80
|
]
|
|
@@ -76,6 +86,7 @@ dev-test = [
|
|
|
76
86
|
|
|
77
87
|
dev-docs = [
|
|
78
88
|
{ include-group = "dev" },
|
|
89
|
+
|
|
79
90
|
{ include-group = "docs" },
|
|
80
91
|
]
|
|
81
92
|
|
|
@@ -88,10 +99,16 @@ local-dev = [
|
|
|
88
99
|
|
|
89
100
|
[project.scripts]
|
|
90
101
|
pypluto-gui = "pyPLUTO.gui.main:main"
|
|
102
|
+
pypluto-examples = "pyPLUTO.utils.examples_cli:main"
|
|
91
103
|
|
|
92
104
|
[tool.flit.module]
|
|
93
105
|
name = "pyPLUTO"
|
|
94
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
|
+
|
|
95
112
|
[tool.coverage.run]
|
|
96
113
|
source = ["src"]
|
|
97
114
|
branch = true
|
|
@@ -147,13 +164,16 @@ convention = "numpy"
|
|
|
147
164
|
|
|
148
165
|
[tool.ruff.lint.per-file-ignores]
|
|
149
166
|
"__init__.py" = ["F401"]
|
|
150
|
-
"
|
|
167
|
+
"Tests/*" = ["D", "PLR2004"]
|
|
151
168
|
|
|
152
169
|
[tool.ruff.format]
|
|
153
170
|
quote-style = "double"
|
|
154
171
|
indent-style = "space"
|
|
155
172
|
line-ending = "auto"
|
|
156
173
|
|
|
174
|
+
[tool.setuptools.package-data]
|
|
175
|
+
pyPLUTO = ["py.typed"]
|
|
176
|
+
|
|
157
177
|
[tool.uv]
|
|
158
178
|
no-build-package = [
|
|
159
179
|
# mandatory deps
|
|
@@ -182,10 +202,9 @@ no-build-package = [
|
|
|
182
202
|
"simplejson",
|
|
183
203
|
]
|
|
184
204
|
constraint-dependencies = [
|
|
185
|
-
"jsonschema>=0
|
|
186
|
-
"pillow>=
|
|
205
|
+
"jsonschema>=4.26.0",
|
|
206
|
+
"pillow>=12.2.0",
|
|
187
207
|
]
|
|
188
|
-
|
|
189
208
|
[tool.pixi.workspace]
|
|
190
209
|
channels = ["conda-forge"]
|
|
191
210
|
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
|
|
@@ -212,9 +231,39 @@ pasta = { features = ["pasta"] }
|
|
|
212
231
|
full = { features = ["full"] }
|
|
213
232
|
|
|
214
233
|
dev = { features = ["dev"] }
|
|
234
|
+
typefuture = { features = ["typefuture"] }
|
|
215
235
|
test = { features = ["test"] }
|
|
216
236
|
docs = { features = ["docs"] }
|
|
217
237
|
notebook = { features = ["notebook"] }
|
|
218
238
|
dev-test = { features = ["dev", "test"] }
|
|
219
239
|
dev-docs = { features = ["dev", "docs"] }
|
|
220
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"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Top-level package for pyPLUTO."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib.metadata import PackageNotFoundError
|
|
6
|
+
from importlib.metadata import version as _version
|
|
7
|
+
|
|
8
|
+
from pyPLUTO.image import Image
|
|
9
|
+
from pyPLUTO.load import Load
|
|
10
|
+
from pyPLUTO.loadpart import LoadPart
|
|
11
|
+
from pyPLUTO.utils.configure import Configure, set_text
|
|
12
|
+
from pyPLUTO.utils.examples_api import (
|
|
13
|
+
copy_examples,
|
|
14
|
+
examples_path,
|
|
15
|
+
list_examples,
|
|
16
|
+
run_example,
|
|
17
|
+
)
|
|
18
|
+
from pyPLUTO.utils.pytools import find_example, ring, savefig, show
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
__version__ = _version("py-pluto")
|
|
22
|
+
except PackageNotFoundError:
|
|
23
|
+
__version__ = "unknown"
|
|
24
|
+
|
|
25
|
+
colorerr: bool = True
|
|
26
|
+
colorwarn: bool = True
|
|
27
|
+
greet: bool = True
|
|
28
|
+
|
|
29
|
+
Configure(__version__, colorerr, colorwarn, greet)
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"Image",
|
|
33
|
+
"Load",
|
|
34
|
+
"LoadPart",
|
|
35
|
+
"copy_examples",
|
|
36
|
+
"examples_path",
|
|
37
|
+
"find_example",
|
|
38
|
+
"list_examples",
|
|
39
|
+
"ring",
|
|
40
|
+
"run_example",
|
|
41
|
+
"savefig",
|
|
42
|
+
"set_text",
|
|
43
|
+
"show",
|
|
44
|
+
]
|