Skip to content

Commit e9e56a4

Browse files
Rendering at wradlib-notebooks commit 547bdff for wradlib version
0 parents  commit e9e56a4

File tree

82 files changed

+198210
-0
lines changed

Some content is hidden

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

82 files changed

+198210
-0
lines changed

.github/workflows/main.yml

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
name: CI
2+
env:
3+
micromamba_version: 1.5
4+
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build_0:
20+
name: wradlib notebooks - linux
21+
runs-on: ubuntu-20.04
22+
defaults:
23+
run:
24+
shell: bash -l {0}
25+
env:
26+
WRADLIB_DATA: ./wradlib-data
27+
CONDA_ENV_FILE: ci/requirements/notebooks.yml
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
python-version: ["3.12"]
32+
steps:
33+
- uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
- name: Install micromamba environment
37+
uses: mamba-org/setup-micromamba@v1
38+
with:
39+
environment-name: wradlib-notebooks
40+
environment-file: ${{env.CONDA_ENV_FILE}}
41+
cache-environment: true
42+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
43+
create-args: >-
44+
python=${{matrix.python-version}}
45+
- name: Install wradlib
46+
run: |
47+
git clone https://github.com/wradlib/wradlib.git
48+
cd wradlib
49+
echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV
50+
python -m pip install . --no-deps
51+
- name: Install wradlib-data
52+
run: |
53+
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
54+
mkdir ./wradlib-data
55+
- name: Version Info
56+
run: |
57+
python -c "import wradlib; print(wradlib.version.version)"
58+
python -c "import wradlib; print(wradlib.show_versions())"
59+
- name: Render with pytest
60+
env:
61+
WRADLIB_EARTHDATA_BEARER_TOKEN: ${{ secrets.WRADLIB_EARTHDATA_BEARER_TOKEN }}
62+
run: |
63+
export WRADLIB_DATA=`realpath $WRADLIB_DATA`
64+
pytest -n auto --verbose --durations=15 --pyargs notebooks
65+
- name: Commit files
66+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
67+
run: |
68+
git config --global user.email "[email protected]"
69+
git config --global user.name "wradlib-docs-bot"
70+
git checkout --orphan render
71+
git add --all .
72+
git commit -m "Rendering at commit $GITHUB_SHA"
73+
- name: Push changes
74+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
75+
run: |
76+
if [ $WRADLIB_TAG == 'undefined' ]; then
77+
BRANCH=devel
78+
else
79+
BRANCH=$WRADLIB_TAG
80+
fi
81+
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/wradlib/wradlib-notebooks.git render:$BRANCH -fq
82+
83+
build_1:
84+
name: wradlib notebooks - macosx
85+
runs-on: macos-latest
86+
defaults:
87+
run:
88+
shell: bash -l {0}
89+
env:
90+
WRADLIB_DATA: ./wradlib-data
91+
CONDA_ENV_FILE: ci/requirements/notebooks.yml
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
python-version: ["3.12"]
96+
steps:
97+
- uses: actions/checkout@v3
98+
with:
99+
fetch-depth: 0
100+
- name: Install micromamba environment
101+
uses: mamba-org/setup-micromamba@v1
102+
with:
103+
environment-name: wradlib-notebooks
104+
environment-file: ${{env.CONDA_ENV_FILE}}
105+
cache-environment: true
106+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
107+
create-args: >-
108+
python=${{matrix.python-version}}
109+
- name: Install wradlib
110+
run: |
111+
git clone https://github.com/wradlib/wradlib.git
112+
cd wradlib
113+
echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV
114+
python -m pip install . --no-deps
115+
- name: Install wradlib-data
116+
run: |
117+
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
118+
mkdir ./wradlib-data
119+
- name: Version Info
120+
run: |
121+
python -c "import wradlib; print(wradlib.version.version)"
122+
python -c "import wradlib; print(wradlib.show_versions())"
123+
- name: Render with pytest
124+
env:
125+
WRADLIB_EARTHDATA_BEARER_TOKEN: ${{ secrets.WRADLIB_EARTHDATA_BEARER_TOKEN }}
126+
run: |
127+
export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA`
128+
pytest -n auto --verbose --durations=15 --pyargs notebooks
129+
130+
build_2:
131+
name: wradlib notebooks - windows
132+
runs-on: windows-latest
133+
defaults:
134+
run:
135+
shell: bash -l {0}
136+
env:
137+
WRADLIB_DATA: ./wradlib-data
138+
CONDA_ENV_FILE: ci/requirements/notebooks.yml
139+
strategy:
140+
fail-fast: false
141+
matrix:
142+
python-version: ["3.12"]
143+
steps:
144+
- uses: actions/checkout@v3
145+
with:
146+
fetch-depth: 0
147+
- name: Install micromamba environment
148+
uses: mamba-org/setup-micromamba@v1
149+
with:
150+
environment-name: wradlib-notebooks
151+
environment-file: ${{env.CONDA_ENV_FILE}}
152+
cache-environment: true
153+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
154+
create-args: >-
155+
python=${{matrix.python-version}}
156+
- name: Install wradlib
157+
run: |
158+
git clone https://github.com/wradlib/wradlib.git
159+
cd wradlib
160+
python -m pip install . --no-deps
161+
- name: Install wradlib-data
162+
run: |
163+
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
164+
mkdir ./wradlib-data
165+
- name: Version Info
166+
run: |
167+
python -c "import wradlib; print(wradlib.version.version)"
168+
python -c "import wradlib; print(wradlib.show_versions())"
169+
- name: Test with pytest
170+
env:
171+
WRADLIB_EARTHDATA_BEARER_TOKEN: ${{ secrets.WRADLIB_EARTHDATA_BEARER_TOKEN }}
172+
run: |
173+
export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA`
174+
pytest -n auto --verbose --durations=15 --pyargs notebooks
175+
176+
trigger_rtd:
177+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
178+
needs: [build_0]
179+
name: trigger readthedocs
180+
runs-on: ubuntu-latest
181+
defaults:
182+
run:
183+
shell: bash -l {0}
184+
env:
185+
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
186+
RTD_URL: ${{ secrets.RTD_URL }}
187+
steps:
188+
- name: trigger readthedocs
189+
run: |
190+
echo "triggering"
191+
curl -X POST -H "Authorization: Token $RTD_TOKEN" "$RTD_URL"

