You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- PyPartMC is written in C++, Fortran and uses [pybind11](https://pybind11.readthedocs.io/en/stable/) and [CMake](https://cmake.org/).
8
+
- JSON support is handled with [nlohmann::json](https://github.com/nlohmann/json) and [pybind11_json](https://github.com/pybind/pybind11_json)
9
+
- PartMC and selected parts of SUNDIALS are statically linked (and compiled in during `pip install` or `python -m build`)
10
+
- C (SUNDIALS, netCDF), C++ (pybind11, ...) and Fortran (PartMC, CAMP, netCDF-fortran) dependencies are linked through [git submodules](https://github.com/open-atmos/PyPartMC/blob/main/.gitmodules)
11
+
- MOSAIC dependency is optionally linked through setting the environmental variable `MOSAIC_HOME`
12
+
- a [drop-in replacement of the PartMC spec file routines](https://github.com/open-atmos/PyPartMC/blob/main/src/spec_file_pypartmc.F90) is used for i/o from/to JSON
13
+
14
+
## Implementation architecture
15
+
16
+
```mermaid
17
+
flowchart TD
18
+
subgraph J ["Julia"]
19
+
julia_user_code["Julia user code"] --> PyCall.jl
20
+
end
21
+
subgraph M ["Matlab"]
22
+
matlab_user_code["Matlab user code"] --> matlab_python["Matlab built-in\nPython interface"]
23
+
end
24
+
subgraph P ["Python"]
25
+
python_user_code -.-> NumPy
26
+
python_user_code["Python user code"] ---> PyPartMC["pubind11-generated\nPyPartMC module"]
(gdb) run -m pytest -s -vv -We -p no:unraisableexception tests
67
+
```
68
+
69
+
## Pre-commit hooks
70
+
PyPartMC codebase benefits from Pylint, Black and isort code analysis (which are all part of the CI workflows where we also use pre-commit hooks. The pre-commit hooks can be run locally, and then the resultant changes need to be staged before committing. To set up the hooks locally, install pre-commit via `pip install pre-commit` and set up the git hooks via `pre-commit install` (this needs to be done every time you clone the project). To run all pre-commit hooks, run `pre-commit run --all-files`. The `.pre-commit-config.yaml` file can be modified in case new hooks are to be added or existing ones need to be altered.
Copy file name to clipboardExpand all lines: README.md
+1-67Lines changed: 1 addition & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ The Python API can facilitate using PartMC from other environments - see, e.g.,
9
9
10
10
For an outline of the project, rationale, architecture, and features, refer to: [D'Aquino et al., 2024 (SoftwareX)](https://doi.org/10.1016/j.softx.2023.101613) (please cite if PyPartMC is used in your research).
11
11
For a list of talks and other relevant resources, please see [project Wiki](https://github.com/open-atmos/PyPartMC/wiki/).
12
+
If interested in contributing to PyPartMC, please have a look a the [notes for developers](https://github.com/open-atmos/PyPartMC/tree/main/CONTRIBUTING.md).
PyPartMC is used within the [test workflow of the PySDM project](https://github.com/atmos-cloud-sim-uj/PySDM/tree/main/tests/smoke_tests/box/partmc).
228
229
229
-
## Implementation outline
230
-
231
-
- PyPartMC is written in C++, Fortran and uses [pybind11](https://pybind11.readthedocs.io/en/stable/) and [CMake](https://cmake.org/).
232
-
- JSON support is handled with [nlohmann::json](https://github.com/nlohmann/json) and [pybind11_json](https://github.com/pybind/pybind11_json)
233
-
- PartMC and selected parts of SUNDIALS are statically linked (and compiled in during `pip install` or `python -m build`)
234
-
- C (SUNDIALS, netCDF), C++ (pybind11, ...) and Fortran (PartMC, CAMP, netCDF-fortran) dependencies are linked through [git submodules](https://github.com/open-atmos/PyPartMC/blob/main/.gitmodules)
235
-
- MOSAIC dependency is optionally linked through setting the environmental variable `MOSAIC_HOME`
236
-
- a [drop-in replacement of the PartMC spec file routines](https://github.com/open-atmos/PyPartMC/blob/main/src/spec_file_pypartmc.F90) is used for i/o from/to JSON
237
-
238
-
## Implementation architecture
239
-
240
-
```mermaid
241
-
flowchart TD
242
-
subgraph J ["Julia"]
243
-
julia_user_code["Julia user code"] --> PyCall.jl
244
-
end
245
-
subgraph M ["Matlab"]
246
-
matlab_user_code["Matlab user code"] --> matlab_python["Matlab built-in\nPython interface"]
247
-
end
248
-
subgraph P ["Python"]
249
-
python_user_code -.-> NumPy
250
-
python_user_code["Python user code"] ---> PyPartMC["pubind11-generated\nPyPartMC module"]
A: Installation can be done using `pip`, however, `pip` needs to be instructed not to use binary packages available at pypi.org but rather to compile from source (pip will download the source from pip.org), and the path to compiled MOSAIC library needs to be provided at compile-time; the following command should convey it:
@@ -322,18 +268,6 @@ Could not find NC_M4 using the following names: m4, m4.exe
322
268
```
323
269
Try installing `m4` (e.g., using [MSYS2](https://packages.msys2.org/package/m4?repo=msys&variant=x86_64) on Windows).
(gdb) run -m pytest -s -vv -We -p no:unraisableexception tests
333
-
```
334
-
#### Pre-commit hooks
335
-
PyPartMC codebase benefits from Pylint, Black and isort code analysis (which are all part of the CI workflows where we also use pre-commit hooks. The pre-commit hooks can be run locally, and then the resultant changes need to be staged before committing. To set up the hooks locally, install pre-commit via `pip install pre-commit` and set up the git hooks via `pre-commit install` (this needs to be done every time you clone the project). To run all pre-commit hooks, run `pre-commit run --all-files`. The `.pre-commit-config.yaml` file can be modified incase new hooks are to be added or existing ones need to be altered.
0 commit comments