Skip to content

Commit 4a7a9bb

Browse files
Rendering at wradlib-notebooks commit 7ab8658 for wradlib version
0 parents  commit 4a7a9bb

File tree

79 files changed

+263819
-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.

79 files changed

+263819
-0
lines changed

.github/workflows/main.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
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.11"]
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+
run: |
61+
export WRADLIB_DATA=`realpath $WRADLIB_DATA`
62+
pytest -n auto --verbose --durations=15 --pyargs notebooks
63+
- name: Commit files
64+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
65+
run: |
66+
git config --global user.email "[email protected]"
67+
git config --global user.name "wradlib-docs-bot"
68+
git checkout --orphan render
69+
git add --all .
70+
git commit -m "Rendering at commit $GITHUB_SHA"
71+
- name: Push changes
72+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
73+
run: |
74+
if [ $WRADLIB_TAG == 'undefined' ]; then
75+
BRANCH=devel
76+
else
77+
BRANCH=$WRADLIB_TAG
78+
fi
79+
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/wradlib/wradlib-notebooks.git render:$BRANCH -fq
80+
81+
build_1:
82+
name: wradlib notebooks - macosx
83+
runs-on: macos-latest
84+
defaults:
85+
run:
86+
shell: bash -l {0}
87+
env:
88+
WRADLIB_DATA: ./wradlib-data
89+
CONDA_ENV_FILE: ci/requirements/notebooks.yml
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
python-version: ["3.11"]
94+
steps:
95+
- uses: actions/checkout@v3
96+
with:
97+
fetch-depth: 0
98+
- name: Install micromamba environment
99+
uses: mamba-org/setup-micromamba@v1
100+
with:
101+
environment-name: wradlib-notebooks
102+
environment-file: ${{env.CONDA_ENV_FILE}}
103+
cache-environment: true
104+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
105+
create-args: >-
106+
python=${{matrix.python-version}}
107+
- name: Install wradlib
108+
run: |
109+
git clone https://github.com/wradlib/wradlib.git
110+
cd wradlib
111+
echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV
112+
python -m pip install . --no-deps
113+
- name: Install wradlib-data
114+
run: |
115+
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
116+
mkdir ./wradlib-data
117+
- name: Version Info
118+
run: |
119+
python -c "import wradlib; print(wradlib.version.version)"
120+
python -c "import wradlib; print(wradlib.show_versions())"
121+
- name: Render with pytest
122+
run: |
123+
export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA`
124+
pytest -n auto --verbose --durations=15 --pyargs notebooks
125+
build_2:
126+
name: wradlib notebooks - windows
127+
runs-on: windows-latest
128+
defaults:
129+
run:
130+
shell: bash -l {0}
131+
env:
132+
WRADLIB_DATA: ./wradlib-data
133+
CONDA_ENV_FILE: ci/requirements/notebooks.yml
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
python-version: ["3.11"]
138+
steps:
139+
- uses: actions/checkout@v3
140+
with:
141+
fetch-depth: 0
142+
- name: Install micromamba environment
143+
uses: mamba-org/setup-micromamba@v1
144+
with:
145+
environment-name: wradlib-notebooks
146+
environment-file: ${{env.CONDA_ENV_FILE}}
147+
cache-environment: true
148+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
149+
create-args: >-
150+
python=${{matrix.python-version}}
151+
- name: Install wradlib
152+
run: |
153+
git clone https://github.com/wradlib/wradlib.git
154+
cd wradlib
155+
python -m pip install . --no-deps
156+
- name: Install wradlib-data
157+
run: |
158+
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
159+
mkdir ./wradlib-data
160+
- name: Version Info
161+
run: |
162+
python -c "import wradlib; print(wradlib.version.version)"
163+
python -c "import wradlib; print(wradlib.show_versions())"
164+
- name: Test with pytest
165+
run: |
166+
export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA`
167+
pytest -n auto --verbose --durations=15 --pyargs notebooks
168+
169+
trigger_rtd:
170+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
171+
needs: [build_0]
172+
name: trigger readthedocs
173+
runs-on: ubuntu-latest
174+
defaults:
175+
run:
176+
shell: bash -l {0}
177+
env:
178+
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
179+
RTD_URL: ${{ secrets.RTD_URL }}
180+
steps:
181+
- name: trigger readthedocs
182+
run: |
183+
echo "triggering"
184+
curl -X POST -d "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.11"]
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 -d "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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
- [An incomplete introduction to python](notebooks/python/learnpython.ipynb)
10+
- [Getting started with wradlib](notebooks/basics/basics.ipynb)
11+
- [Data Input - Data Output](notebooks/fileio.ipynb)
12+
- [Attenuation correction](notebooks/attenuation/wradlib_attenuation.ipynb)
13+
- [Beam Blockage Calculation using DEM](notebooks/beamblockage/wradlib_beamblock.ipynb)
14+
- [Clutter and Echo Classification](notebooks/classify.ipynb)
15+
- [Georeferencing](notebooks/georeferencing.ipynb)
16+
- [Match spaceborn SR (GPM/TRRM) with ground radars GR](notebooks/match3d/wradlib_match_workflow.ipynb)
17+
- [Data Interpolation](notebooks/interpolation/wradlib_ipol_example.ipynb)
18+
- [Adjusting rainfall estimates by rain gauges](notebooks/multisensor/wradlib_adjust_example.ipynb)
19+
- [Verification for precipitation estimates](notebooks/verification/wradlib_verify_example.ipynb)
20+
- [Recipes](notebooks/recipes.ipynb)
21+
- [RADOLAN Composite](notebooks/fileio/radolan.ipynb)
22+
- [Zonal Statistics](notebooks/zonalstats/wradlib_zonalstats_classes.ipynb)

0 commit comments

Comments
 (0)