Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
357d8fb
add result deduplication to transform mappers
majosm Sep 24, 2024
1593c23
avoid unnecessary duplication in CopyMapper/CopyMapperWithExtraArgs
majosm Jun 10, 2024
d2072f5
add Deduplicator
majosm Sep 20, 2024
1e326ed
Avoid duplication related to axis tagging
majosm Jun 11, 2024
57d0a17
avoid duplication in with_tagged_reduction for IndexLambda/Einsum
majosm Jun 11, 2024
7e07992
attempt to avoid duplication in CodeGenPreprocessor
majosm Jun 10, 2024
5fef7d9
limit PlaceholderSubstitutor to one call stack frame
majosm Jul 3, 2024
0d6c8c0
tweak Inliner/PlaceholderSubstitutor implementations
majosm Jul 12, 2024
39aa718
use context manager to avoid leaking traceback tag setting in test
majosm Jul 16, 2024
eb4bd4b
refactor FFTRealizationMapper to avoid resetting cache in __init__
majosm Jul 16, 2024
bdf6395
add allow_duplicate_nodes option to RandomDAGContext in tests
majosm Aug 27, 2024
94acf22
fix some more tests
majosm Aug 27, 2024
78d8ba0
don't check for collisions in ArrayToDotNodeInfoMapper
majosm Sep 24, 2024
6ea7d8b
avoid duplication in MPMSMaterializer
majosm Sep 18, 2024
2c76a7c
avoid duplicates in EinsumWithNoBroadcastsRewriter
majosm Feb 7, 2025
b826922
forbid DependencyMapper from being called on functions
majosm Feb 7, 2025
b3bb849
deduplicate in advection example
majosm Feb 27, 2025
8ee1d3f
add FIXME
majosm Apr 14, 2025
997fbf0
Add replace_if_different to reduce the amount of boilerplate from dup…
majosm Apr 7, 2025
4d49af9
add doc for PartId to fix build error
majosm Apr 15, 2025
2331d91
Drop license specifier in pyproject
inducer May 8, 2025
fc4f1a7
Add a cast/FIXME in _is_non_negative
inducer May 8, 2025
3e2c521
Add some @override's to placate pyright
inducer May 8, 2025
65011de
Fix some import issues flagged by pyright
inducer May 8, 2025
98b5129
Add missing superclass constructor call
inducer May 8, 2025
c05af45
Add missing field_specifiers to @dataclass_transform
inducer May 9, 2025
c7a2fde
Fix imports of Never, Self from typing->typing_extensions
inducer May 9, 2025
0c13260
Better type einsum
inducer May 14, 2025
27a7e3b
CI: Switch from basedmypy to basedpyright
inducer May 8, 2025
f3ce4b5
Fire pylint
inducer May 9, 2025
20bd9f0
Work around bpr errors only shown in CI
inducer May 11, 2025
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
34,732 changes: 34,732 additions & 0 deletions .basedpyright/baseline.json

Large diffs are not rendered by default.

25 changes: 4 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,7 @@ jobs:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master

pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: "Main Script"
run: |
export EXTRA_INSTALL="git+https://github.com/inducer/arraycontext"
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_conda_env
run_pylint "$(basename $GITHUB_REPOSITORY)" test/test_*.py examples

mypy:
name: Mypy
basedpyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -63,8 +45,9 @@ jobs:
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
python -m pip install basedmypy
./run-mypy.sh
python -m pip install pytest
python -m pip install basedpyright
basedpyright

pytest:
name: Conda Pytest
Expand Down
17 changes: 3 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ Python 3 POCL Examples:
except:
- tags

Pylint:
script:
- export PY_EXE=python3
- EXTRA_INSTALL="pyopencl mpi4py jax[cpu] pygments"
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-pylint.sh
- . ./prepare-and-run-pylint.sh ${CI_PROJECT_NAME} test/test_*.py examples
tags:
- python3
except:
- tags

Ruff:
script: |
pipx install ruff
Expand All @@ -54,14 +43,14 @@ Ruff:
except:
- tags

Mypy:
BasedPyright:
script: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
export EXTRA_INSTALL="git+https://github.com/inducer/arraycontext"
build_py_project_in_venv
python -m pip install basedmypy mpi4py
./run-mypy.sh
python -m pip install basedpyright mpi4py pytest
basedpyright
tags:
- python3
except:
Expand Down
1 change: 1 addition & 0 deletions examples/advection.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def test_advection_convergence(order, flux_type):
op = AdvectionOperator(discr, c=1, flux_type=flux_type,
dg_ops=dg_ops)
result = op.apply(u)
result = pt.transform.Deduplicator()(result)

prog = pt.generate_loopy(result, cl_device=queue.device)

Expand Down
30 changes: 28 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
Expand All @@ -35,7 +34,7 @@ dependencies = [
"bidict",
"immutabledict",
"loopy>=2020.2",
"pytools>=2024.1.21",
"pytools>=2025.1.5",
"pymbolic>=2024.2",
"typing_extensions>=4",
"orderedsets",
Expand Down Expand Up @@ -144,6 +143,33 @@ module = [
# We'll be getting rid of it, no point in fixing it.
ignore_errors = true


[tool.basedpyright]
reportImplicitStringConcatenation = "none"
reportUnnecessaryIsInstance = "none"
reportUnusedCallResult = "none"
reportExplicitAny = "none"

# This reports even cycles that are qualified by 'if TYPE_CHECKING'. Not what
# we care about at this moment.
# https://github.com/microsoft/pyright/issues/746
reportImportCycles = "none"

# Some errors get flagged in CI, but not locally. This makes it awkward to
# include those in the baseline, so they get ignored with 'pyright: ignore'.
# Local runs now flag this as unnecessary. Downgrading to hint to avoid
# circular complaints.
reportUnnecessaryTypeIgnoreComment = "hint"

pythonVersion = "3.10"
pythonPlatform = "All"

ignore = [
# We'll be getting rid of it, no point in fixing it.
"pytato/raising.py",
]


[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$"
Expand Down
6 changes: 3 additions & 3 deletions pytato/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
THE SOFTWARE.
"""

from typing import TYPE_CHECKING, Any, Never, overload
from typing import TYPE_CHECKING, Any, overload

from orderedsets import FrozenOrderedSet
from typing_extensions import Self
from typing_extensions import Never, Self

from loopy.tools import LoopyKeyBuilder
from pymbolic.mapper.optimize import optimize_mapper
Expand All @@ -54,7 +54,7 @@
if TYPE_CHECKING:
from collections.abc import Iterable, Mapping

import pytools
import pytools.tag

from pytato.distributed.nodes import DistributedRecv, DistributedSendRefHolder
from pytato.loopy import LoopyCall
Expand Down
Loading
Loading