Skip to content

Commit

Permalink
Add "examples" variant for pip installation including dependencies ne…
Browse files Browse the repository at this point in the history
…eded for examples, mention in README, and use in .binder/requirements.txt file. Closes #305 (#402)
  • Loading branch information
slayoo authored Feb 3, 2025
1 parent bbe0226 commit 964b20d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests+pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ jobs:
python -m pytest --durations=10 -v -s -We -p no:unraisableexception .
cd ..
- env:
SYSTEM_VERSION_COMPAT: 0
run: |
for i in dist/*.whl; do python -m pip install $PIP_INSTALL_OPTS $i[examples]; done;
- run: |
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt
ex -sc 'g/^PyPartMC/d' -cx .binder/requirements.txt
python -m pip install $PIP_INSTALL_OPTS -r .binder/requirements.txt
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests
## uncomment to gain ssh access in case of failure
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ flowchart TD
```sh
git clone --recursive git+https://github.com/open-atmos/PyPartMC.git
cd PyPartMC
DEBUG=1 VERBOSE=1 pip --verbose install -e .
DEBUG=1 VERBOSE=1 pip --verbose install -e .[tests]
gdb python
(gdb) run -m pytest -s -vv -We -p no:unraisableexception tests
```
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ import PyPartMC
#### Jupyter notebooks with examples
Note: clicking the badges below redirects to cloud-computing platforms. The mybinder.org links allow anonymous execution, Google Colab requires logging in with a Google account, ARM JupyerHub requires logging in with an ARM account (and directing Jupyter to a particular notebook within the `examples` folder).

The example notebooks feature additional dependencies that can be installed with:
```bash
pip install PyPartMC[examples]
```

- Urban plume scenario demo (as in [PartMC](https://github.com/compdyn/partmc/tree/master/scenarios/1_urban_plume)):
[![View notebook](https://img.shields.io/static/v1?label=render%20on&logo=github&color=87ce3e&message=GitHub)](https://github.com/open-atmos/PyPartMC/blob/main/examples/particle_simulation.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyPartMC/blob/main/examples/particle_simulation.ipynb)
Expand Down
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ def build_extension(self, ext): # pylint: disable=too-many-branches
"fastcore!=1.5.8", # https://github.com/fastai/fastcore/issues/439
"ghapi",
"scipy",
]
],
"examples": [
"matplotlib!=3.10.0",
"ipywidgets",
"voila",
"open-atmos-jupyter-utils",
"PySDM",
"PyMieScatt@git+https://github.com/bsumlin/PyMieScatt.git",
"SciPy",
],
},
)

0 comments on commit 964b20d

Please sign in to comment.