Skip to content

Commit 3668e84

Browse files
committed
removed left-over comments
1 parent ebd6c66 commit 3668e84

File tree

6 files changed

+20
-22
lines changed

6 files changed

+20
-22
lines changed

src/gt4py/eve/datamodels/core.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def asdict(
695695
... y: int
696696
>>> c = C(x=1, y=2)
697697
>>> assert asdict(c) == {"x": 1, "y": 2}
698-
""" # sphinx.napoleon conventions confuse RST validator
698+
"""
699699
if not is_datamodel(instance) or isinstance(instance, type):
700700
raise TypeError(f"Invalid datamodel instance: '{instance}'.")
701701
return attrs.asdict(instance, value_serializer=value_serializer)
@@ -805,7 +805,7 @@ def concretize(
805805
overwrite_definition: If ``True``, a previous definition of the class in
806806
the target module will be overwritten.
807807
808-
""" # doctest conventions confuse RST validator
808+
"""
809809
concrete_cls: Type[DataModelT] = _make_concrete_with_cache(
810810
datamodel_cls, # type: ignore[arg-type]
811811
*type_args,
@@ -1022,7 +1022,7 @@ def _type_converter(value: Any) -> _T:
10221022
_KNOWN_MUTABLE_TYPES: Final = (list, dict, set)
10231023

10241024

1025-
def _make_datamodel( # too complex but still readable and documented
1025+
def _make_datamodel(
10261026
cls: Type[_T],
10271027
*,
10281028
repr: bool, # noqa: A002 # shadowing 'repr' python builtin

src/gt4py/eve/extended_typing.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,9 @@ def __get__(
180180
) -> NonDataDescriptor[_C, _V]: ...
181181

182182
@overload
183-
def __get__( # redefinion of unused member
184-
self, _instance: _C, _owner_type: Optional[Type[_C]] = None
185-
) -> _V: ...
183+
def __get__(self, _instance: _C, _owner_type: Optional[Type[_C]] = None) -> _V: ...
186184

187-
def __get__( # redefinion of unused member
185+
def __get__(
188186
self, _instance: Optional[_C], _owner_type: Optional[Type[_C]] = None
189187
) -> _V | NonDataDescriptor[_C, _V]: ...
190188

@@ -351,7 +349,7 @@ def extended_runtime_checkable(
351349
) -> _ProtoT: ...
352350

353351

354-
def extended_runtime_checkable( # too complex but unavoidable
352+
def extended_runtime_checkable(
355353
maybe_cls: Optional[_ProtoT] = None,
356354
*,
357355
instance_check_shortcut: bool = True,
@@ -697,7 +695,7 @@ class CallableKwargsInfo:
697695
data: Dict[str, Any]
698696

699697

700-
def infer_type( # function is complex but well organized in independent cases
698+
def infer_type(
701699
value: Any,
702700
*,
703701
annotate_callable_kwargs: bool = False,

src/gt4py/eve/type_definitions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import abc
2020
import re
2121
import sys
22-
from enum import Enum as Enum, IntEnum as IntEnum # imported but unused
22+
from enum import Enum as Enum, IntEnum as IntEnum
2323

2424
from boltons.typeutils import classproperty as classproperty
2525
from frozendict import frozendict as _frozendict
@@ -42,7 +42,7 @@
4242
_Tc = TypeVar("_Tc", covariant=True)
4343

4444

45-
class FrozenList(Tuple[_Tc, ...], metaclass=abc.ABCMeta): # no abstract methods
45+
class FrozenList(Tuple[_Tc, ...], metaclass=abc.ABCMeta):
4646
"""Tuple subtype which works as an alias of ``Tuple[_Tc, ...]``."""
4747

4848
__slots__ = ()

src/gt4py/eve/type_validation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __call__(
112112
) -> FixedTypeValidator: ...
113113

114114
@overload
115-
def __call__( # redefinion of unused member
115+
def __call__(
116116
self,
117117
type_annotation: TypeAnnotation,
118118
name: Optional[str] = None,
@@ -124,7 +124,7 @@ def __call__( # redefinion of unused member
124124
) -> Optional[FixedTypeValidator]: ...
125125

126126
@abc.abstractmethod
127-
def __call__( # redefinion of unused member
127+
def __call__(
128128
self,
129129
type_annotation: TypeAnnotation,
130130
name: Optional[str] = None,
@@ -169,7 +169,7 @@ def __call__(
169169
) -> FixedTypeValidator: ...
170170

171171
@overload
172-
def __call__( # redefinion of unused member
172+
def __call__(
173173
self,
174174
type_annotation: TypeAnnotation,
175175
name: Optional[str] = None,
@@ -180,7 +180,7 @@ def __call__( # redefinion of unused member
180180
**kwargs: Any,
181181
) -> Optional[FixedTypeValidator]: ...
182182

183-
def __call__( # redefinion of unused member / complex but well organized in cases
183+
def __call__(
184184
self,
185185
type_annotation: TypeAnnotation,
186186
name: Optional[str] = None,

src/gt4py/next/embedded/operators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __call__( # type: ignore[override]
4646
self,
4747
*args: common.Field | core_defs.Scalar,
4848
**kwargs: common.Field | core_defs.Scalar, # type: ignore[override]
49-
) -> common.Field: # we cannot properly type annotate relative to self.fun
49+
) -> common.Field:
5050
scan_range = embedded_context.closure_column_range.get()
5151
assert self.axis == scan_range[0]
5252
scan_axis = scan_range[0]

src/gt4py/next/ffront/field_operator_ast.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __str__(self):
5151
# class Symbol(eve.GenericNode, LocatedNode, Generic[SymbolT]):
5252
#
5353
class Symbol(LocatedNode, Generic[SymbolT]):
54-
id: Coerced[SymbolName] # shadowing a python builtin
54+
id: Coerced[SymbolName]
5555
type: Union[SymbolT, ts.DeferredType] # A003
5656
namespace: dialect_ast_enums.Namespace = dialect_ast_enums.Namespace(
5757
dialect_ast_enums.Namespace.LOCAL
@@ -79,7 +79,7 @@ class Expr(LocatedNode):
7979

8080

8181
class Name(Expr):
82-
id: Coerced[SymbolRef] # shadowing a python builtin
82+
id: Coerced[SymbolRef]
8383

8484

8585
class Constant(Expr):
@@ -157,7 +157,7 @@ class Stmt(LocatedNode): ...
157157

158158

159159
class Starred(Expr):
160-
id: Union[FieldSymbol, TupleSymbol, ScalarSymbol] # shadowing a python builtin
160+
id: Union[FieldSymbol, TupleSymbol, ScalarSymbol]
161161

162162

163163
class Assign(Stmt):
@@ -198,23 +198,23 @@ def _collect_common_symbols(cls: type[IfStmt], instance: IfStmt) -> None:
198198

199199

200200
class FunctionDefinition(LocatedNode, SymbolTableTrait):
201-
id: Coerced[SymbolName] # shadowing a python builtin
201+
id: Coerced[SymbolName]
202202
params: list[DataSymbol]
203203
body: BlockStmt
204204
closure_vars: list[Symbol]
205205
type: Union[ts.FunctionType, ts.DeferredType] = ts.DeferredType(constraint=ts.FunctionType)
206206

207207

208208
class FieldOperator(LocatedNode, SymbolTableTrait):
209-
id: Coerced[SymbolName] # shadowing a python builtin
209+
id: Coerced[SymbolName]
210210
definition: FunctionDefinition
211211
type: Union[ts_ffront.FieldOperatorType, ts.DeferredType] = ts.DeferredType(
212212
constraint=ts_ffront.FieldOperatorType
213213
)
214214

215215

216216
class ScanOperator(LocatedNode, SymbolTableTrait):
217-
id: Coerced[SymbolName] # shadowing a python builtin
217+
id: Coerced[SymbolName]
218218
axis: Constant
219219
forward: Constant
220220
init: Constant

0 commit comments

Comments
 (0)