Skip to content

Commit

Permalink
Merge branch 'main' into production-pilot
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam committed Oct 26, 2023
2 parents 351bb6f + b015204 commit 148527f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pytato/stringifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def _map_generic_array(self, expr: Array, depth: int) -> str:
if depth > self.truncation_depth:
return self.truncation_string

fields = tuple(field.name for field in attrs.fields(type(expr)))
# type-ignore-reason: https://github.com/python/mypy/issues/16254
fields = tuple(field.name
for field in attrs.fields(type(expr))) # type: ignore[misc]

if expr.ndim <= 1:
# prettify: if ndim <=1 'expr.axes' would be trivial,
Expand Down Expand Up @@ -153,7 +155,8 @@ def _get_field_val(field: str) -> str:

return (f"{type(expr).__name__}("
+ ", ".join(f"{field.name}={_get_field_val(field.name)}"
for field in attrs.fields(type(expr)))
# type-ignore-reason: https://github.com/python/mypy/issues/16254
for field in attrs.fields(type(expr))) # type: ignore[misc]
+ ")")

def map_loopy_call(self, expr: LoopyCall, depth: int) -> str:
Expand Down
3 changes: 2 additions & 1 deletion pytato/visualization/dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def handle_unsupported_array(self, # type: ignore[override]
# Default handler, does its best to guess how to handle fields.
info = self.get_common_dot_info(expr)

for field in attrs.fields(type(expr)):
# type-ignore-reason: https://github.com/python/mypy/issues/16254
for field in attrs.fields(type(expr)): # type: ignore[misc]
if field.name in info.fields:
continue
attr = getattr(expr, field.name)
Expand Down
1 change: 0 additions & 1 deletion test/test_pytato.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def test_stack_input_validation():
pt.stack((x, x), axis=3)


@pytest.mark.xfail # Unnamed placeholders should be used via pt.bind
def test_make_placeholder_noname():
x = pt.make_placeholder("x", shape=(10, 4), dtype=float)
y = 2*x
Expand Down

0 comments on commit 148527f

Please sign in to comment.