Skip to content

Commit

Permalink
add noqa A004 for imports of gt4py-builtins abs (#309)
Browse files Browse the repository at this point in the history
* add noqa A004 for imports of gt4py-builtins abs

* add noqa A004 for imports of gt4py-builtins abs for model/atmosphere/advection
  • Loading branch information
halungge authored Nov 8, 2023
1 parent 3ccf33f commit 2686dc1
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 10 deletions.
10 changes: 10 additions & 0 deletions model/atmosphere/advection/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ repos:
rev: v1.3.0
hooks:
- id: yesqa
additional_dependencies:
- flake8==4.0.1
- darglint
- flake8-bugbear
- flake8-builtins==2.2.0
- flake8-debugger
- flake8-docstrings
- flake8-eradicate
- flake8-mutable
- pygments

- repo: https://github.com/psf/black
rev: '22.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import Field, abs
from gt4py.next.ffront.fbuiltins import Field, abs # noqa: A004 # import gt4py builtin

from icon4py.model.common.dimension import E2C, CellDim, EdgeDim, KDim

Expand All @@ -23,7 +23,6 @@ def _hflx_limiter_mo_stencil_01a(
p_mass_flx_e: Field[[EdgeDim, KDim], float],
p_cc: Field[[CellDim, KDim], float],
) -> tuple[Field[[EdgeDim, KDim], float], Field[[EdgeDim, KDim], float]]:

z_mflx_low = 0.5 * (
p_mass_flx_e * (p_cc(E2C[0]) + p_cc(E2C[1]))
- abs(p_mass_flx_e) * (p_cc(E2C[1]) - p_cc(E2C[0]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import Field, abs, maximum, where
from gt4py.next.ffront.fbuiltins import ( # noqa: A004 # import gt4py builtin
Field,
abs,
maximum,
where,
)

from icon4py.model.common.dimension import EdgeDim, KDim

Expand Down Expand Up @@ -70,7 +75,6 @@ def _prep_gauss_quadrature_c_stencil(
Field[[EdgeDim, KDim], float],
Field[[EdgeDim, KDim], float],
]:

z_wgt_1 = 0.0625 * wgt_zeta_1 * wgt_eta_1
z_wgt_2 = 0.0625 * wgt_zeta_1 * wgt_eta_2
z_wgt_3 = 0.0625 * wgt_zeta_2 * wgt_eta_1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import Field, FieldOffset, abs, int32, where
from gt4py.next.ffront.fbuiltins import ( # noqa: A004 # import gt4py builtin
Field,
FieldOffset,
abs,
int32,
where,
)

from icon4py.model.common.dimension import CellDim, KDim

Expand All @@ -25,7 +31,6 @@ def _v_limit_prbl_sm_stencil_01(
p_face: Field[[CellDim, KDim], float],
p_cc: Field[[CellDim, KDim], float],
) -> Field[[CellDim, KDim], int32]:

z_delta = p_face - p_face(Koff[1])
z_a6i = 6.0 * (p_cc - 0.5 * (p_face + p_face(Koff[1])))

Expand Down
10 changes: 10 additions & 0 deletions model/atmosphere/dycore/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ repos:
rev: v1.3.0
hooks:
- id: yesqa
additional_dependencies:
- flake8==4.0.1
- darglint
- flake8-bugbear
- flake8-builtins==2.2.0
- flake8-debugger
- flake8-docstrings
- flake8-eradicate
- flake8-mutable
- pygments

- repo: https://github.com/psf/black
rev: '22.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@

from gt4py.next.common import GridType
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import Field, abs, broadcast, where
from gt4py.next.ffront.fbuiltins import ( # noqa: A004 # import gt4py builtin
Field,
abs,
broadcast,
where,
)

from icon4py.model.common.dimension import CellDim, KDim

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@

from gt4py.next.common import GridType
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import Field, abs, int32, minimum, neighbor_sum, where
from gt4py.next.ffront.fbuiltins import ( # noqa: A004 # import gt4py builtin
Field,
abs,
int32,
minimum,
neighbor_sum,
where,
)

from icon4py.model.common.dimension import C2E2CO, C2E2CODim, CellDim, KDim

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@

from gt4py.next.common import GridType
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import Field, abs, broadcast, int32, minimum, neighbor_sum, where
from gt4py.next.ffront.fbuiltins import ( # noqa: A004 # import gt4py builtin
Field,
abs,
broadcast,
int32,
minimum,
neighbor_sum,
where,
)

from icon4py.model.common.dimension import (
E2C,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
import numpy as np
from gt4py.next.common import Dimension, Field
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import abs, broadcast, int32, maximum, minimum
from gt4py.next.ffront.fbuiltins import ( # noqa: A004 # import gt4py builtin
abs,
broadcast,
int32,
maximum,
minimum,
)
from gt4py.next.iterator.embedded import np_as_located_field

from icon4py.model.common.dimension import CellDim, EdgeDim, KDim, Koff, VertexDim
Expand Down

0 comments on commit 2686dc1

Please sign in to comment.