Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edopao committed Jan 18, 2024
1 parent 9420913 commit 5adc444
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/gt4py/eve/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ def unzip(self) -> XIterable[Tuple[Any, ...]]:
[('a', 'b', 'c'), (1, 2, 3)]
"""
return XIterable(zip(*self.iterator)) # mypy gets confused with *args
return XIterable(zip(*self.iterator))

@typing.overload
def islice(self, __stop: int) -> XIterable[T]:
Expand Down Expand Up @@ -1536,7 +1536,7 @@ def reduceby(
) -> Dict[K, S]:
...

def reduceby( # signatures 2 and 4 are not satified due to inconsistencies with type variables
def reduceby(
self,
bin_op_func: Callable[[S, T], S],
key: Union[str, List[K], Callable[[T], K]],
Expand Down
4 changes: 1 addition & 3 deletions src/gt4py/next/otf/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ def replace(self, **kwargs: Any) -> Self:
if not dataclasses.is_dataclass(self):
raise TypeError(f"'{self.__class__}' is not a dataclass.")
assert not isinstance(self, type)
return dataclasses.replace(
self, **kwargs
) # `self` is guaranteed to be a dataclass (is_dataclass) should be a `TypeGuard`?
return dataclasses.replace(self, **kwargs)


class ChainableWorkflowMixin(Workflow[StartT, EndT]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def build_sdfg_from_itir(
sdfg_genenerator = ItirToSDFG(arg_types, offset_provider, column_axis)
sdfg = sdfg_genenerator.visit(program)
if sdfg is None:
raise RuntimeError(f"visit failed for program {program.id}")
raise RuntimeError(f"Visit failed for program {program.id}.")

# run DaCe transformations to simplify the SDFG
sdfg.simplify()
Expand Down

0 comments on commit 5adc444

Please sign in to comment.