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.
Files changed (124) hide show
  1. {py_pluto-1.1.4 → py_pluto-1.2.0}/PKG-INFO +74 -85
  2. {py_pluto-1.1.4 → py_pluto-1.2.0}/README.md +58 -48
  3. py_pluto-1.2.0/pyproject.toml +269 -0
  4. py_pluto-1.2.0/src/pyPLUTO/__init__.py +44 -0
  5. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/amr.py +108 -94
  6. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/baseloadmixin.py +88 -25
  7. py_pluto-1.2.0/src/pyPLUTO/baseloadstate.py +55 -0
  8. py_pluto-1.2.0/src/pyPLUTO/codes/echo_load.py +263 -0
  9. py_pluto-1.2.0/src/pyPLUTO/gui/app_state.py +34 -0
  10. py_pluto-1.2.0/src/pyPLUTO/gui/custom_var.py +272 -0
  11. py_pluto-1.2.0/src/pyPLUTO/gui/custom_var_engine.py +523 -0
  12. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/gui/globals.py +2 -0
  13. py_pluto-1.2.0/src/pyPLUTO/gui/load_controller.py +221 -0
  14. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/gui/main.py +7 -2
  15. py_pluto-1.2.0/src/pyPLUTO/gui/main_window.py +261 -0
  16. py_pluto-1.2.0/src/pyPLUTO/gui/panels.py +201 -0
  17. py_pluto-1.2.0/src/pyPLUTO/gui/plot_controller.py +352 -0
  18. py_pluto-1.2.0/src/pyPLUTO/gui/services.py +193 -0
  19. py_pluto-1.2.0/src/pyPLUTO/gui/state_accessors.py +152 -0
  20. py_pluto-1.2.0/src/pyPLUTO/image.py +489 -0
  21. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/colorbar.py +103 -41
  22. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/contour.py +324 -0
  23. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/create_axes.py +104 -93
  24. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/display.py +143 -108
  25. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/figure.py +125 -104
  26. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/imagetools.py +184 -102
  27. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/interactive.py +630 -0
  28. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/legend.py +291 -0
  29. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/plot.py +142 -98
  30. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagefuncs/range.py +38 -44
  31. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/scatter.py +374 -0
  32. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/set_axis.py +648 -0
  33. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/streamplot.py +357 -0
  34. py_pluto-1.2.0/src/pyPLUTO/imagefuncs/zoom.py +719 -0
  35. py_pluto-1.2.0/src/pyPLUTO/imagekwargs.py +231 -0
  36. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagemixin.py +7 -6
  37. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/imagestate.py +5 -4
  38. py_pluto-1.2.0/src/pyPLUTO/load.py +593 -0
  39. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/baseloadtools.py +24 -13
  40. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/codeselection.py +81 -0
  41. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/descriptor.py +34 -32
  42. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/findfiles.py +69 -57
  43. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/findformat.py +37 -39
  44. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/initload.py +261 -0
  45. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/loadvars.py +162 -62
  46. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/offsetdata.py +31 -25
  47. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/offsetfluid.py +156 -101
  48. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/offsetpart.py +251 -0
  49. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/read_files.py +151 -0
  50. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/readdefplini.py +47 -27
  51. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/readgridalone.py +245 -0
  52. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/readgridfile.py +292 -0
  53. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadfuncs/readtab.py +36 -28
  54. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/storepart.py +185 -0
  55. py_pluto-1.2.0/src/pyPLUTO/loadfuncs/write_files.py +191 -0
  56. py_pluto-1.2.0/src/pyPLUTO/loadkwargs.py +141 -0
  57. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/loadmixin.py +49 -71
  58. py_pluto-1.2.0/src/pyPLUTO/loadpart.py +273 -0
  59. py_pluto-1.2.0/src/pyPLUTO/loadstate.py +65 -0
  60. py_pluto-1.2.0/src/pyPLUTO/py.typed +0 -0
  61. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/compute_units.py +233 -0
  62. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/findlines.py +475 -0
  63. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/fourier.py +143 -0
  64. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/loadtools.py +150 -0
  65. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/nabla.py +739 -0
  66. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/parttools.py +179 -0
  67. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/set_units.py +160 -0
  68. py_pluto-1.2.0/src/pyPLUTO/toolfuncs/transform.py +545 -0
  69. {py_pluto-1.1.4/pyPLUTO → py_pluto-1.2.0/src/pyPLUTO/utils}/configure.py +66 -15
  70. py_pluto-1.2.0/src/pyPLUTO/utils/examples_api.py +186 -0
  71. py_pluto-1.2.0/src/pyPLUTO/utils/examples_cli.py +87 -0
  72. {py_pluto-1.1.4 → py_pluto-1.2.0/src}/pyPLUTO/utils/inspector.py +45 -29
  73. {py_pluto-1.1.4/pyPLUTO → py_pluto-1.2.0/src/pyPLUTO/utils}/pytools.py +8 -11
  74. py_pluto-1.2.0/src/pyPLUTO/utils/resolver.py +150 -0
  75. py_pluto-1.1.4/pyPLUTO/__init__.py +0 -22
  76. py_pluto-1.1.4/pyPLUTO/baseloadstate.py +0 -45
  77. py_pluto-1.1.4/pyPLUTO/codes/echo_load.py +0 -161
  78. py_pluto-1.1.4/pyPLUTO/gui/config.py +0 -174
  79. py_pluto-1.1.4/pyPLUTO/gui/custom_var.py +0 -435
  80. py_pluto-1.1.4/pyPLUTO/gui/main_window.py +0 -177
  81. py_pluto-1.1.4/pyPLUTO/gui/panels.py +0 -66
  82. py_pluto-1.1.4/pyPLUTO/gui/utils.py +0 -273
  83. py_pluto-1.1.4/pyPLUTO/h_pypluto.py +0 -84
  84. py_pluto-1.1.4/pyPLUTO/image.py +0 -302
  85. py_pluto-1.1.4/pyPLUTO/imagefuncs/contour.py +0 -254
  86. py_pluto-1.1.4/pyPLUTO/imagefuncs/interactive.py +0 -403
  87. py_pluto-1.1.4/pyPLUTO/imagefuncs/legend.py +0 -250
  88. py_pluto-1.1.4/pyPLUTO/imagefuncs/scatter.py +0 -270
  89. py_pluto-1.1.4/pyPLUTO/imagefuncs/set_axis.py +0 -497
  90. py_pluto-1.1.4/pyPLUTO/imagefuncs/streamplot.py +0 -297
  91. py_pluto-1.1.4/pyPLUTO/imagefuncs/zoom.py +0 -428
  92. py_pluto-1.1.4/pyPLUTO/load.py +0 -447
  93. py_pluto-1.1.4/pyPLUTO/loadfuncs/codeselection.py +0 -48
  94. py_pluto-1.1.4/pyPLUTO/loadfuncs/defpluto.py +0 -123
  95. py_pluto-1.1.4/pyPLUTO/loadfuncs/initload.py +0 -203
  96. py_pluto-1.1.4/pyPLUTO/loadfuncs/read_files.py +0 -213
  97. py_pluto-1.1.4/pyPLUTO/loadfuncs/readdata.py +0 -619
  98. py_pluto-1.1.4/pyPLUTO/loadfuncs/readdata_old.py +0 -567
  99. py_pluto-1.1.4/pyPLUTO/loadfuncs/readfluid.py +0 -479
  100. py_pluto-1.1.4/pyPLUTO/loadfuncs/readformat.py +0 -277
  101. py_pluto-1.1.4/pyPLUTO/loadfuncs/readgridalone.py +0 -224
  102. py_pluto-1.1.4/pyPLUTO/loadfuncs/readgridfile.py +0 -255
  103. py_pluto-1.1.4/pyPLUTO/loadfuncs/readgridout.py +0 -451
  104. py_pluto-1.1.4/pyPLUTO/loadfuncs/readpart.py +0 -419
  105. py_pluto-1.1.4/pyPLUTO/loadfuncs/write_files.py +0 -283
  106. py_pluto-1.1.4/pyPLUTO/loadpart.py +0 -233
  107. py_pluto-1.1.4/pyPLUTO/loadstate.py +0 -68
  108. py_pluto-1.1.4/pyPLUTO/newload.py +0 -81
  109. py_pluto-1.1.4/pyPLUTO/toolfuncs/findlines.py +0 -551
  110. py_pluto-1.1.4/pyPLUTO/toolfuncs/fourier.py +0 -149
  111. py_pluto-1.1.4/pyPLUTO/toolfuncs/nabla.py +0 -676
  112. py_pluto-1.1.4/pyPLUTO/toolfuncs/parttools.py +0 -152
  113. py_pluto-1.1.4/pyPLUTO/toolfuncs/transform.py +0 -638
  114. py_pluto-1.1.4/pyPLUTO/utils/annotator.py +0 -27
  115. py_pluto-1.1.4/pyPLUTO/utils/make_docstrings.py +0 -3
  116. py_pluto-1.1.4/py_pluto.egg-info/PKG-INFO +0 -218
  117. py_pluto-1.1.4/py_pluto.egg-info/SOURCES.txt +0 -76
  118. py_pluto-1.1.4/py_pluto.egg-info/dependency_links.txt +0 -1
  119. py_pluto-1.1.4/py_pluto.egg-info/entry_points.txt +0 -2
  120. py_pluto-1.1.4/py_pluto.egg-info/requires.txt +0 -41
  121. py_pluto-1.1.4/py_pluto.egg-info/top_level.txt +0 -1
  122. py_pluto-1.1.4/pyproject.toml +0 -150
  123. py_pluto-1.1.4/setup.cfg +0 -4
  124. {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.1.4
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
- License: BSD-3-Clause
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: contourpy
12
- Requires-Dist: numpy
13
- Requires-Dist: matplotlib
14
- Requires-Dist: scipy
15
- Requires-Dist: numexpr
16
- Requires-Dist: pandas
17
- Requires-Dist: h5py
18
- Requires-Dist: inifix>=5.1.0
19
- Provides-Extra: extras
20
- Requires-Dist: PySide6; extra == "extras"
21
- Provides-Extra: docs
22
- Requires-Dist: sphinx; extra == "docs"
23
- Requires-Dist: sphinx-automodapi; extra == "docs"
24
- Requires-Dist: numpydoc; extra == "docs"
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 | ![Python Versions](https://img.shields.io/badge/Python-3.12%20%7C%203.13%20%7C%203.14-3776AB.svg?style=flat&logo=python&logoColor=white) [![GitHub release](https://img.shields.io/github/v/release/GiMattia/PyPLUTO?include_prereleases&label=Release)](https://github.com/GiMattia/PyPLUTO/releases) |
30
+ | Package | ![Python Versions](https://img.shields.io/badge/Python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776AB.svg?style=flat&logo=python&logoColor=white) [![PyPI version](https://img.shields.io/pypi/v/py-pluto)](https://pypi.org/project/py-pluto/) |
53
31
  | Reliability | [![Windows Tests](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_windows.yml/badge.svg)](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_windows.yml) [![MacOS Tests](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_macos.yml/badge.svg)](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_macos.yml) [![Linux Tests](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_linux.yml/badge.svg)](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_linux.yml) ![Coverage Report](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/GiMattia/384b1f3a3a3b74cdbd65c4e3dce0632f/raw/pytest-coverage-comment__main.json) |
54
- | Docs & Community | [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Documentation](https://readthedocs.org/projects/pypluto/badge/?version=latest)](https://pypluto.readthedocs.io/en/latest/?badge=latest) [![Discord](https://img.shields.io/discord/YOUR_SERVER_ID?logo=discord&label=Discord)](https://discord.gg/YOUR_INVITE) [![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) |
32
+ | Docs & Community | [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Documentation](https://readthedocs.org/projects/pypluto/badge/?version=latest)](https://pypluto.readthedocs.io/en/latest/?badge=latest) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.gg/63A3sM9UtX) [![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) |
55
33
  | Citation | [![DOI](https://joss.theoj.org/papers/10.21105/joss.08448/status.svg)](https://doi.org/10.21105/joss.08448) [![Arxiv](https://img.shields.io/badge/arXiv-2501.09748-8F1515?style=flat&logo=arxiv&logoColor=red)](https://doi.org/10.48550/arXiv.2501.09748) [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.19650848.svg)](https://doi.org/10.5281/zenodo.19650848) |
56
34
 
57
- <!-- ![PyPI](https://img.shields.io/pypi/v/PyPLUTO) -->
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
- - additional functions (e.g., to save the images) are included in the package.
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 is tested on Python 3.10 (and newer versions) and with the following dependencies:
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
- - `numpy`
57
+ - `astropy`
58
+ - `contourpy`
59
+ - `h5py`
60
+ - `inifix`
79
61
  - `matplotlib`
62
+ - `numexpr`
63
+ - `numpy`
80
64
  - `scipy`
81
- - `pandas`
82
- - `h5py`
83
- - `PySide6`
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
- ### Installation with pip
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
- pip install ./
80
+ uv add py-pluto
99
81
  ```
100
82
 
101
- Ensure that you are using Python 3.10 or newer, as the package is compatible from this version onwards.
102
- Installation through pipenv or uv is also possible (see the documentation).
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 maptlotlib wrapper.
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 PyQt6 and allows users to load and visualize 1D and 2D fluid data (or slices) from PLUTO simulations.
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 be sure to install it in the developer mode, through the command:
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 | ![Python Versions](https://img.shields.io/badge/Python-3.12%20%7C%203.13%20%7C%203.14-3776AB.svg?style=flat&logo=python&logoColor=white) [![GitHub release](https://img.shields.io/github/v/release/GiMattia/PyPLUTO?include_prereleases&label=Release)](https://github.com/GiMattia/PyPLUTO/releases) |
5
+ | Package | ![Python Versions](https://img.shields.io/badge/Python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776AB.svg?style=flat&logo=python&logoColor=white) [![PyPI version](https://img.shields.io/pypi/v/py-pluto)](https://pypi.org/project/py-pluto/) |
6
6
  | Reliability | [![Windows Tests](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_windows.yml/badge.svg)](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_windows.yml) [![MacOS Tests](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_macos.yml/badge.svg)](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_macos.yml) [![Linux Tests](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_linux.yml/badge.svg)](https://github.com/GiMattia/PyPLUTO/actions/workflows/test_linux.yml) ![Coverage Report](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/GiMattia/384b1f3a3a3b74cdbd65c4e3dce0632f/raw/pytest-coverage-comment__main.json) |
7
- | Docs & Community | [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Documentation](https://readthedocs.org/projects/pypluto/badge/?version=latest)](https://pypluto.readthedocs.io/en/latest/?badge=latest) [![Discord](https://img.shields.io/discord/YOUR_SERVER_ID?logo=discord&label=Discord)](https://discord.gg/YOUR_INVITE) [![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) |
7
+ | Docs & Community | [![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Documentation](https://readthedocs.org/projects/pypluto/badge/?version=latest)](https://pypluto.readthedocs.io/en/latest/?badge=latest) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.gg/63A3sM9UtX) [![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) |
8
8
  | Citation | [![DOI](https://joss.theoj.org/papers/10.21105/joss.08448/status.svg)](https://doi.org/10.21105/joss.08448) [![Arxiv](https://img.shields.io/badge/arXiv-2501.09748-8F1515?style=flat&logo=arxiv&logoColor=red)](https://doi.org/10.48550/arXiv.2501.09748) [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.19650848.svg)](https://doi.org/10.5281/zenodo.19650848) |
9
9
 
10
- <!-- ![PyPI](https://img.shields.io/pypi/v/PyPLUTO) -->
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
- - additional functions (e.g., to save the images) are included in the package.
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 is tested on Python 3.10 (and newer versions) and with the following dependencies:
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
- - `numpy`
32
+ - `astropy`
33
+ - `contourpy`
34
+ - `h5py`
35
+ - `inifix`
32
36
  - `matplotlib`
37
+ - `numexpr`
38
+ - `numpy`
33
39
  - `scipy`
34
- - `pandas`
35
- - `h5py`
36
- - `PySide6`
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
- ### Installation with pip
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
- pip install ./
55
+ uv add py-pluto
52
56
  ```
53
57
 
54
- Ensure that you are using Python 3.10 or newer, as the package is compatible from this version onwards.
55
- Installation through pipenv or uv is also possible (see the documentation).
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 maptlotlib wrapper.
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 PyQt6 and allows users to load and visualize 1D and 2D fluid data (or slices) from PLUTO simulations.
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 be sure to install it in the developer mode, through the command:
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"