Skip to content

Commit d935147

Browse files
Add icon4pytools (#206)
Introduces the icon4pytools package. This package contains all icon4py (blue line) related tooling and CLIs such as: - liskov - icon4pygen - f2ser Co-authored-by: Enrique G. Paredes <18477+egparedes@users.noreply.github.com>
1 parent 69248f1 commit d935147

File tree

248 files changed

+2111
-1363
lines changed

Some content is hidden

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

248 files changed

+2111
-1363
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ rst-roles =
4242
py:obj, obj,
4343

4444
per-file-ignores =
45-
pyutils/src/icon4py/icon4pygen/icochainsize.py:E800
45+
tools/src/icon4pytools/icon4pygen/icochainsize.py:E800
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: Quality Assurance
1+
name: ICON4Py Quality Assurance
22

33
on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- "tools/**"
79
pull_request:
810
branches:
911
- main
@@ -29,4 +31,4 @@ jobs:
2931
- name: Run checks
3032
run: |
3133
python -m pip list
32-
pre-commit run --all-files
34+
pre-commit run --config .pre-commit-config.yaml --all-files
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: Tox
1+
name: ICON4Py Tox
22

33
on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- "tools/**"
79
pull_request:
810
branches:
911
- main
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ICON4PyTools Quality Assurance
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "tools/**"
9+
- "base-requirements*"
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
pre-commit:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: "3.10"
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip setuptools wheel
26+
python -m pip install -r ./requirements-dev.txt
27+
- name: Run checks
28+
run: |
29+
python -m pip list
30+
pre-commit run --config tools/.pre-commit-config.yaml --all-files
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: ICON4PyTools Tox
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "tools/**"
9+
- "base-requirements*"
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
tox-tests:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.10"]
20+
defaults:
21+
run:
22+
working-directory: tools
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Install boost
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install libboost-all-dev
31+
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install python dependencies
38+
run: |
39+
python -m pip install --upgrade pip setuptools wheel
40+
41+
- name: Test with tox
42+
run: |
43+
pyversion_no_dot="${{ matrix.python-version }}"
44+
pyversion_no_dot="${pyversion_no_dot/./}"
45+
pip install tox clang-format
46+
tox -r -e py${pyversion_no_dot}
47+
48+
- name: Archive code coverage results
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: code-coverage-report
52+
path: _reports/coverage_html/

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ default_language_version:
55
# Remove frozen version once we migrated away from tsa
66
node: 17.9.1
77
minimum_pre_commit_version: 2.20.0
8+
exclude: "tools/.*"
89

910
repos:
1011
- repo: meta
@@ -35,9 +36,6 @@ repos:
3536
- id: destroyed-symlinks
3637
# - id: fix-encoding-pragma
3738
# args: [--remove]
38-
- id: name-tests-test
39-
args: [--pytest-test-first]
40-
exclude: ^liskov/tests/samples
4139

4240
- repo: https://gitlab.com/bmares/check-json5
4341
rev: v1.0.0
@@ -117,16 +115,14 @@ repos:
117115
- flake8-docstrings
118116
- flake8-eradicate
119117
- flake8-mutable
120-
# Disabled for now due to random false positives
121-
# - flake8-rst-docstrings
122118
- pygments
123119

124120
- repo: local
125121
hooks:
126122
- id: mypy
127123
name: mypy static type checker
128124
entry: |
129-
mypy --install-types --non-interactive -p icon4py.common -p icon4py.icon4pygen -p icon4py.testutils
125+
mypy --install-types --non-interactive -p icon4py.common
130126
language: system
131127
types_or: [python, pyi]
132128
always_run: true

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
## Description
66

7-
ICON4Py contains Python (GT4Py) implementations of ICON (inspired) components for weather and climate models.
7+
ICON4Py contains Python (GT4Py) implementations of ICON (inspired) components for weather and climate models as well as `icon4pytools`, a package containing CLIs and utilties needed for the integration of ICON4Py code into the ICON Fortran model.
88

99
## Project structure
1010

11-
Each directory contains Python packages of ICON components or utility packages that are deployable on its own. As these packages are not available from a package repository (yet), location of dependencies within this repository have to be provided explicitly, e.g. by installing the dependencies first. See [Installation instructions](#installation-instructions).
11+
Each directory contains Python packages of ICON components or utility packages that are deployable on their own. As these packages are not available from a package repository (yet), location of dependencies within this repository have to be provided explicitly, e.g. by installing the dependencies first. See [Installation instructions](#installation-instructions).
1212

1313
## Installation instructions
1414

@@ -70,8 +70,11 @@ source .venv/bin/activate
7070
pip install --upgrade wheel
7171

7272
# Install a specific ICON4Py subpackage and its dependencies
73-
cd _SUBPACKAGE_ # where _SUBPACKAGE_ in atm_dyn_iconam | common | icon4pygen | testutils | ...
73+
cd _SUBPACKAGE_ # where _SUBPACKAGE_ in atm_dyn_iconam | tools | ...
7474
pip install -r requirements-dev.txt
75+
76+
# or in the case of there being a pyproject.toml file
77+
pip install .
7578
```
7679

7780
## Development instructions

liskov/src/icon4py/liskov/codegen/integration/__init__.py renamed to atm_dyn_iconam/__init__.py

File renamed without changes.

atm_dyn_iconam/src/icon4py/atm_dyn_iconam/apply_nabla2_and_nabla4_to_vn.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# distribution for a copy of the license or check <https://www.gnu.org/licenses/>.
1111
#
1212
# SPDX-License-Identifier: GPL-3.0-or-later
13-
1413
from gt4py.next.ffront.decorator import field_operator, program
1514
from gt4py.next.ffront.fbuiltins import Field, maximum
1615

atm_dyn_iconam/src/icon4py/atm_dyn_iconam/apply_nabla2_to_vn_in_lateral_boundary.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# distribution for a copy of the license or check <https://www.gnu.org/licenses/>.
1111
#
1212
# SPDX-License-Identifier: GPL-3.0-or-later
13-
1413
from gt4py.next.ffront.decorator import field_operator, program
1514
from gt4py.next.ffront.fbuiltins import Field
1615

0 commit comments

Comments
 (0)