diff --git a/.github/workflows/icon4py-qa.yml b/.github/workflows/icon4py-qa.yml index 65cec9d877..18be464b94 100644 --- a/.github/workflows/icon4py-qa.yml +++ b/.github/workflows/icon4py-qa.yml @@ -21,26 +21,51 @@ on: types: [submitted] jobs: - pre-commit: + pre-commit-icon4py-model-common: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.10" - - name: Install icon4py-atmosphere-dycore - working-directory: model/atmosphere/dycore + cache: 'pip' + cache-dependency-path: | + **/pyproject.toml + **/base-requirements.txt + **/base-requirements-dev.txt + **/requirements.txt + **/requirements-dev.txt + - name: Install icon4py-common + working-directory: model/common 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 - - name: Install icon4py-common - working-directory: model/common + 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 run: | python -m pip install --upgrade pip setuptools wheel python -m pip install -r ./requirements-dev.txt - - name: Run checks icon4py-model + - name: Run checks icon4py-model-atmosphere-dycore run: | - python -m pip list - pre-commit run --config model/.pre-commit-config.yaml --all-files + pre-commit run --config model/atmosphere/dycore/.pre-commit-config.yaml --all-files diff --git a/.github/workflows/icon4py-tox.yml b/.github/workflows/icon4py-tox.yml index 4d2cdab865..9c331c419a 100644 --- a/.github/workflows/icon4py-tox.yml +++ b/.github/workflows/icon4py-tox.yml @@ -27,7 +27,7 @@ jobs: python-version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install boost run: | @@ -35,9 +35,16 @@ jobs: sudo apt-get install libboost-all-dev - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + **/pyproject.toml + **/base-requirements.txt + **/base-requirements-dev.txt + **/requirements.txt + **/requirements-dev.txt - name: Install python dependencies run: | diff --git a/.github/workflows/icon4pytools-qa.yml b/.github/workflows/icon4pytools-qa.yml index 9afe586f30..0f550ce84d 100644 --- a/.github/workflows/icon4pytools-qa.yml +++ b/.github/workflows/icon4pytools-qa.yml @@ -30,17 +30,24 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + 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 dependencies working-directory: tools run: | python -m pip install --upgrade pip setuptools wheel python -m pip install -r ./requirements-dev.txt + python -m pip list - name: Run checks run: | - python -m pip list pre-commit run --config tools/.pre-commit-config.yaml --all-files diff --git a/.github/workflows/icon4pytools-tox.yml b/.github/workflows/icon4pytools-tox.yml index 5dfc6d6d99..7dadaba3f1 100644 --- a/.github/workflows/icon4pytools-tox.yml +++ b/.github/workflows/icon4pytools-tox.yml @@ -34,7 +34,7 @@ jobs: python-version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install boost run: | @@ -42,9 +42,16 @@ jobs: sudo apt-get install libboost-all-dev - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + **/pyproject.toml + **/base-requirements.txt + **/base-requirements-dev.txt + **/requirements.txt + **/requirements-dev.txt - name: Install python dependencies run: | diff --git a/model/.pre-commit-config.yaml b/model/.pre-commit-config.yaml deleted file mode 100644 index 04f4ab26a5..0000000000 --- a/model/.pre-commit-config.yaml +++ /dev/null @@ -1,137 +0,0 @@ -default_stages: [commit, push] -default_language_version: - python: python3.10 - # The latest node version doesn't work on tsa - # Remove frozen version once we migrated away from tsa - node: 17.9.1 -minimum_pre_commit_version: 2.20.0 -exclude: "tools/.*|model/common/.*" - -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-toml - - id: check-yaml - - id: debug-statements - - id: destroyed-symlinks - # - id: fix-encoding-pragma - # args: [--remove] - - - repo: https://gitlab.com/bmares/check-json5 - rev: v1.0.0 - hooks: - # replaces builtin 'check-json' hook from pre-commit using - # json5 library with support for JSON comments - - id: check-json5 - - - 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/macisamuele/language-formatters-pre-commit-hooks - rev: v2.4.0 - hooks: - - id: pretty-format-ini - name: format INI config files - args: [--autofix] - # - id: pretty-format-toml - # args: [--autofix] - - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.2.1 - hooks: - - id: prettier - name: format JSON/YAML/Markdown files - args: [--prose-wrap=never, --print-width=88, --editorconfig] - types_or: [json, yaml, markdown] - - - 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: [--target-version, py310] - - - 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/pre-commit/mirrors-isort - rev: v5.10.1 - hooks: - - id: isort - name: sort Python imports - args: ["--profile", "black", --line-length=82] - - - 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/.flake8, - model/atmosphere/dycore/src/icon4py/, - model/common/src/icon4py/, - ] - - - repo: local - hooks: - - id: mypy - name: mypy static type checker - entry: bash -c 'echo mypy 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] diff --git a/model/.flake8 b/model/atmosphere/dycore/.flake8 similarity index 100% rename from model/.flake8 rename to model/atmosphere/dycore/.flake8 diff --git a/model/atmosphere/dycore/.pre-commit-config.yaml b/model/atmosphere/dycore/.pre-commit-config.yaml new file mode 100644 index 0000000000..2e760aedef --- /dev/null +++ b/model/atmosphere/dycore/.pre-commit-config.yaml @@ -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/dycore/.*" + +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/dycore/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/dycore/, --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/dycore/.flake8, model/atmosphere/dycore/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] diff --git a/model/atmosphere/dycore/pyproject.toml b/model/atmosphere/dycore/pyproject.toml index d4aee88f45..b6b255adca 100644 --- a/model/atmosphere/dycore/pyproject.toml +++ b/model/atmosphere/dycore/pyproject.toml @@ -1,36 +1,36 @@ [build-system] -requires = ["setuptools>=61.0", "wheel>=0.40.0"] build-backend = "setuptools.build_meta" +requires = ["setuptools>=61.0", "wheel>=0.40.0"] [project] -name = "icon4py-atmosphere-dycore" -description = "ICON dynamical core." -readme = "README.md" -requires-python = ">=3.10" -license = {file = "LICENSE"} authors = [ - {email = "gridtools@cscs.ch"}, - {name = "ETH Zurich"} + {email = "gridtools@cscs.ch"}, + {name = "ETH Zurich"} ] classifiers = [ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Operating System :: POSIX", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "Topic :: Scientific/Engineering :: Mathematics", - "Topic :: Scientific/Engineering :: Physics" + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Operating System :: POSIX", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Physics" ] dependencies = [ - "gt4py>=1.0.1", - "icon4py_common>=0.0.5", + "gt4py>=1.0.1", + "icon4py_common>=0.0.5" ] +description = "ICON dynamical core." dynamic = ['version'] +license = {file = "LICENSE"} +name = "icon4py-atmosphere-dycore" +readme = "README.md" +requires-python = ">=3.10" [project.urls] repository = "https://github.com/C2SM/icon4py" @@ -71,40 +71,41 @@ exclude_lines = [ ignore_errors = true [tool.coverage.run] -parallel = true branch = true +parallel = true source_pkgs = ['dycore'] [tool.isort] +force_grid_wrap = 0 +include_trailing_comma = true +known_first_party = ['icon4py'] +known_third_party = ['gt4py'] lexicographical = true line_length = 100 # It should be the same as in `tool.black.line-length` above lines_after_imports = 2 +# known_tests = ['tests_utils'] +multi_line_output = 3 profile = 'black' -sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'TESTS', 'LOCALFOLDER'] +sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER'] skip_gitignore = true skip_glob = ['*.venv/**', '_local/**'] -known_first_party = ['icon4py.model'] -known_third_party = ['gt4py'] -multi_line_output = 3 use_parentheses = true -include_trailing_comma = true -force_grid_wrap = 0 [tool.mypy] -install_types = true -non_interactive = true -exclude = [ - '^tests/*.py', -] disallow_incomplete_defs = true disallow_untyped_defs = true +exclude = [ + '^tests/*.py' +] ignore_missing_imports = false implicit_reexport = true -warn_unused_configs = true -warn_unused_ignores = true -warn_redundant_casts = true +install_types = true +non_interactive = true show_column_numbers = true show_error_codes = true +warn_redundant_casts = true +warn_unused_configs = true +warn_unused_ignores = true [tool.pytest] diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_theta_and_exner.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_theta_and_exner.py index a0e864646a..61560cb353 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_theta_and_exner.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_theta_and_exner.py @@ -14,18 +14,12 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, int32 -from icon4py.model.atmosphere.dycore.calculate_nabla2_for_z import ( - _calculate_nabla2_for_z, -) -from icon4py.model.atmosphere.dycore.calculate_nabla2_of_theta import ( - _calculate_nabla2_of_theta, -) +from icon4py.model.atmosphere.dycore.calculate_nabla2_for_z import _calculate_nabla2_for_z +from icon4py.model.atmosphere.dycore.calculate_nabla2_of_theta import _calculate_nabla2_of_theta from icon4py.model.atmosphere.dycore.truly_horizontal_diffusion_nabla_of_theta_over_steep_points import ( _truly_horizontal_diffusion_nabla_of_theta_over_steep_points, ) -from icon4py.model.atmosphere.dycore.update_theta_and_exner import ( - _update_theta_and_exner, -) +from icon4py.model.atmosphere.dycore.update_theta_and_exner import _update_theta_and_exner from icon4py.model.common.dimension import CECDim, CEDim, CellDim, EdgeDim, KDim diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance.py index 4e8e1585f3..294eb2ed19 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance.py @@ -21,9 +21,7 @@ from icon4py.model.atmosphere.dycore.calculate_horizontal_gradients_for_turbulence import ( _calculate_horizontal_gradients_for_turbulence, ) -from icon4py.model.atmosphere.dycore.calculate_nabla2_for_w import ( - _calculate_nabla2_for_w, -) +from icon4py.model.atmosphere.dycore.calculate_nabla2_for_w import _calculate_nabla2_for_w from icon4py.model.common.dimension import C2E2CODim, CellDim, KDim diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_and_smag_coefficients_for_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_and_smag_coefficients_for_vn.py index 8df12abc3f..36ed3d10a8 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_and_smag_coefficients_for_vn.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_and_smag_coefficients_for_vn.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, int32, maximum, minimum, sqrt -from icon4py.model.common.dimension import ( - E2C2V, - E2ECV, - ECVDim, - EdgeDim, - KDim, - VertexDim, -) +from icon4py.model.common.dimension import E2C2V, E2ECV, ECVDim, EdgeDim, KDim, VertexDim @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_for_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_for_theta.py index 92bf9e30e7..cca6712de1 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_for_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_for_theta.py @@ -14,12 +14,8 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field -from icon4py.model.atmosphere.dycore.calculate_nabla2_for_z import ( - _calculate_nabla2_for_z, -) -from icon4py.model.atmosphere.dycore.calculate_nabla2_of_theta import ( - _calculate_nabla2_of_theta, -) +from icon4py.model.atmosphere.dycore.calculate_nabla2_for_z import _calculate_nabla2_for_z +from icon4py.model.atmosphere.dycore.calculate_nabla2_of_theta import _calculate_nabla2_of_theta from icon4py.model.common.dimension import CEDim, CellDim, EdgeDim, KDim diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_of_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_of_theta.py index 0420b78a0a..e6517c9a1a 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_of_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla2_of_theta.py @@ -15,15 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, neighbor_sum -from icon4py.model.common.dimension import ( - C2CE, - C2E, - C2EDim, - CEDim, - CellDim, - EdgeDim, - KDim, -) +from icon4py.model.common.dimension import C2CE, C2E, C2EDim, CEDim, CellDim, EdgeDim, KDim @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla4.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla4.py index dede3cb396..e37b3a5857 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla4.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/calculate_nabla4.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field -from icon4py.model.common.dimension import ( - E2C2V, - E2ECV, - ECVDim, - EdgeDim, - KDim, - VertexDim, -) +from icon4py.model.common.dimension import E2C2V, E2ECV, ECVDim, EdgeDim, KDim, VertexDim @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py index eb9ac90b69..1247762663 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, broadcast, where -from icon4py.model.common.dimension import ( - E2C, - E2EC, - CellDim, - ECDim, - EdgeDim, - KDim, -) +from icon4py.model.common.dimension import E2C, E2EC, CellDim, ECDim, EdgeDim, KDim @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py index 0477ff1fcb..8971bb8103 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py @@ -16,15 +16,7 @@ from gt4py.next.ffront.experimental import as_offset from gt4py.next.ffront.fbuiltins import Field, int32 -from icon4py.model.common.dimension import ( - E2C, - E2EC, - CellDim, - ECDim, - EdgeDim, - KDim, - Koff, -) +from icon4py.model.common.dimension import E2C, E2EC, CellDim, ECDim, EdgeDim, KDim, Koff @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py index 800898dc94..c9debefb02 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py @@ -16,15 +16,7 @@ from gt4py.next.ffront.experimental import as_offset from gt4py.next.ffront.fbuiltins import Field, int32 -from icon4py.model.common.dimension import ( - E2C, - E2EC, - CellDim, - ECDim, - EdgeDim, - KDim, - Koff, -) +from icon4py.model.common.dimension import E2C, E2EC, CellDim, ECDim, EdgeDim, KDim, Koff @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py index e8016b5926..e9896cbe99 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, neighbor_sum -from icon4py.model.common.dimension import ( - E2C2E, - E2C2EO, - E2C2EDim, - E2C2EODim, - EdgeDim, - KDim, -) +from icon4py.model.common.dimension import E2C2E, E2C2EO, E2C2EDim, E2C2EODim, EdgeDim, KDim @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py index 84abeee0e7..4b192e07b9 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, neighbor_sum -from icon4py.model.common.dimension import ( - C2E, - C2EDim, - CellDim, - EdgeDim, - KDim, - Koff, -) +from icon4py.model.common.dimension import C2E, C2EDim, CellDim, EdgeDim, KDim, Koff @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py index 6c40169603..5b57d8f19a 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, neighbor_sum -from icon4py.model.common.dimension import ( - C2E, - C2EDim, - CellDim, - EdgeDim, - KDim, - Koff, -) +from icon4py.model.common.dimension import C2E, C2EDim, CellDim, EdgeDim, KDim, Koff @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_07.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_07.py index a08de19b3f..b4b4c697f8 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_07.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_07.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field -from icon4py.model.common.dimension import ( - E2C, - E2V, - CellDim, - EdgeDim, - KDim, - VertexDim, -) +from icon4py.model.common.dimension import E2C, E2V, CellDim, EdgeDim, KDim, VertexDim @field_operator diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_20.py index 5817ee1718..6b04695210 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_velocity_advection_stencil_20.py @@ -14,14 +14,7 @@ from gt4py.next.common import GridType from gt4py.next.ffront.decorator import field_operator, program -from gt4py.next.ffront.fbuiltins import ( - Field, - abs, - broadcast, - minimum, - neighbor_sum, - where, -) +from gt4py.next.ffront.fbuiltins import Field, abs, broadcast, minimum, neighbor_sum, where from icon4py.model.common.dimension import ( E2C, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py index e331a620cd..fd189e6690 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/truly_horizontal_diffusion_nabla_of_theta_over_steep_points.py @@ -15,14 +15,7 @@ from gt4py.next.ffront.experimental import as_offset from gt4py.next.ffront.fbuiltins import Field, int32, where -from icon4py.model.common.dimension import ( - C2CEC, - C2E2C, - CECDim, - CellDim, - KDim, - Koff, -) +from icon4py.model.common.dimension import C2CEC, C2E2C, CECDim, CellDim, KDim, Koff @field_operator diff --git a/model/atmosphere/dycore/tests/test_calculate_diagnostics_for_turbulence.py b/model/atmosphere/dycore/tests/test_calculate_diagnostics_for_turbulence.py index c60af2834b..c628918570 100644 --- a/model/atmosphere/dycore/tests/test_calculate_diagnostics_for_turbulence.py +++ b/model/atmosphere/dycore/tests/test_calculate_diagnostics_for_turbulence.py @@ -18,11 +18,7 @@ calculate_diagnostics_for_turbulence, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestCalculateDiagnosticsForTurbulence(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_calculate_horizontal_gradients_for_turbulence.py b/model/atmosphere/dycore/tests/test_calculate_horizontal_gradients_for_turbulence.py index 58e285bc0c..f846a7a788 100644 --- a/model/atmosphere/dycore/tests/test_calculate_horizontal_gradients_for_turbulence.py +++ b/model/atmosphere/dycore/tests/test_calculate_horizontal_gradients_for_turbulence.py @@ -18,11 +18,7 @@ calculate_horizontal_gradients_for_turbulence, ) from icon4py.model.common.dimension import C2E2CODim, CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestCalculateHorizontalGradientsForTurbulence(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py b/model/atmosphere/dycore/tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py index a9a31ad410..184dba0dca 100644 --- a/model/atmosphere/dycore/tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py +++ b/model/atmosphere/dycore/tests/test_calculate_nabla2_and_smag_coefficients_for_vn.py @@ -17,13 +17,7 @@ from icon4py.model.atmosphere.dycore.calculate_nabla2_and_smag_coefficients_for_vn import ( calculate_nabla2_and_smag_coefficients_for_vn, ) -from icon4py.model.common.dimension import ( - E2C2VDim, - ECVDim, - EdgeDim, - KDim, - VertexDim, -) +from icon4py.model.common.dimension import E2C2VDim, ECVDim, EdgeDim, KDim, VertexDim from icon4py.model.common.test_utils.helpers import ( StencilTest, as_1D_sparse_field, diff --git a/model/atmosphere/dycore/tests/test_calculate_nabla2_for_w.py b/model/atmosphere/dycore/tests/test_calculate_nabla2_for_w.py index 7fa54ee8ca..45e4327a9c 100644 --- a/model/atmosphere/dycore/tests/test_calculate_nabla2_for_w.py +++ b/model/atmosphere/dycore/tests/test_calculate_nabla2_for_w.py @@ -14,15 +14,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.calculate_nabla2_for_w import ( - calculate_nabla2_for_w, -) +from icon4py.model.atmosphere.dycore.calculate_nabla2_for_w import calculate_nabla2_for_w from icon4py.model.common.dimension import C2E2CODim, CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestCalculateNabla2ForW(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_calculate_nabla2_for_z.py b/model/atmosphere/dycore/tests/test_calculate_nabla2_for_z.py index 4b575c47d5..7772dd5dbd 100644 --- a/model/atmosphere/dycore/tests/test_calculate_nabla2_for_z.py +++ b/model/atmosphere/dycore/tests/test_calculate_nabla2_for_z.py @@ -14,9 +14,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.calculate_nabla2_for_z import ( - calculate_nabla2_for_z, -) +from icon4py.model.atmosphere.dycore.calculate_nabla2_for_z import calculate_nabla2_for_z from icon4py.model.common.dimension import CellDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field diff --git a/model/atmosphere/dycore/tests/test_calculate_nabla2_of_theta.py b/model/atmosphere/dycore/tests/test_calculate_nabla2_of_theta.py index 2fceed17ed..5b1f998750 100644 --- a/model/atmosphere/dycore/tests/test_calculate_nabla2_of_theta.py +++ b/model/atmosphere/dycore/tests/test_calculate_nabla2_of_theta.py @@ -14,9 +14,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.calculate_nabla2_of_theta import ( - calculate_nabla2_of_theta, -) +from icon4py.model.atmosphere.dycore.calculate_nabla2_of_theta import calculate_nabla2_of_theta from icon4py.model.common.dimension import C2EDim, CEDim, CellDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import ( StencilTest, diff --git a/model/atmosphere/dycore/tests/test_calculate_nabla4.py b/model/atmosphere/dycore/tests/test_calculate_nabla4.py index d7e9da24f4..07d097bf16 100644 --- a/model/atmosphere/dycore/tests/test_calculate_nabla4.py +++ b/model/atmosphere/dycore/tests/test_calculate_nabla4.py @@ -15,13 +15,7 @@ import pytest from icon4py.model.atmosphere.dycore.calculate_nabla4 import calculate_nabla4 -from icon4py.model.common.dimension import ( - E2C2VDim, - ECVDim, - EdgeDim, - KDim, - VertexDim, -) +from icon4py.model.common.dimension import E2C2VDim, ECVDim, EdgeDim, KDim, VertexDim from icon4py.model.common.test_utils.helpers import ( StencilTest, as_1D_sparse_field, diff --git a/model/atmosphere/dycore/tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py b/model/atmosphere/dycore/tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py index 5323efba3a..cb3411ce0b 100644 --- a/model/atmosphere/dycore/tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py +++ b/model/atmosphere/dycore/tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py @@ -18,11 +18,7 @@ mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, ) from icon4py.model.common.dimension import CellDim, KDim, V2CDim, VertexDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoIconInterpolationScalarCells2vertsScalarRiDsl(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py b/model/atmosphere/dycore/tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py index 694f94df0d..809e48b20f 100644 --- a/model/atmosphere/dycore/tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py +++ b/model/atmosphere/dycore/tests/test_mo_intp_rbf_rbf_vec_interpol_vertex.py @@ -18,11 +18,7 @@ mo_intp_rbf_rbf_vec_interpol_vertex, ) from icon4py.model.common.dimension import EdgeDim, KDim, V2EDim, VertexDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoIntpRbfRbfVecInterpolVertex(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_math_divrot_rot_vertex_ri_dsl.py b/model/atmosphere/dycore/tests/test_mo_math_divrot_rot_vertex_ri_dsl.py index ae29a9bbf7..a992ec9e5d 100644 --- a/model/atmosphere/dycore/tests/test_mo_math_divrot_rot_vertex_ri_dsl.py +++ b/model/atmosphere/dycore/tests/test_mo_math_divrot_rot_vertex_ri_dsl.py @@ -18,11 +18,7 @@ mo_math_divrot_rot_vertex_ri_dsl, ) from icon4py.model.common.dimension import EdgeDim, KDim, V2EDim, VertexDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoMathDivrotRotVertexRiDsl(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py b/model/atmosphere/dycore/tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py index e13c3d923b..0500cc3cbf 100644 --- a/model/atmosphere/dycore/tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py +++ b/model/atmosphere/dycore/tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py @@ -18,11 +18,7 @@ mo_math_gradients_grad_green_gauss_cell_dsl, ) from icon4py.model.common.dimension import C2E2CODim, CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoMathGradientsGradGreenGaussCellDsl(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_02.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_02.py index 4238b31fd3..05975778c4 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_02.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_02.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_02, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil02(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_04.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_04.py index 29cb23efed..e247e9f7a9 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_04.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_04.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_04, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil04(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_05.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_05.py index 8eab825615..6d54d033aa 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_05.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_05.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_05, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil05(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_06.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_06.py index 9a86409fa4..e6086dc445 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_06.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_06.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_06, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil06(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_07.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_07.py index 9b3997ce3f..16c6494f76 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_07.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_07.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_07, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil07(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_08.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_08.py index a805d812b4..4f9943e5de 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_08.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_08.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_08, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil08(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_09.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_09.py index 52b32d7835..3939ff0d75 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_09.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_09.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_09, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil09(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_11_upper.py index 5952263d7b..891bbb585e 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_11_upper.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_11_upper, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil11Upper(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_12.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_12.py index 175bc287fb..8870e81352 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_12.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_12.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_12, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil12(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_13.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_13.py index bf21c4f5f4..d7c334a44c 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_13.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_13.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_13, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil13(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py index 686f58cf7f..461c0a654c 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1, ) from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - as_1D_sparse_field, - random_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, as_1D_sparse_field, random_field class TestComputeBtraj(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_20.py index 349355cd72..320fb7dc4a 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_20.py @@ -19,11 +19,7 @@ mo_solve_nonhydro_stencil_20, ) from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - flatten_first_two_dims, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import flatten_first_two_dims, random_field, zero_field from icon4py.model.common.test_utils.simple_mesh import SimpleMesh diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_21.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_21.py index e0f31fb5ef..a601630e64 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_21.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_21.py @@ -19,11 +19,7 @@ mo_solve_nonhydro_stencil_21, ) from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - flatten_first_two_dims, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import flatten_first_two_dims, random_field, zero_field from icon4py.model.common.test_utils.simple_mesh import SimpleMesh diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_22.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_22.py index 5273d7d3d8..b93541b219 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_22.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_22.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_22, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - random_mask, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask class TestMoSolveNonhydroStencil22(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_23.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_23.py index 388938caf9..961ea95c5c 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_23.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_23.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_23, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil23(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_24.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_24.py index 1887cad8a8..6ed95a6b97 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_24.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_24.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_24, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil24(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_25.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_25.py index 18623f00db..85fdb0788e 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_25.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_25.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_25, ) from icon4py.model.common.dimension import E2C2EODim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil25(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_29.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_29.py index da69d23da3..cc48d754d4 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_29.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_29.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_29, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil29(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_30.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_30.py index 200122bf07..0239daaa17 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_30.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_30.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_30, ) from icon4py.model.common.dimension import E2C2EDim, E2C2EODim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil30(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_31.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_31.py index 0722849c37..1b047bf41d 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_31.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_31.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_31, ) from icon4py.model.common.dimension import E2C2EODim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil31(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_32.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_32.py index 9050261161..b14c893c75 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_32.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_32.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_32, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil32(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_35.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_35.py index 3b087e61ef..5e5912d177 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_35.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_35.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_35, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil35(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_36.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_36.py index 05c7658990..07cf85341b 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_36.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_36.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_36, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil36(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_37.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_37.py index 8fdb06e2aa..4cab94ebca 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_37.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_37.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_37, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil37(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_38.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_38.py index 950f8ad73e..de6a9962cd 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_38.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_38.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_38, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil38(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_39.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_39.py index af619ab8cf..8c4a1b154e 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_39.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_39.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_39, ) from icon4py.model.common.dimension import C2EDim, CellDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil39(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_40.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_40.py index fb9f0ca91f..c8c67b9996 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_40.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_40.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_40, ) from icon4py.model.common.dimension import C2EDim, CellDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil40(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_41.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_41.py index 62b09c102f..198227a1c1 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_41.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_41.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_41, ) from icon4py.model.common.dimension import C2EDim, CellDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil41(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_42.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_42.py index 7e0ea0bdd9..2e0882c12f 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_42.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_42.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_42, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil42(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_43.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_43.py index 4e2fb37562..0e99ac48b9 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_43.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_43.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_43, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil43(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_44.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_44.py index 2660d320ef..6008665b5e 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_44.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_44.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_44, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil44(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_47.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_47.py index 60253bc78e..66aa9b6b09 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_47.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_47.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_47, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil47(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_48.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_48.py index 6654f3177d..1b0e5ae1b2 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_48.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_48.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_48, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil48(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_49.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_49.py index 98c5f6e8ca..96983b3694 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_49.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_49.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_49, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil49(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_55.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_55.py index 1d9e126493..b8e2166397 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_55.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_55.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_55, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil55(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_59.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_59.py index 6fead774be..46873de80a 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_59.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_59.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_59, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil59(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_61.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_61.py index ec105b2996..39d3bcfed2 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_61.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_61.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_61, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil61(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_62.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_62.py index 41ef7c9439..9c3d3442cf 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_62.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_62.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_62, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoSolveNonhydroStencil62(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_66.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_66.py index cc044558b4..2fe3ea1866 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_66.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_66.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_66, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - random_mask, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask class TestMoSolveNonhydroStencil66(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_68.py b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_68.py index dd54adca2b..3a53d52702 100644 --- a/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_68.py +++ b/model/atmosphere/dycore/tests/test_mo_solve_nonhydro_stencil_68.py @@ -18,11 +18,7 @@ mo_solve_nonhydro_stencil_68, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - random_mask, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask class TestMoSolveNonhydroStencil68(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_01.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_01.py index f72cd033b0..5603238271 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_01.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_01.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_01, ) from icon4py.model.common.dimension import E2C2EDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil01(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_02.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_02.py index b677e09773..142b7e56cb 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_02.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_02.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_02, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil02VnIe(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_03.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_03.py index 6767ae9890..6c91bd049e 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_03.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_03.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_03, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil03(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_04.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_04.py index cc124bf8bc..210705a143 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_04.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_04.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_04, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil04(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_05.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_05.py index 4ec8230b5f..81ee77115a 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_05.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_05.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_05, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil05(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_06.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_06.py index 36f09b0a57..c09d4a2040 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_06.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_06.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_06, ) from icon4py.model.common.dimension import EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil06(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_07.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_07.py index 995babfd6f..24bd355eca 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_07.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_07.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_07, ) from icon4py.model.common.dimension import CellDim, EdgeDim, KDim, VertexDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil07(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_08.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_08.py index 192de3f3c3..562129855b 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_08.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_08.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_08, ) from icon4py.model.common.dimension import C2EDim, CellDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil08(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_09.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_09.py index 664b168561..e120054230 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_09.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_09.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_09, ) from icon4py.model.common.dimension import C2EDim, CellDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil09(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_10.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_10.py index d69e70a4f2..d7d7e3d2c7 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_10.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_10.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_10, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil10(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_11.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_11.py index dc16cec9cb..6a8bbaadf2 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_11.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_11.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_11, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil11(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_15.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_15.py index ef91adc33b..59c2564f6a 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_15.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_15.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_15, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestMoVelocityAdvectionStencil15(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_18.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_18.py index 8408b8baeb..abb0e38d2c 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_18.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_18.py @@ -18,11 +18,7 @@ mo_velocity_advection_stencil_18, ) from icon4py.model.common.dimension import C2E2CODim, CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - random_mask, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask class TestMoVelocityAdvectionStencil18(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_19.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_19.py index eaa6532beb..88063c317b 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_19.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_19.py @@ -29,19 +29,8 @@ from icon4py.model.atmosphere.dycore.mo_velocity_advection_stencil_19 import ( mo_velocity_advection_stencil_19, ) -from icon4py.model.common.dimension import ( - CellDim, - E2CDim, - ECDim, - EdgeDim, - KDim, - VertexDim, -) -from icon4py.model.common.test_utils.helpers import ( - as_1D_sparse_field, - random_field, - zero_field, -) +from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim, VertexDim +from icon4py.model.common.test_utils.helpers import as_1D_sparse_field, random_field, zero_field from icon4py.model.common.test_utils.simple_mesh import SimpleMesh diff --git a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_20.py b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_20.py index 50253026c3..d54bcfd506 100644 --- a/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_20.py +++ b/model/atmosphere/dycore/tests/test_mo_velocity_advection_stencil_20.py @@ -16,14 +16,7 @@ from icon4py.model.atmosphere.dycore.mo_velocity_advection_stencil_20 import ( mo_velocity_advection_stencil_20, ) -from icon4py.model.common.dimension import ( - CellDim, - E2C2EODim, - E2CDim, - EdgeDim, - KDim, - VertexDim, -) +from icon4py.model.common.dimension import CellDim, E2C2EODim, E2CDim, EdgeDim, KDim, VertexDim from icon4py.model.common.test_utils.helpers import random_field, random_mask from icon4py.model.common.test_utils.simple_mesh import SimpleMesh diff --git a/model/atmosphere/dycore/tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py b/model/atmosphere/dycore/tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py index bae0e5f16c..61966f1ad8 100644 --- a/model/atmosphere/dycore/tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py +++ b/model/atmosphere/dycore/tests/test_temporary_field_for_grid_point_cold_pools_enhancement.py @@ -18,11 +18,7 @@ temporary_field_for_grid_point_cold_pools_enhancement, ) from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestTemporaryFieldForGridPointColdPoolsEnhancement(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_temporary_fields_for_turbulence_diagnostics.py b/model/atmosphere/dycore/tests/test_temporary_fields_for_turbulence_diagnostics.py index 268db90575..43cd3f4aa2 100644 --- a/model/atmosphere/dycore/tests/test_temporary_fields_for_turbulence_diagnostics.py +++ b/model/atmosphere/dycore/tests/test_temporary_fields_for_turbulence_diagnostics.py @@ -18,11 +18,7 @@ temporary_fields_for_turbulence_diagnostics, ) from icon4py.model.common.dimension import C2EDim, CellDim, EdgeDim, KDim -from icon4py.model.common.test_utils.helpers import ( - StencilTest, - random_field, - zero_field, -) +from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field class TestTemporaryFieldsForTurbulenceDiagnostics(StencilTest): diff --git a/model/atmosphere/dycore/tests/test_update_theta_and_exner.py b/model/atmosphere/dycore/tests/test_update_theta_and_exner.py index af6d6062fe..7292543373 100644 --- a/model/atmosphere/dycore/tests/test_update_theta_and_exner.py +++ b/model/atmosphere/dycore/tests/test_update_theta_and_exner.py @@ -14,9 +14,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_theta_and_exner import ( - update_theta_and_exner, -) +from icon4py.model.atmosphere.dycore.update_theta_and_exner import update_theta_and_exner from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field diff --git a/model/common/.flake8 b/model/common/.flake8 new file mode 100644 index 0000000000..31cecff5ab --- /dev/null +++ b/model/common/.flake8 @@ -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, diff --git a/model/common/.pre-commit-config.yaml b/model/common/.pre-commit-config.yaml new file mode 100644 index 0000000000..3d45afc460 --- /dev/null +++ b/model/common/.pre-commit-config.yaml @@ -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/common/.*" + +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/common/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/common/, --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/common/.flake8, model/common/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] diff --git a/model/common/pyproject.toml b/model/common/pyproject.toml index 8fae7b1c1e..0a90a8cb95 100644 --- a/model/common/pyproject.toml +++ b/model/common/pyproject.toml @@ -1,35 +1,35 @@ [build-system] -requires = ["setuptools>=61.0", "wheel>=0.40.0"] build-backend = "setuptools.build_meta" +requires = ["setuptools>=61.0", "wheel>=0.40.0"] [project] -name = "icon4py-common" -description = "Shared code for the icon4py model." -readme = "README.md" -requires-python = ">=3.10" -license = {file = "LICENSE"} authors = [ - {email = "gridtools@cscs.ch"}, - {name = "ETH Zurich"} + {email = "gridtools@cscs.ch"}, + {name = "ETH Zurich"} ] classifiers = [ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Operating System :: POSIX", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "Topic :: Scientific/Engineering :: Mathematics", - "Topic :: Scientific/Engineering :: Physics" + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Operating System :: POSIX", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Physics" ] dependencies = [ - "gt4py>=1.0.1", + "gt4py>=1.0.1" ] +description = "Shared code for the icon4py model." dynamic = ['version'] +license = {file = "LICENSE"} +name = "icon4py-common" +readme = "README.md" +requires-python = ">=3.10" [project.urls] repository = "https://github.com/C2SM/icon4py" @@ -70,40 +70,41 @@ exclude_lines = [ ignore_errors = true [tool.coverage.run] -parallel = true branch = true +parallel = true source_pkgs = ['common'] [tool.isort] +force_grid_wrap = 0 +include_trailing_comma = true +known_first_party = ['icon4py'] +known_third_party = ['gt4py'] +# known_tests = ['tests_utils'] lexicographical = true line_length = 100 # It should be the same as in `tool.black.line-length` above lines_after_imports = 2 +multi_line_output = 3 profile = 'black' -sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'TESTS', 'LOCALFOLDER'] +sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER'] skip_gitignore = true skip_glob = ['*.venv/**', '_local/**'] -known_first_party = ['icon4py.model'] -known_third_party = ['gt4py'] -multi_line_output = 3 use_parentheses = true -include_trailing_comma = true -force_grid_wrap = 0 [tool.mypy] -install_types = true -non_interactive = true -exclude = [ - '^tests/*.py', -] disallow_incomplete_defs = true disallow_untyped_defs = true +exclude = [ + '^tests/*.py' +] ignore_missing_imports = false implicit_reexport = true -warn_unused_configs = true -warn_unused_ignores = true -warn_redundant_casts = true +install_types = true +non_interactive = true show_column_numbers = true show_error_codes = true +warn_redundant_casts = true +warn_unused_configs = true +warn_unused_ignores = true [tool.pytest] diff --git a/model/common/src/icon4py/model/common/test_utils/helpers.py b/model/common/src/icon4py/model/common/test_utils/helpers.py index eee6ac3cfc..682cc974cc 100644 --- a/model/common/src/icon4py/model/common/test_utils/helpers.py +++ b/model/common/src/icon4py/model/common/test_utils/helpers.py @@ -11,8 +11,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -from typing import ClassVar -from typing import Optional +from typing import ClassVar, Optional import numpy as np import numpy.typing as npt @@ -21,6 +20,7 @@ from gt4py.next.ffront.decorator import Program from gt4py.next.iterator import embedded as it_embedded + try: import pytest_benchmark except ModuleNotFoundError: diff --git a/model/common/src/icon4py/model/common/test_utils/simple_mesh.py b/model/common/src/icon4py/model/common/test_utils/simple_mesh.py index 8818a1fc69..74211edd15 100644 --- a/model/common/src/icon4py/model/common/test_utils/simple_mesh.py +++ b/model/common/src/icon4py/model/common/test_utils/simple_mesh.py @@ -27,13 +27,13 @@ E2C2VDim, E2CDim, E2VDim, + ECDim, ECVDim, EdgeDim, KDim, V2CDim, V2EDim, VertexDim, - ECDim ) diff --git a/tools/.pre-commit-config.yaml b/tools/.pre-commit-config.yaml index 851ca38e5b..865696bf6a 100644 --- a/tools/.pre-commit-config.yaml +++ b/tools/.pre-commit-config.yaml @@ -1,126 +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 - # The latest node version doesn't work on tsa - # Remove frozen version once we migrated away from tsa - node: 17.9.1 + python: python3.10 minimum_pre_commit_version: 2.20.0 -exclude: "model/.*" +files: "tools/.*" 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: meta + hooks: + - id: check-hooks-apply + stages: [manual] + - id: check-useless-excludes + 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/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://gitlab.com/bmares/check-json5 - rev: v1.0.0 - hooks: - # replaces builtin 'check-json' hook from pre-commit using - # json5 library with support for JSON comments - - id: check-json5 +- 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/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, - tools/.license_header.txt, - --fuzzy-match-generates-todo, - ] +- 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/macisamuele/language-formatters-pre-commit-hooks - rev: v2.4.0 - hooks: - - id: pretty-format-ini - name: format INI config files - args: [--autofix] +- 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/pre-commit/mirrors-prettier - rev: v2.2.1 - hooks: - - id: prettier - name: format JSON/YAML/Markdown files - args: [--prose-wrap=never, --print-width=88, --editorconfig] - types_or: [json, yaml, markdown] +- 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, tools/.license_header.txt, --fuzzy-match-generates-todo] - - repo: https://github.com/asottile/yesqa - rev: v1.3.0 - hooks: - - id: yesqa +- 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: [--target-version, py310, --config, tools/pyproject.toml] +- repo: https://github.com/psf/black + rev: '22.3.0' + hooks: + - id: black + name: black Python formatter + args: [--config, tools/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/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/pre-commit/mirrors-isort - rev: v5.10.1 - hooks: - - id: isort - name: sort Python imports for icon4pytools +- repo: https://github.com/PyCQA/isort + rev: '5.12.0' + hooks: + - id: isort + args: [--config-root, tools/, --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=tools/.flake8, tools/src/icon4pytools] +- 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=tools/.flake8, tools/src/icon4pytools/] - - repo: local - hooks: - - id: mypy - name: mypy static type checker - entry: bash -c 'echo mypy disabled' - #entry: bash -c 'cd tools; mypy src/' -- - language: system - types_or: [python, pyi] - always_run: true - pass_filenames: false - require_serial: true - stages: [commit] +- repo: local + hooks: + - id: mypy + name: mypy static type checker + entry: bash -c 'echo mypy temporarily disabled' + #entry:bash -c 'cd tools; mypy src/' -- + language: system + types_or: [python, pyi] + #always_run: true + pass_filenames: false + require_serial: true + stages: [commit] diff --git a/tools/pyproject.toml b/tools/pyproject.toml index d6978a9387..0c828866a8 100644 --- a/tools/pyproject.toml +++ b/tools/pyproject.toml @@ -1,47 +1,44 @@ [build-system] -requires = ["setuptools>=61.0", "wheel>=0.40.0"] -build-backend = "setuptools.build_meta" +build-backend = 'setuptools.build_meta' +requires = ['setuptools>=61.0', 'wheel>=0.40.0'] [project] -name = "icon4pytools" -description = "Tools and utilities for integrating icon4py code into the ICON model." -readme = "README.md" -requires-python = ">=3.10" -license = {file = "LICENSE"} -authors = [ - {email = "gridtools@cscs.ch"}, - {name = "ETH Zurich"} -] +authors = [{email = 'gridtools@cscs.ch'}, {name = 'ETH Zurich'}] classifiers = [ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Operating System :: POSIX", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "Topic :: Scientific/Engineering :: Mathematics", - "Topic :: Scientific/Engineering :: Physics" + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: Implementation :: CPython', + 'Topic :: Scientific/Engineering :: Atmospheric Science', + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Scientific/Engineering :: Physics' ] dependencies = [ - "icon4py-atmosphere-dycore", - "gt4py>=1.0.1", - "icon4py_common", - "tabulate>=0.8.9", - "fprettify>=0.3.7" + 'icon4py-atmosphere-dycore', + 'gt4py>=1.0.1', + 'icon4py_common', + 'tabulate>=0.8.9', + 'fprettify>=0.3.7' ] +description = 'Tools and utilities for integrating icon4py code into the ICON model.' dynamic = ['version'] +license = {file = 'LICENSE'} +name = 'icon4pytools' +readme = 'README.md' +requires-python = '>=3.10' [project.scripts] -icon_liskov = "icon4pytools.liskov.cli:main" -icon4pygen = "icon4pytools.icon4pygen.cli:main" -f2ser = "icon4pytools.f2ser.cli:main" +f2ser = 'icon4pytools.f2ser.cli:main' +icon4pygen = 'icon4pytools.icon4pygen.cli:main' +icon_liskov = 'icon4pytools.liskov.cli:main' [project.urls] -repository = "https://github.com/C2SM/icon4py" +repository = 'https://github.com/C2SM/icon4py' [tool.black] exclude = ''' @@ -79,41 +76,48 @@ exclude_lines = [ ignore_errors = true [tool.coverage.run] -parallel = true branch = true +parallel = true source_pkgs = ['icon4pytools'] [tool.isort] +force_grid_wrap = 0 +include_trailing_comma = true +known_first_party = ['icon4pytools'] +known_third_party = [ + 'gt4py', + 'icon4py' +] +# known_tests = ['tests_utils'] lexicographical = true line_length = 100 # It should be the same as in `tool.black.line-length` above lines_after_imports = 2 +multi_line_output = 3 profile = 'black' -sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'TESTS', 'LOCALFOLDER'] +sections = [ + 'FUTURE', + 'STDLIB', + 'THIRDPARTY', + 'FIRSTPARTY', + 'LOCALFOLDER' +] skip_gitignore = true skip_glob = ['*.venv/**', '_local/**'] -known_third_party = ['gt4py'] -multi_line_output = 3 use_parentheses = true -include_trailing_comma = true -force_grid_wrap = 0 [tool.mypy] -install_types = true -non_interactive = true -exclude = [ - '^tests/f2ser/*.py', - '^tests/icon4pygen/*.py', - '^tests/liskov/*.py', -] disallow_incomplete_defs = true disallow_untyped_defs = true +exclude = ['^tests/f2ser/*.py', '^tests/icon4pygen/*.py', '^tests/liskov/*.py'] ignore_missing_imports = false implicit_reexport = true -warn_unused_configs = true -warn_unused_ignores = true -warn_redundant_casts = true +install_types = true +non_interactive = true show_column_numbers = true show_error_codes = true +warn_redundant_casts = true +warn_unused_configs = true +warn_unused_ignores = true [tool.pytest]