-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge github.com:slayoo/PySDM into HEAD
- Loading branch information
Showing
167 changed files
with
82,722 additions
and
13,942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,32 +16,20 @@ jobs: | |
python: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
platform: [ubuntu-latest, macos-13, macos-14, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/[email protected] | ||
- if: matrix.platform != 'macos-14' | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: 3.9 | ||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
sudo ln -s `which python3` /usr/local/bin/python | ||
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV | ||
python -m pip install --break-system-packages setuptools packaging # Python 3.12 workaround | ||
python-version: "3.10" | ||
- run: python -m pip install $PIP_INSTALL_ARGS -e . | ||
- run: python -m pip install $PIP_INSTALL_ARGS pytest-codeblocks pytest | ||
- run: python -m pip install $PIP_INSTALL_ARGS "pyparsing<3.0.0" # https://github.com/matplotlib/matplotlib/issues/25204 | ||
- run: | | ||
python -c "import os,pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.py', 'w', encoding='utf-8'); f.write('# coding: utf-8'+os.linesep); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()" | ||
python -c "import os,pytest_codeblocks; code=pytest_codeblocks.extract_from_file('docs/markdown/pysdm_landing.md'); f=open('readme.py', 'w', encoding='utf-8'); f.write('# coding: utf-8'+os.linesep); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()" | ||
- run: cat -n readme.py | ||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
python readme.py | ||
sed -i -e 's/CPU/GPU/g' readme.py | ||
python readme.py | ||
- if: matrix.platform != 'macos-14' | ||
run: | | ||
- run: | | ||
python -We readme.py | ||
sed -i -e 's/CPU/GPU/g' readme.py | ||
python -We readme.py | ||
|
@@ -60,10 +48,10 @@ jobs: | |
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.10" | ||
- run: pip install -e . | ||
- run: pip install pytest-codeblocks pytest | ||
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.jl', 'w'); f.writelines(block.code for block in code if block.syntax=='Julia'); f.close()" | ||
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('docs/markdown/pysdm_landing.md'); f=open('readme.jl', 'w'); f.writelines(block.code for block in code if block.syntax=='Julia'); f.close()" | ||
- uses: julia-actions/[email protected] | ||
- run: cat -n readme.jl | ||
- run: julia readme.jl | ||
|
@@ -79,7 +67,7 @@ jobs: | |
python-version: 3.8 | ||
- run: pip install -e . | ||
- run: pip install pytest-codeblocks pytest | ||
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.m', 'w'); f.writelines(block.code for block in code if block.syntax=='Matlab'); f.close()" | ||
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('docs/markdown/pysdm_landing.md'); f=open('readme.m', 'w'); f.writelines(block.code for block in code if block.syntax=='Matlab'); f.close()" | ||
- run: cat -n readme.m | ||
- uses: matlab-actions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: 3.8 | ||
python-version: 3.9 | ||
- run: | | ||
pip install pre-commit | ||
pre-commit clean | ||
|
@@ -31,7 +31,7 @@ jobs: | |
run: git diff | ||
|
||
nojit_and_codecov: | ||
needs: [precommit, pylint] | ||
needs: [precommit, pylint, devops] | ||
runs-on: ubuntu-latest | ||
env: | ||
NUMBA_DISABLE_JIT: 1 | ||
|
@@ -40,7 +40,7 @@ jobs: | |
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@master | ||
- uses: actions/setup-python@v5.0.0 | ||
with: | ||
python-version: 3.9 | ||
- name: Generate coverage report | ||
|
@@ -58,7 +58,7 @@ jobs: | |
pdoc: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-12, windows-latest] | ||
platform: [ubuntu-latest, macos-13, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -67,12 +67,20 @@ jobs: | |
persist-credentials: false | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.12" | ||
- run: | | ||
pip install pdoc | ||
pip install pdoc nbformat | ||
pip install -e . | ||
pip install -e examples | ||
PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PySDM examples/PySDM_examples -t pdoc_templates | ||
python - <<EOF | ||
import glob, nbformat | ||
for notebook_path in glob.glob('examples/PySDM_examples/*/*.ipynb'): | ||
with open(notebook_path, encoding="utf8") as fin: | ||
with open(notebook_path + ".badges.md", 'w') as fout: | ||
fout.write(nbformat.read(fin, nbformat.NO_CONVERT).cells[0].source) | ||
EOF | ||
PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PySDM examples/PySDM_examples -t docs/templates --math --mermaid | ||
- if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }} | ||
uses: JamesIves/[email protected] | ||
with: | ||
|
@@ -86,7 +94,7 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
fetch-depth: 0 | ||
- name: Set up Python 3.9 | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -114,20 +122,31 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
- uses: notiz-dev/github-action-json-property@release | ||
with: | ||
with: | ||
path: '.zenodo.json' | ||
prop_path: 'creators' | ||
|
||
tests: | ||
needs: [pdoc, nojit_and_codecov, zenodo_json] | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-12, windows-latest] | ||
python-version: ["3.8", "3.11"] | ||
platform: [ubuntu-latest, macos-13, macos-14, windows-latest] | ||
python-version: ["3.9", "3.12"] | ||
test-suite: ["unit_tests/!(dynamics)", "unit_tests/dynamics/!(condensation)", "unit_tests/dynamics/condensation", "smoke_tests/no_env", "smoke_tests/box", "smoke_tests/parcel_a", "smoke_tests/parcel_b", "smoke_tests/parcel_c", "smoke_tests/kinematic_1d", "smoke_tests/kinematic_2d", "tutorials_tests"] | ||
exclude: | ||
- platform: "macos-14" | ||
python-version: "3.9" | ||
- test-suite: "devops_tests" | ||
python-version: "3.8" | ||
python-version: "3.9" | ||
# TODO #1406 | ||
- platform: "macos-14" | ||
test-suite: "smoke_tests/box" | ||
- platform: "macos-14" | ||
test-suite: "smoke_tests/parcel_a" | ||
- platform: "macos-14" | ||
test-suite: "smoke_tests/kinematic_2d" | ||
- platform: "macos-14" | ||
test-suite: "unit_tests/!(dynamics)" | ||
fail-fast: false | ||
runs-on: ${{ matrix.platform }} | ||
timeout-minutes: ${{ startsWith(matrix.platform, 'windows-') && 40 || 25 }} | ||
|
@@ -148,11 +167,13 @@ jobs: | |
- if: startsWith(matrix.test-suite, 'smoke_tests') || matrix.test-suite == 'tutorials_tests' | ||
run: pip install -e ./examples | ||
|
||
- run: pip install -e .[tests] # incl. ensuring that the previous pip did not overwrite the package | ||
# incl. ensuring that the previous pip did not overwrite the package | ||
- run: | | ||
pip install --only-binary :all: -e .[tests] | ||
# install devops_tests for tutorials_tests | ||
- if: matrix.test-suite == 'tutorials_tests' | ||
run: pip install -r tests/devops_tests/requirements.txt | ||
run: pip install -r tests/devops_tests/requirements.txt | ||
|
||
# https://github.com/numba/numba/issues/6350#issuecomment-728174860 | ||
- if: startsWith(matrix.platform, 'ubuntu-') | ||
|
@@ -175,15 +196,15 @@ jobs: | |
needs: [nojit_and_codecov] | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-22.04, macos-12, windows-latest] | ||
python-version: ["3.8", "3.11"] | ||
platform: [ubuntu-24.04, macos-13, windows-latest] | ||
python-version: ["3.9", "3.12"] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v1 | ||
- uses: actions/setup-python@v5.0.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: | | ||
|
@@ -211,12 +232,12 @@ jobs: | |
needs: [examples-setup] | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-22.04, macos-12, windows-latest] | ||
python-version: ["3.8", "3.11"] | ||
platform: [ubuntu-24.04, macos-13, windows-latest] | ||
python-version: ["3.9", "3.12"] | ||
test-suite: [ "chemistry_freezing_isotopes", "condensation_a", "condensation_b", "coagulation", "breakup", "multi-process_a", "multi-process_b"] | ||
fail-fast: false | ||
runs-on: ${{ matrix.platform }} | ||
timeout-minutes: ${{ startsWith(matrix.platform, 'windows-') && 65 || 50 }} | ||
timeout-minutes: ${{ !startsWith(matrix.platform, 'ubuntu-') && 65 || 50 }} | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -242,16 +263,29 @@ jobs: | |
- if: startsWith(matrix.platform, 'ubuntu-') | ||
run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV | ||
|
||
- if: startsWith(matrix.platform, 'ubuntu-') | ||
- if: startsWith(matrix.platform, 'ubuntu-') && matrix.test-suite == 'multi-process_a' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install python3-paraview | ||
- if: startsWith(matrix.platform, 'macos-') | ||
sudo apt-get install libegl1 libopengl0 ghostscript | ||
wget -nv "https://paraview.org/paraview-downloads/download.php?submit=Download&version=v5.13&type=binary&os=Linux&downloadFile=ParaView-5.13.1-egl-MPI-Linux-Python3.10-x86_64.tar.gz" -O paraview.tar.gz | ||
tar xzf paraview.tar.gz | ||
echo `pwd`/`dirname ParaView*/bin/pvpython` >> $GITHUB_PATH | ||
- if: startsWith(matrix.platform, 'macos-') && matrix.test-suite == 'multi-process_a' | ||
run: | | ||
brew install --cask paraview | ||
echo `dirname /Applications/ParaView-*.app/Contents/bin/pvpython | head -1` >> $GITHUB_PATH | ||
- if: matrix.platform != 'windows-latest' | ||
run: pvpython --version | ||
brew install ghostscript | ||
- if: startsWith(matrix.platform, 'windows-') && matrix.test-suite == 'multi-process_a' | ||
run: | | ||
curl "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.13&type=binary&os=Windows&downloadFile=ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64.msi" -o paraview.msi | ||
msiexec //i paraview.msi //quiet //qn //norestart | ||
echo "C:\\Program Files\\ParaView 5.13.1\\bin\\" >> $GITHUB_PATH | ||
- if: matrix.test-suite == 'multi-process_a' | ||
run: | | ||
pvpython --version | ||
pvpython -c "from paraview import simple" | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -284,77 +318,70 @@ jobs: | |
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" | ||
|
||
- run: pip install twine build | ||
|
||
- run: | | ||
unset CI | ||
cd ${{ matrix.packages-dir }} | ||
python -m build 2>&1 | tee build.log | ||
exit `fgrep -i warning build.log | grep -v impl_numba/warnings.py | grep -v "no previously-included files matching" | wc -l` | ||
exit `fgrep -i warning build.log | grep -v impl_numba/warnings.py \ | ||
| grep -v "no previously-included files matching" \ | ||
| grep -v "version of {dist_name} already set" \ | ||
| grep -v -E "UserWarning: version of PySDM(-examples)? already set" \ | ||
| wc -l` | ||
twine check --strict dist/* | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ${{ matrix.packages-dir}}/dist | ||
name: dist | ||
path: ${{ matrix.packages-dir }}/dist | ||
name: dist-${{ matrix.packages-dir }} | ||
|
||
pkg_install_check: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
python-version: ["3.8", "3.11", "system"] | ||
platform: [ubuntu-latest, macos-13, macos-14, windows-latest] | ||
python-version: ["3.9", "3.12"] | ||
exclude: | ||
- platform: ubuntu-latest | ||
python-version: system | ||
- platform: macos-12 | ||
python-version: system | ||
- platform: windows-latest | ||
python-version: system | ||
- platform: macos-14 | ||
python-version: "3.8" | ||
- platform: macos-14 | ||
python-version: "3.11" | ||
python-version: "3.9" | ||
runs-on: ${{ matrix.platform }} | ||
needs: [package] | ||
steps: | ||
- if: matrix.platform != 'macos-14' | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
sudo ln -s `which python3` /usr/local/bin/python | ||
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV | ||
# Python 3.12 workaround | ||
python -m pip install --break-system-packages setuptools packaging | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
pattern: dist-* | ||
merge-multiple: true | ||
path: dist | ||
- run: python -m pip install $PIP_INSTALL_ARGS dist/*.whl | ||
- run: python -c "import PySDM; print(PySDM.__version__)" | ||
- run: python -c "import PySDM_examples; print(PySDM_examples.__version__)" | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [tests, examples, devops, package, pkg_install_check] | ||
needs: [tests, examples, package, pkg_install_check] | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
pattern: dist-* | ||
merge-multiple: true | ||
path: dist | ||
|
||
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: pypa/gh-action-pypi-publish@unstable/v1 | ||
uses: pypa/gh-action-pypi-publish@release/v1.12 | ||
with: | ||
attestations: false | ||
repository_url: https://test.pypi.org/legacy/ | ||
packages-dir: dist | ||
|
||
- if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@unstable/v1 | ||
uses: pypa/gh-action-pypi-publish@release/v1.12 | ||
with: | ||
attestations: false | ||
packages-dir: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.