.github/workflows/render.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Render
2+
env:
3+
micromamba_version: 1.5
4+
5+
on:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build_0:
14+
name: wradlib notebooks - linux
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash -l {0}
19+
env:
20+
WRADLIB_DATA: ./wradlib-data
21+
CONDA_ENV_FILE: ci/requirements/notebooks.yml
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
python-version: ["3.12"]
26+
steps:
27+
- uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
- name: Install micromamba environment
31+
uses: mamba-org/setup-micromamba@v1
32+
with:
33+
environment-name: wradlib-notebooks
34+
environment-file: ${{env.CONDA_ENV_FILE}}
35+
cache-environment: true
36+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
37+
create-args: >-
38+
python=${{matrix.python-version}}
39+
- name: Install wradlib
40+
run: |
41+
git clone https://github.com/wradlib/wradlib.git
42+
cd wradlib
43+
echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV
44+
python -m pip install . --no-deps
45+
- name: Install wradlib-data
46+
run: |
47+
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
48+
mkdir ./wradlib-data
49+
- name: Version Info
50+
run: |
51+
python -c "import wradlib; print(wradlib.version.version)"
52+
python -c "import wradlib; print(wradlib.show_versions())"
53+
- name: Render with pytest
54+
run: |
55+
export WRADLIB_DATA=`realpath $WRADLIB_DATA`
56+
pytest -n auto --verbose --durations=15 --pyargs notebooks
57+
- name: Commit files
58+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
59+
run: |
60+
git config --global user.email "[email protected]"
61+
git config --global user.name "wradlib-docs-bot"
62+
git checkout --orphan render
63+
git add --all .
64+
git commit -m "Rendering at commit $GITHUB_SHA"
65+
- name: Push changes
66+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
67+
run: |
68+
if [ $WRADLIB_TAG == 'undefined' ]; then
69+
BRANCH=devel
70+
else
71+
BRANCH=$WRADLIB_TAG
72+
fi
73+
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/wradlib/wradlib-notebooks.git render:$BRANCH -fq
74+
75+
trigger_rtd:
76+
if: github.event_name == 'workflow_dispatch'
77+
needs: [build_0]
78+
name: trigger readthedocs
79+
runs-on: ubuntu-latest
80+
defaults:
81+
run:
82+
shell: bash -l {0}
83+
env:
84+
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
85+
RTD_URL: ${{ secrets.RTD_URL }}
86+
steps:
87+
- name: trigger readthedocs
88+
run: |
89+
echo "triggering"
90+
curl -X POST -H "Authorization: Token $RTD_TOKEN" "$RTD_URL"

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Ignore everything
2+
*
3+
4+
# whitelist notebooks, png and shell
5+
!*.ipynb
6+
!*.png
7+
!*.sh
8+
9+
# whitelist scripts
10+
!scripts/
11+
!/scripts/*
12+
13+
# whitelist notebooks
14+
!notebooks/
15+
#!/notebooks/**
16+
17+
# whitelist .dask
18+
!.dask/
19+
!/.dask/*
20+
21+
# whitelist ci
22+
!ci/
23+
24+
# whitelist binder
25+
!binder/
26+
!/binder/*
27+
28+
# Whitelist root files
29+
!.gitignore
30+
!conftest.py
31+
!README.md
32+
!LICENSE.txt
33+
!Welcome_Pangeo.md
34+
35+
# blacklist standard notebook copies
36+
*-Copy*.ipynb
37+
38+
# blacklist checkpoints
39+
*checkpoint*

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-docstring-first
8+
- id: check-json
9+
- id: check-yaml
10+
- id: debug-statements
11+
- id: mixed-line-ending
12+
- repo: https://github.com/asottile/pyupgrade
13+
rev: v3.3.1
14+
hooks:
15+
- id: pyupgrade
16+
args:
17+
- '--py38-plus'
18+
- repo: https://github.com/kynan/nbstripout
19+
rev: 0.6.1
20+
hooks:
21+
- id: nbstripout
22+
args: ['--extra-keys', 'metadata.kernelspec cell.metadata.pycharm cell.metadata.tags']
23+
- repo: https://github.com/charliermarsh/ruff-pre-commit
24+
rev: 'v0.0.254'
25+
hooks:
26+
- id: ruff
27+
args: [ "--fix" ]
28+
- repo: https://github.com/psf/black
29+
rev: 23.1.0
30+
hooks:
31+
- id: black
32+
- id: black-jupyter

LICENSE.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016-2021 wradlib developers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# README #
2+
3+
## wradlib-notebooks ##
4+
5+
This repository consists of jupyter notebooks to give examples of wradlib usage and help users via tutorials.
6+
7+
Rendered versions are available in the tagged branches. In [devel-branch](https://github.com/wradlib/wradlib-notebooks/tree/devel) the most recent rendered snapshot comprising the latest changes in this repo as well as [wradlib](https://github.com/wradlib/wradlib) can be found. The notebooks are also rendered in the [wradlib documentation](https://docs.wradlib.org/en/latest/).
8+
9+
Explore the contents - [Overview](notebooks/overview.ipynb).

0 commit comments

Comments
 (0)