Skip to content

Commit fb79136

Browse files
add check-badges hook; set NUMBA_THREADING_LAYER to 'workqueue' in all notebooks with uniform experience across all OSes in mind (#1748)
Co-authored-by: Sylwester Arabas <sylwester.arabas@agh.edu.pl>
1 parent 9079d8c commit fb79136

File tree

91 files changed

+262324
-3292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+262324
-3292
lines changed

.github/actions/env-setup/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ runs:
4343
exit(0)
4444
EOF
4545
shell: bash
46+
47+
- name: set NUMBA_THREADING_LAYER
48+
run: echo NUMBA_THREADING_LAYER=workqueue >> $GITHUB_ENV
49+
shell: bash
4650

4751
- uses: actions/cache/save@v4
4852
if: steps.cache.outputs.cache-hit != 'true'

.github/workflows/readme_snippets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
with:
6767
python-version: "3.12"
6868

69-
- run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV
69+
- run: echo NUMBA_THREADING_LAYER=workqueue >> $GITHUB_ENV
7070

7171
- run: pip install -e .
7272
- run: pip install pytest-codeblocks pytest

.github/workflows/tests.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
pylint --max-module-lines=550 --unsafe-load-any-extension=y --disable=fixme,too-many-function-args,unsubscriptable-object,consider-using-with,protected-access,too-many-statements,too-many-public-methods,too-many-branches,duplicate-code,invalid-name,missing-function-docstring,missing-module-docstring,missing-class-docstring,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,c-extension-no-member $(git ls-files '*.py' | grep ^examples)
8585
- run: |
8686
# TODO #682
87-
nbqa pylint --unsafe-load-any-extension=y --disable=fixme,duplicate-code,invalid-name,trailing-whitespace,line-too-long,missing-function-docstring,wrong-import-position,missing-module-docstring,wrong-import-order,ungrouped-imports,no-member,too-many-locals,unnecessary-lambda-assignment $(git ls-files '*.ipynb')
87+
nbqa pylint --unsafe-load-any-extension=y --disable=fixme,duplicate-code,invalid-name,trailing-whitespace,line-too-long,missing-function-docstring,wrong-import-position,missing-module-docstring,wrong-import-order,ungrouped-imports,no-member,too-many-locals,unnecessary-lambda-assignment,multiple-imports $(git ls-files '*.ipynb')
8888
8989
unit-tests-without-jit-plus-codecov:
9090
needs: env-unit-tests-setup
@@ -138,8 +138,6 @@ jobs:
138138
with:
139139
python-version: ${{ matrix.python-version }}
140140
setup-name: unit-tests-${{ matrix.platform }}-${{ matrix.python-version }}
141-
- if: startsWith(matrix.platform, 'ubuntu-')
142-
run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV
143141
- name: Run pytest
144142
env:
145143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -199,9 +197,6 @@ jobs:
199197
with:
200198
python-version: ${{ matrix.python-version }}
201199
setup-name: nonunit-tests-${{ matrix.platform }}-${{ matrix.python-version }}
202-
203-
- if: startsWith(matrix.platform, 'ubuntu-')
204-
run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV
205200
- name: Run pytest
206201
env:
207202
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -243,7 +238,7 @@ jobs:
243238
test-suite: "multi-process_e"
244239
fail-fast: true
245240
runs-on: ${{ matrix.platform }}
246-
timeout-minutes: ${{ startsWith(matrix.platform, 'windows-') && 28 || 30 }}
241+
timeout-minutes: ${{ startsWith(matrix.platform, 'windows-') && 30 || 32 }}
247242
steps:
248243
- name: Debug contexts
249244
run: |
@@ -261,8 +256,6 @@ jobs:
261256
python-version: ${{ matrix.python-version }}
262257
setup-name: nonunit-tests-${{ matrix.platform }}-${{ matrix.python-version }}
263258
# https://github.com/numba/numba/issues/6350#issuecomment-728174860
264-
- if: startsWith(matrix.platform, 'ubuntu-')
265-
run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV
266259

267260
- if: startsWith(matrix.platform, 'ubuntu-') && (contains(matrix.test-suite, 'multi-process_a') || contains(matrix.test-suite, 'multi-process_b'))
268261
run: |

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ repos:
2828
- id: detect-missing-init
2929
args: ['--create', "--track", "--python-folders", "tests,PySDM,examples/PySDM_examples"]
3030

31+
- repo: https://github.com/open-atmos/devops_tests
32+
rev: v0.0.2
33+
hooks:
34+
- id: check-badges
35+
name: check badges
36+
args: [--fix-header, --repo-name=PySDM]

examples/PySDM_examples/Abade_and_Albuquerque_2024/fig_2.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@
4141
},
4242
"outputs": [],
4343
"source": [
44-
"import sys\n",
44+
"import os, sys\n",
45+
"os.environ['NUMBA_THREADING_LAYER'] = 'workqueue' # PySDM & PyMPDATA don't work with TBB; OpenMP has extra dependencies on macOS\n",
4546
"if 'google.colab' in sys.modules:\n",
4647
" !pip --quiet install open-atmos-jupyter-utils\n",
4748
" from open_atmos_jupyter_utils import pip_install_on_colab\n",
48-
" pip_install_on_colab('PySDM-examples')"
49+
" pip_install_on_colab('PySDM-examples', 'PySDM')"
4950
]
5051
},
5152
{
@@ -55,7 +56,6 @@
5556
"metadata": {},
5657
"outputs": [],
5758
"source": [
58-
"import os\n",
5959
"import numpy as np\n",
6060
"from matplotlib import pyplot\n",
6161
"from scipy.interpolate import interp1d\n",

examples/PySDM_examples/Abdul_Razzak_Ghan_2000/fig_4_kinetic_limitations.ipynb

Lines changed: 33 additions & 106 deletions
Large diffs are not rendered by default.

examples/PySDM_examples/Abdul_Razzak_Ghan_2000/figs1-5.ipynb

Lines changed: 9887 additions & 32 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)