Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions MANIFEST.in

This file was deleted.

10 changes: 8 additions & 2 deletions arraycontext/impl/pytato/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ def map_data_wrapper(self, expr: DataWrapper) -> Array:

# https://github.com/pylint-dev/pylint/issues/3893
# pylint: disable=unexpected-keyword-arg
return DataWrapper(
# type-ignore: discussed at
# https://github.com/inducer/arraycontext/pull/289#discussion_r1855523967
# possibly related: https://github.com/python/mypy/issues/17375
return DataWrapper( # type: ignore[call-arg]
data=new_dw.data,
shape=expr.shape,
axes=expr.axes,
Expand Down Expand Up @@ -190,7 +193,10 @@ def map_data_wrapper(self, expr: DataWrapper) -> Array:

# https://github.com/pylint-dev/pylint/issues/3893
# pylint: disable=unexpected-keyword-arg
return DataWrapper(
# type-ignore: discussed at
# https://github.com/inducer/arraycontext/pull/289#discussion_r1855523967
# possibly related: https://github.com/python/mypy/issues/17375
return DataWrapper( # type: ignore[call-arg]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't understand what mypy is complaining about here. shape and data are defined as dataclass attributes?

Copy link
Collaborator Author

@alexfikl alexfikl Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I really don't know either :\ I've stared a bit at the pytato code, but it's obviously fine. It's doubly surprising since those two attributes are actually in the class itself, not in a parent..

Definitely the same thing that's confusing pylint as well though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, doing a reveal_type(DataWrapper) says

arraycontext/impl/pytato/utils.py:193: note: Revealed type is "def (*, axes: builtins.tuple[pytato.array.Axis, ...], tags: builtins.frozenset[pytools.tag.Tag], non_equality_tags: builtins.frozenset[pytools.tag.Tag] =) -> pytato.array.DataWrapper"

so for some reason it really doesn't think those arguments are there..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly related to this: python/mypy#17375

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find, thanks. Added that as context in a comment so we don't lose it.

data=np_data,
shape=expr.shape,
axes=expr.axes,
Expand Down
2 changes: 1 addition & 1 deletion arraycontext/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def _parse_version(version: str) -> tuple[tuple[int, ...], str]:
import re

m = re.match("^([0-9.]+)([a-z0-9]*?)$", VERSION_TEXT)
m = re.match(r"^([0-9.]+)([a-z0-9]*?)$", VERSION_TEXT)
assert m is not None

return tuple(int(nr) for nr in m.group(1).split(".")), m.group(2)
Expand Down
20 changes: 2 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=63",
]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "arraycontext"
Expand Down Expand Up @@ -57,20 +55,6 @@ test = [
Documentation = "https://documen.tician.de/arraycontext"
Homepage = "https://github.com/inducer/arraycontext"

[tool.setuptools.packages.find]
include = [
"arraycontext*",
]

[tool.setuptools.package-dir]
# https://github.com/Infleqtion/client-superstaq/pull/715
"" = "."

[tool.setuptools.package-data]
pytools = [
"py.typed",
]

[tool.ruff]
preview = true

Expand Down
Loading