Skip to content

Commit

Permalink
Revert "Improve mapper type annotations"
Browse files Browse the repository at this point in the history
This reverts commit dd6a35b.
  • Loading branch information
inducer committed Jul 12, 2024
1 parent dd6a35b commit b528e25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pytato/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@


ArrayOrNames = Union[Array, AbstractResultWithNamedArrays]
MappedT = TypeVar("MappedT", bound=ArrayOrNames)
MappedT = TypeVar("MappedT",
Array, AbstractResultWithNamedArrays, ArrayOrNames)
CombineT = TypeVar("CombineT") # used in CombineMapper
CopyMapperResultT = TypeVar("CopyMapperResultT", bound=ArrayOrNames)
CopyMapperResultT = TypeVar("CopyMapperResultT", # used in CopyMapper
Array, AbstractResultWithNamedArrays, ArrayOrNames)
CachedMapperT = TypeVar("CachedMapperT") # used in CachedMapper
IndexOrShapeExpr = TypeVar("IndexOrShapeExpr")
R = FrozenSet[Array]
Expand Down
4 changes: 3 additions & 1 deletion test/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def get_random_pt_dag(seed: int,
additional_generators = []

from testlib import RandomDAGContext, make_random_dag
from typing import cast

rdagc_comm = RandomDAGContext(np.random.default_rng(seed=seed),
axis_len=axis_len, use_numpy=False,
Expand All @@ -277,7 +278,8 @@ def make_dws_placeholder(expr: pt.transform.ArrayOrNames
else:
return expr

dag = pt.transform.map_and_copy(dag, make_dws_placeholder)
dag = cast(pt.DictOfNamedArrays,
pt.transform.map_and_copy(dag, make_dws_placeholder))

return dag

Expand Down

0 comments on commit b528e25

Please sign in to comment.