Skip to content

Add "examples" variant for pip installation including dependencies needed for examples, mention in README, and use in .binder/requirements.txt file. Closes #305 #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -51,6 +51,11 @@ In both cases, all Python dependencies will be resolved by pip.
#### 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",
],
},
)
Loading