Skip to content
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

Merge greenline to main #260

Merged
merged 299 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
b5496b7
fix loading of savepoint_exit
halungge Jan 10, 2023
34fa770
add a test skeleton that runs 5 setup, init_step and 5 timesteps
halungge Jan 10, 2023
a67ac7c
Merge branch 'main' into diffusion_granule
halungge Jan 10, 2023
cecf181
move field_operators and programs to utils.py
halungge Jan 10, 2023
6c6ec36
- add output domain args to fused stencil programs
halungge Jan 11, 2023
a0007e7
fix pre-commit issues
halungge Jan 12, 2023
b49aa41
remove serialbox workaround
halungge Jan 17, 2023
14335e1
add boost to workflow runner
halungge Jan 17, 2023
79272cc
fix tox.ini: wrong naming of datatest marker
halungge Jan 17, 2023
ee6dfe1
switch to pathlib when loading serialbox data
halungge Jan 19, 2023
1e00c05
First version of fused diffusion stencils
muellch Nov 24, 2022
2abd8b9
Added prototype of fused_mo_nh_diffusion_stencil_01_02_03_rbf
muellch Nov 29, 2022
ee4e21e
Removed duplicate stencil definition from fused stencil 13 and 14
muellch Dec 7, 2022
381be77
Cleanup
muellch Jan 20, 2023
f5ad668
Cleanup
muellch Jan 23, 2023
ae10ca2
Change includes, remove 01_02_03_rbf from tox tests
muellch Jan 23, 2023
aa291b3
rename files containt prognostic and diagnostic state.
halungge Jan 25, 2023
97ee683
- disentangle grid and vertical params from config
halungge Jan 25, 2023
40de762
add params to diffusion init
halungge Jan 26, 2023
df0c927
merge from main
halungge Jan 26, 2023
8a77b1a
Merge branch 'main' into fused_diffusion_stencils
halungge Feb 1, 2023
f30f1b0
use renamed diffusion stencils in fused stencils
halungge Feb 1, 2023
0ad39e1
mergeing from fused_diffusion_stencils
halungge Feb 1, 2023
1bf3381
cleanup: revert to ICON naming for prognistic winds
halungge Feb 1, 2023
7e2e107
add cffi decorator
halungge Feb 1, 2023
0b68cae
add c header and fortran generation for wrapper functions
halungge Feb 3, 2023
5d62a62
add cffi library generation (version 1)
halungge Feb 3, 2023
b1c814e
add missing dimension to fortran interface
halungge Feb 3, 2023
9ab3cf5
add target keyword for scalar params in generated fortran interface
halungge Feb 3, 2023
196275b
register functions for generation
halungge Feb 6, 2023
af499c2
move f90 interface wrappers to its own package.
halungge Feb 8, 2023
7ec67dc
merge from main
halungge Feb 16, 2023
796843e
- fix import of gt4py merge of main and functional
halungge Feb 16, 2023
7a62010
adapt serialbox_utils.py and fixtures to new structure of serialized …
halungge Feb 23, 2023
35abecc
run get damping height index from correct location
halungge Feb 23, 2023
601dbca
merge from main
halungge Mar 2, 2023
00408e0
Fix diffusion tests (#169)
halungge Mar 2, 2023
95fe3da
fix renamings from upstream merge
halungge Mar 2, 2023
be5560d
fix qa
halungge Mar 2, 2023
b0f142b
add first version of grid manager reading netcdf file
halungge Mar 23, 2023
0af0bd7
- isolate index transform in special class,
halungge Mar 24, 2023
0ae5571
- boundary conditions handling WIP (1)
halungge Mar 28, 2023
72e6e45
add missing dimension
halungge Mar 30, 2023
8c92a13
wrong interpretation of icon short names: rename lb=lateral_boundary
halungge Mar 30, 2023
f77dc90
wrong interpretation of icon short names: rename lb=lateral_boundary
halungge Apr 4, 2023
d36b3e4
fix index field tests (revert the last valid index workaround for ser…
halungge Apr 4, 2023
f0c1fef
fix typo, add function in gridsavepoint to get number of fields
halungge Apr 4, 2023
38e74f5
test dimensions against serialized data
halungge Apr 4, 2023
ddd6b76
- move commonly used fixtures to testutils
halungge Apr 11, 2023
5046491
use grid file everywhere in test_diffusion
halungge Apr 12, 2023
4385eb5
- change interface of icon_grid.py: get_startindex, get_endindex inst…
halungge Apr 13, 2023
3a2ee48
Dummy dycore driver (#174)
halungge Apr 27, 2023
583100c
- fix test after moving: vertical_config out of vertical model parame…
halungge May 1, 2023
cbaa350
add return value type to get_start/end_index
halungge May 3, 2023
6d26b85
Merge main into greenline dycore (#201)
halungge May 3, 2023
b6950de
Back to gt4py main (#202)
halungge May 5, 2023
38cfad6
merge in greenline-dycore, fix imports
halungge May 15, 2023
99931bc
fix typo in naming
halungge May 16, 2023
6eee9a2
rename diffusion.timestep to run
halungge May 23, 2023
ccc9a28
merge main
halungge May 23, 2023
9f0aebe
add mo_nh_diffusion_stencil_15 to the diffusion.py and diffusion_prog…
halungge May 24, 2023
77eafbb
downgrade typing-extensions
halungge May 24, 2023
6740747
(refactoring): rename local_boundary to lateral_boundary
halungge May 25, 2023
88dbc74
(fix) renable test in icon4pygen
halungge May 25, 2023
dfb15f4
merge from main
halungge May 25, 2023
9bcd4e9
- add mpi4py dependency
halungge May 26, 2023
3e786a4
read in decomposition data (WIP 1)
halungge May 26, 2023
900d381
add return types in icon_grid.py
halungge May 30, 2023
18abe03
(fix/refactor)
halungge May 30, 2023
bcccb0c
pre-commit fixes
halungge May 30, 2023
7926408
skip tests that fail due changed data
halungge May 30, 2023
0ea7df7
pre-commit fixes
halungge May 30, 2023
4782b23
add decomposition info to driver
halungge May 31, 2023
8443e84
fix local path
halungge May 31, 2023
b62e931
- adapt diffusion.py to the structure of recently serialized data.
halungge May 31, 2023
5517258
remove `backend=..` specification from program definitions and use `.…
halungge May 31, 2023
95a9f8c
Merge branch 'adapt_diffusion_to_new_serdata_structure' into greenlin…
halungge May 31, 2023
bbae06c
fix decomposition test for run on 2 procs
halungge Jun 1, 2023
8fe58ea
clean up tests (I)
halungge Jun 2, 2023
93d1148
Merge branch 'greenline-dycore' into greenline_diffusion_verification
halungge Jun 2, 2023
119b145
Merge branch 'adapt_diffusion_to_new_serdata_structure' into greenlin…
halungge Jun 2, 2023
62579a5
- fix usage of stencil_15
halungge Jun 2, 2023
18a643b
add missing fields to IconDiffusionExitSavepoint
halungge Jun 2, 2023
024ecff
- adapt diffusion.py to the structure of recently serialized data. (#…
halungge Jun 6, 2023
2d5febc
verifying up to theta_v and exner
halungge Jun 6, 2023
e994ab3
add validation of theta_v and exner
halungge Jun 7, 2023
d56de30
rename metrics state zd_vertidx fields
halungge Jun 7, 2023
f5df461
fix unit tests of stencils that now take offset args
halungge Jun 7, 2023
040d986
refactoring in horizontal.py
halungge Jun 7, 2023
eaa8382
verify theta_v and exner only for non steep points
halungge Jun 7, 2023
1897328
- verification of theta_v and exner: separate steep and flat points
halungge Jun 8, 2023
ee4e3cd
pre-commit hook
halungge Jun 8, 2023
2885fe5
(fix) icon has origin at first place in C2E2CO (#223)
halungge Jun 8, 2023
576d381
remove program,
halungge Jun 8, 2023
fb0eca7
add numpy test to check transformation of geofac_n2s_nbh (1d sparse f…
halungge Jun 9, 2023
4a23b09
merge from main
halungge Jun 9, 2023
91bbd9c
merge from greenline-dycore
halungge Jun 9, 2023
3909ef3
switch to renamed fused stencils and remove unused files
halungge Jun 9, 2023
ef67246
unify usage of geofac_div within diffusion.py: switch to 1d sparse fi…
halungge Jun 9, 2023
8eb34e3
merge from greenline_diffusion_verification
halungge Jun 13, 2023
5366e94
pre-commit fixes
halungge Jun 13, 2023
d4393db
fix (local) data path
halungge Jun 13, 2023
7a0b0f3
setup exchange properties
halungge Jun 14, 2023
9189563
field descriptors for k and k+1 fields
halungge Jun 15, 2023
11aab95
can do exchanges except for cells...
halungge Jun 15, 2023
2aa01b0
try to understand out, when it crashes...
halungge Jun 16, 2023
668b443
pre construct ghex communicators for each pattern
halungge Jun 16, 2023
6cbd6b0
use int32 instead of unqualified int in domain args
halungge Jun 16, 2023
7f7c38b
greenline_fix_remove_int_type
halungge Jun 16, 2023
505355c
fixes after merge of fix_greenline_remove_int_type
halungge Jun 16, 2023
e473cff
add wait after exchange call (follow up later)
halungge Jun 16, 2023
7b853d5
read exit data for verification
halungge Jun 16, 2023
396936e
use int32 instead of unqualified int in domain args (#231)
halungge Jun 20, 2023
86e31a1
- introduce _HALO_XX == min_rlxx_int -1 and _LOCAL_XX == min_rlxx_int…
halungge Jun 20, 2023
20d0837
merge greenline_dycore
halungge Jun 20, 2023
e6bafb8
adding comments from discussion with Fabian
halungge Jun 20, 2023
4228ac6
udpate of ghex:
halungge Jun 20, 2023
0787dba
fix validation of stencil 15
halungge Jun 26, 2023
1ad86bc
merge icon4py main
halungge Jun 27, 2023
5b7220e
merge icon4py main
halungge Jun 28, 2023
238b469
refactor tests
halungge Jun 29, 2023
8a9ac49
switch back to fused stencil 07, 08, 09, 10
halungge Jun 29, 2023
90b3bd8
unify construction of NeighborTableOffsetProviders for 1D sparse fields
halungge Jun 29, 2023
d61eec7
remove unused param
halungge Jun 29, 2023
4681057
fix dummy_driver to manually import testutils
halungge Jun 29, 2023
a5dc646
fix some todos
halungge Jun 29, 2023
dc58678
change diffusion interface: pass geometry fields to init
halungge Jun 29, 2023
b0cf692
make setup_icon_data test for specific datafolder
halungge Jun 30, 2023
860a818
merge diffusion verification branch
halungge Jun 30, 2023
1354599
move parallel_setup.py
halungge Jun 30, 2023
07de07d
readme for ghex build
halungge Jun 30, 2023
1c9d8c0
fix diffusion calls in test_parallel_setup.py
halungge Jun 30, 2023
c719af4
Greenline diffusion verification (#232)
halungge Jun 30, 2023
11b3466
(fix) datatests:
halungge Jun 30, 2023
254d8ac
(fix) need boost if we want to build serialbox
halungge Jun 30, 2023
c9b6b96
(fix) remove erroneous changes in tools.
halungge Jun 30, 2023
6b8bcb6
(fix) remove erroneous changes in tools.
halungge Jun 30, 2023
e7d9e38
(fix) remove dimensions from offset providers list
halungge Jun 30, 2023
adf0b44
(fix) ignore common and py2f in tools pre-commit config for now.
halungge Jun 30, 2023
5710554
remove duplicated global stencil
halungge Jul 7, 2023
364ef8f
convert staticmethod to module level function
halungge Jul 7, 2023
17cd073
make DiffusionParams a frozen data class
halungge Jul 7, 2023
9ac647f
TODO format
halungge Jul 11, 2023
53f07c3
Merge branch 'main' into greenline-dycore
halungge Jul 11, 2023
61aeefa
use dict instead of switch case to lookup marker indices
halungge Jul 11, 2023
c03be01
convert mesh config classes to dataclasses
halungge Jul 11, 2023
feb22bb
use functools.cached_property for geofac fields
halungge Jul 11, 2023
5f9fbc1
added TODO for import of testutils
halungge Jul 11, 2023
6776d12
fixes in io_utils.py: type annotations, docstrings
halungge Jul 11, 2023
3542e36
- remove Annotated type from constants.py
halungge Jul 11, 2023
eb2bd5b
- introduce diffusiontype enum
halungge Jul 12, 2023
4f2b6df
- remove set_zero calls for u_vert and v_vert
halungge Jul 12, 2023
de2c6df
merge together the state modules
halungge Jul 13, 2023
8efae75
clean up tests:
halungge Jul 13, 2023
74c1736
make DiffusionConfig.substep_as_float a property
halungge Jul 13, 2023
c4f75a9
fix test_diffusion.py
halungge Jul 13, 2023
4be42a7
merge greenline_dycore
halungge Jul 13, 2023
1229b6d
merge greenline_dycore
halungge Jul 14, 2023
4b84d83
diffusion for non limited area runs (#241)
halungge Jul 14, 2023
88e304e
- remove unused stencil
halungge Jul 14, 2023
3d5c29e
add vertical.py
halungge Jul 18, 2023
6a11229
add deprecation decorator icon_grid.get_indices_from_to
halungge Jul 18, 2023
f6c5455
pre-commit fixes
halungge Jul 18, 2023
c2bd20b
Merge branch 'main' into greenline-dycore
halungge Jul 19, 2023
abfd262
fix - consolidate location of test data
halungge Jul 19, 2023
abd640c
fix - enable test with updated ser. data
halungge Jul 19, 2023
fc634a3
fix - pre-commit warnings
halungge Jul 19, 2023
524e2e7
fix - remove unused code
halungge Jul 19, 2023
1228082
use grid.get_start_index grid.get_end_index in diffusion
halungge Jul 19, 2023
855113e
remove direct accessor functions for fields from grid manager
halungge Jul 19, 2023
e265a2f
merge grid manager branch
halungge Jul 20, 2023
04cee47
add netcdf4 to requirements-dev.txt
halungge Jul 20, 2023
6d9cca9
- rename functions in grid_manager.py
halungge Jul 20, 2023
b341ff0
merge greenline_dycore and fix tests
halungge Jul 20, 2023
7f00d46
- reduce serialized fields to actual grid size when reading
halungge Jul 25, 2023
b196b06
fix (1) debugging
halungge Jul 25, 2023
a7a4a34
fix (2) work around for ghex seg faults: keep field reference passed …
halungge Jul 26, 2023
d46b2c9
fix (3) remove old communication calls.
halungge Jul 26, 2023
ce3f771
verify parallel diffusion: initial and regular step
halungge Jul 26, 2023
2c6998f
add test for domain_descriptor id
halungge Jul 26, 2023
3406090
combine exchange and field_descriptors
halungge Jul 27, 2023
d1487cf
make serial code run again
halungge Jul 27, 2023
08b8e10
clean ups
halungge Jul 27, 2023
9f2530b
clean up tests
halungge Aug 2, 2023
8186de5
clean up tests
halungge Aug 2, 2023
fcf4519
fix dummy driver to run with MPI
halungge Aug 2, 2023
b919cc2
add download_data fixture for parallel tests
halungge Aug 2, 2023
9205783
move ghex context creation inside MultiNodeRuntime
halungge Aug 3, 2023
e8e877e
remove duplicate URIs
halungge Aug 3, 2023
20be71d
fixes:
halungge Aug 3, 2023
66e49c3
remove unnecessary f-strings
halungge Aug 3, 2023
a1b9490
(fix) import correct path from fixtures to common.py
halungge Aug 8, 2023
84a99e0
calculation of c_lin_e (#254)
ajocksch Aug 8, 2023
e544e04
- add testdata and generated netcdf fields to git ignore.
halungge Aug 8, 2023
b26db2b
state classes used in diffusion: rename files and classes
halungge Aug 8, 2023
ad12a8d
move helper functions for timestepping to dycore_driver.py
halungge Aug 8, 2023
46d60d1
merge from greenline-dycore
halungge Aug 8, 2023
2a0b93d
(fix) wrong dimension when reading field
halungge Aug 8, 2023
ed98b17
add pyghex to dependencies
halungge Aug 15, 2023
5211c82
convert ParallelProperties to dataclass
halungge Aug 15, 2023
af43e4a
Merge branch 'greenline-dycore' into greenline_diffusion_halo_exchange
halungge Aug 15, 2023
6da81ba
(fix) create GHex context without external MPIComm
halungge Aug 15, 2023
9e5101a
update README.md for parallel tests.
halungge Aug 17, 2023
1bf110b
add pyGHEX to base-requirements.txt
halungge Aug 17, 2023
6f28f8a
pre-commit fixes
halungge Aug 18, 2023
07e650b
pre-commit fixes
halungge Aug 18, 2023
0a801bb
add missing pyty library
halungge Aug 18, 2023
ae019ea
merge from greenline-dycore
halungge Aug 18, 2023
ccaf1ba
(temporarily) instantiate ghex context without passing external commu…
halungge Aug 18, 2023
7b880a8
remove instantiate ghex context without passing external communicator
halungge Aug 18, 2023
cda453f
remove instantiate ghex context without passing external communicator
halungge Aug 18, 2023
a1a1752
merge from main and move some files to existing packages
halungge Aug 18, 2023
4fa333c
moving diffusion code into diffusion namespace package
halungge Aug 18, 2023
cb6dffc
fix icon4py/tools unit tests
halungge Aug 22, 2023
ca92178
move driver code to its own package
halungge Aug 22, 2023
468fc21
move field_managemange to common
halungge Aug 22, 2023
de5c6ef
consolidate fixtures
halungge Aug 23, 2023
5fc58b6
move grid related fixtures to common/conftest.py
halungge Aug 23, 2023
5b9211b
rename diffusion/tests to diffusion/diffusion_tests
halungge Aug 24, 2023
6ed055a
pre-commit config
halungge Aug 24, 2023
c92ff0c
pre-commit on model
halungge Aug 24, 2023
5648609
tox.ini - exclude datatest marker
halungge Aug 24, 2023
b129b34
move py2f to tools
halungge Aug 24, 2023
226657b
update README.md files
halungge Aug 24, 2023
a8c41f3
pre-commit fixes
halungge Aug 24, 2023
bce21ee
simple cleanups
halungge Aug 25, 2023
9200088
merge from main
halungge Aug 25, 2023
2d858af
(fix) move interpolation stencil to common package
halungge Aug 25, 2023
d8b9090
switch to GHEX main.
halungge Aug 29, 2023
ee81975
Update model/driver/README.md
halungge Aug 31, 2023
d4e0bee
Update tools/src/icon4pytools/py2f/cffi_utils.py
halungge Aug 31, 2023
3ac39f9
PR review fixes:
halungge Aug 31, 2023
9da77fe
resolve conflicts from main
halungge Aug 31, 2023
419f7eb
fix interpolation stencils path in liskov
halungge Sep 4, 2023
9230345
add pre-commit and flake8 config from main to new packages
halungge Sep 5, 2023
ad9eb64
reformat common package
halungge Sep 5, 2023
e66e9ec
merge main
halungge Sep 5, 2023
75e9766
pre-commit on common
halungge Sep 5, 2023
9d0a358
pre-commit on dycore
halungge Sep 5, 2023
64a9154
pre-commit on tools
halungge Sep 5, 2023
6951c73
fix order of arguments in apply_diffusion_to_vn.py since it creates p…
halungge Sep 6, 2023
d39748a
review fixes
halungge Sep 6, 2023
23eb9ff
fix yesqa configuration to work with flake8 for A003
halungge Sep 6, 2023
9f8d5a7
add icon4py.atmosphere.diffusion and icon4py.driver to the icon4py-qa…
halungge Sep 6, 2023
d60e4f5
icon4py-qa.yml install boost
halungge Sep 6, 2023
acae8aa
fix wrong path in requirements-dev.txt of model/driver
halungge Sep 6, 2023
9ac623f
combine pre-commit runs of all model packages in one job
halungge Sep 6, 2023
393b7c2
remove unnecessary test file
halungge Sep 8, 2023
c6d8bfb
fix: register custom marker in tox.ini
halungge Sep 8, 2023
9713364
add command line option for running datatest
halungge Sep 10, 2023
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
36 changes: 13 additions & 23 deletions .github/workflows/icon4py-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ on:
types: [submitted]

jobs:
pre-commit-icon4py-model-common:
pre-commit-icon4py-model:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install libboost-all-dev
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -36,36 +40,22 @@ jobs:
**/base-requirements-dev.txt
**/requirements.txt
**/requirements-dev.txt
- name: Install icon4py-common
working-directory: model/common
- name: Install icon4py-model packages
working-directory: model
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r ./requirements-dev.txt
python -m pip list
- name: Run checks icon4py-model-common
run: |
pre-commit run --config model/common/.pre-commit-config.yaml --all-files

pre-commit-icon4py-model-atmosphere-dycore:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: |
**/pyproject.toml
**/base-requirements.txt
**/base-requirements-dev.txt
**/requirements.txt
**/requirements-dev.txt
- name: Install icon4py-model-atmosphere-dycore
working-directory: model/atmosphere/dycore
- name: Run checks icon4py-model-driver
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r ./requirements-dev.txt
pre-commit run --config model/driver/.pre-commit-config.yaml --all-files
- name: Run checks icon4py-model-atmosphere-dycore
run: |
pre-commit run --config model/atmosphere/dycore/.pre-commit-config.yaml --all-files
- name: Run checks icon4py-model-atmosphere-diffusion
run: |
pre-commit run --config model/atmosphere/diffusion/.pre-commit-config.yaml --all-files

4 changes: 4 additions & 0 deletions .github/workflows/icon4pytools-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install boost
run: |
sudo apt-get update
sudo apt-get install libboost-all-dev
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ _local
_external_src
_reports
tmp
testdata
simple_mesh*.nc

### GT4Py ####
.gt_cache/
Expand Down
5 changes: 5 additions & 0 deletions base-requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# VCS
-e git+https://github.com/GridTools/gt4py.git@main#egg=gt4py
git+https://github.com/GridTools/serialbox#egg=serialbox&subdirectory=src/serialbox-python
git+https://github.com/ghex-org/GHEX.git#subdirectory=bindings/python

# PyPI
bump2version>=1.0.1
Expand All @@ -13,13 +15,16 @@ flake8-eradicate>=1.3.0
flake8-mutable>=1.2.0
isort~=5.10
mypy>=0.942
typing-extensions==4.5.0
pre-commit~=2.15
pytest>=6.1
pytest-benchmark>=4.0.0
pytest-cache>=1.0
pytest-cov>=2.8
pytest-factoryboy>=2.0
pytest-xdist[psutil]>=2.2
pytest-mpi>=0.6
setuptools>=40.8.0
wheel>=0.37.1
tox >= 3.25
wget>=3.2
1 change: 1 addition & 0 deletions base-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# VCS
gt4py @ git+https://github.com/GridTools/gt4py.git@main
pyghex @ git+https://github.com/boeschf/GHEX.git@pipify#subdirectory=bindings/python
46 changes: 46 additions & 0 deletions model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ This folder contains Python implementations for multiple ICON components.
It includes the following packages:

- `atmosphere/dycore`: Contains implementations of the dynamical core of the ICON model
- `atmosphere/diffusion`: Contains the implementation of diffusion in the ICON model
- `common`: Contains shared functionality that is required by multiple components.
- `driver`: Contains the driving code for the model

## Installation Instructions

Expand All @@ -22,3 +24,47 @@ pip install -r requirements-dev.txt
```

**Note**: For more information specific to each component, please refer to the README in their respective subfolders.

### Testing

See the repository [README](../README.md) for general information.

#### Data dependent tests

Some test depend on serialized data generated by a full model run.
Those test are marked with `pytest.mark.datatest` and are only run when the `--datatest`
option is specified. Note that due to `pytests` configuration discovery
you need to specify the base a package directory i.e. one that contains a `pyproject.toml` for the
commandline option to work.

```bash

pytest -v --datatest model/common
pytest -v --datatest model/atmosphere/diffusion
```

#### Testing parallel code

Tests for parallel codes using MPI are collected in specific subpackages of the model components test folders (e.g. `diffusion_tests/mpi_tests`). All parallel tests are marked with `@pytest.mark.mpi` and are skipped if the `--with-mpi` is not passed option is not passed to `pytest` In order to run them, you need a MPI installation on your system: On Debian-Linux do

```bash
sudo apt-get install libopenmpi-dev
```

or

```bash
sudo apt-get install mpich
```

on MacOs

```bash
brew install mpich
```

Then you can run the tests with

```bash
mpirun -np 2 pytest -v -s --with-mpi path/to/test/folder/mpi_tests
```
10 changes: 10 additions & 0 deletions model/atmosphere/diffusion/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[bumpversion]
current_version = 0.0.6
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?
serialize =
{major}.{minor}.{patch}

[bumpversion:file:src/icon4py/model/atmosphere/diffusion/__init__.py]
parse = \"(?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?\"
serialize =
{major}.{minor}.{patch}
42 changes: 42 additions & 0 deletions model/atmosphere/diffusion/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[flake8]
# Some sane defaults for the code style checker flake8
max-line-length = 100
max-complexity = 15
doctests = true
extend-ignore =
# Do not perform function calls in argument defaults
B008,
# Public code object needs docstring
D1,
# Disable dargling errors by default
DAR,
# Whitespace before ':' (black formatter breaks this sometimes)
E203,
# Line too long (using Bugbear's B950 warning)
E501,
# Line break occurred before a binary operator
W503

exclude =
.eggs,
.gt_cache,
.ipynb_checkpoints,
.tox,
_local_,
build,
dist,
docs,
_external_src,
tests/_disabled,
setup.py

rst-roles =
py:mod, mod,
py:func, func,
py:data, data,
py:const, const,
py:class, class,
py:meth, meth,
py:attr, attr,
py:exc, exc,
py:obj, obj,
114 changes: 114 additions & 0 deletions model/atmosphere/diffusion/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# NOTE: pre-commit runs all hooks from the root folder of the repository,
# as regular git hooks do. Therefore, paths passed as arguments to the plugins
# should always be relative to the root folder.

default_stages: [commit, push]
default_language_version:
python: python3.10
minimum_pre_commit_version: 2.20.0
files: "model/atmosphere/diffusion/.*"

repos:
- repo: meta
hooks:
- id: check-hooks-apply
stages: [manual]
- id: check-useless-excludes
stages: [manual]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
# Run only manually because it deletes comments
- id: setup-cfg-fmt
name: format setup.cfg
stages: [manual]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.6.0
hooks:
- id: pretty-format-ini
args: [--autofix]
- id: pretty-format-toml
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes, --indent, "2"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
hooks:
- id: prettier
types_or: [markdown, json]

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.0
hooks:
- id: insert-license
name: add license for all ICON4Py Python source files
types: [python]
args: [--comment-style, "|#|", --license-filepath, model/.license_header.txt, --fuzzy-match-generates-todo]

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa

- repo: https://github.com/psf/black
rev: '22.3.0'
hooks:
- id: black
name: black Python formatter
args: [--config, model/atmosphere/diffusion/pyproject.toml]

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
name: black Python formatter for docstrings
additional_dependencies: [black==22.3.0]

- repo: https://github.com/PyCQA/isort
rev: '5.12.0'
hooks:
- id: isort
args: [--config-root, model/atmosphere/diffusion/, --resolve-all-configs]

- repo: https://github.com/PyCQA/flake8
rev: '4.0.1'
hooks:
- id: flake8
name: flake8 code style checks
additional_dependencies:
- darglint
- flake8-bugbear
- flake8-builtins
- flake8-debugger
- flake8-docstrings
- flake8-eradicate
- flake8-mutable
- pygments
args: [--config=model/atmosphere/diffusion/.flake8, model/atmosphere/diffusion/src/icon4py/]

- repo: local
hooks:
- id: mypy
name: mypy static type checker
entry: bash -c 'echo mypy temporarily disabled'
#entry: bash -c 'cd model/atmosphere/dycore; mypy src/' --
language: system
types_or: [python, pyi]
always_run: true
#pass_filenames: false
require_serial: true
stages: [commit]
9 changes: 9 additions & 0 deletions model/atmosphere/diffusion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# icon4py-atmosphere-diffusion

## Description

Python port of ICON diffusion module.

## Installation instructions

Check the `README.md` at the root of the `model` folder for installation instructions.
12 changes: 12 additions & 0 deletions model/atmosphere/diffusion/diffusion_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ICON4Py - ICON inspired code in Python and GT4Py
#
# Copyright (c) 2022, ETH Zurich and MeteoSwiss
# All rights reserved.
#
# This file is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or any later
# version. See the LICENSE.txt file at the top-level directory of this
# distribution for a copy of the license or check <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later
Loading