From 739f0747f0ac38261da95367a76bbcc96eeec842 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 28 Jul 2024 10:02:56 +0300 Subject: [PATCH] enable typos and fix errors --- .github/workflows/ci.yml | 7 +++++++ arraycontext/impl/jax/__init__.py | 2 +- arraycontext/impl/jax/fake_numpy.py | 2 +- arraycontext/impl/pyopencl/fake_numpy.py | 2 +- arraycontext/impl/pyopencl/taggable_cl_array.py | 3 ++- arraycontext/impl/pytato/fake_numpy.py | 2 +- pyproject.toml | 5 +++++ 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5c5dd0..bade5ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,13 @@ on: - cron: '17 3 * * 0' jobs: + typos: + name: Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@master + ruff: name: Ruff runs-on: ubuntu-latest diff --git a/arraycontext/impl/jax/__init__.py b/arraycontext/impl/jax/__init__.py index 9283835..c52b24a 100644 --- a/arraycontext/impl/jax/__init__.py +++ b/arraycontext/impl/jax/__init__.py @@ -151,7 +151,7 @@ class EagerJAXArrayContext(ArrayContext): return array def tag_axis(self, iaxis, tags: ToTagSetConvertible, array): - # TODO: See `jax.experiemental.maps.xmap`, proabably that should be useful? + # TODO: See `jax.experiemental.maps.xmap`, probably that should be useful? return array def call_loopy(self, t_unit, **kwargs): diff --git a/arraycontext/impl/jax/fake_numpy.py b/arraycontext/impl/jax/fake_numpy.py index 6c9192b..afe6728 100644 --- a/arraycontext/impl/jax/fake_numpy.py +++ b/arraycontext/impl/jax/fake_numpy.py @@ -174,7 +174,7 @@ class EagerJAXFakeNumpyNamespace(BaseFakeNumpyNamespace): else: return reduce( jnp.logical_and, - [rec_equal(ix, iy) for (_, ix), (_, iy) in iterable], + [rec_equal(x_i, y_i) for (_, x_i), (_, y_i) in iterable], true) return rec_equal(a, b) diff --git a/arraycontext/impl/pyopencl/fake_numpy.py b/arraycontext/impl/pyopencl/fake_numpy.py index 22b1bff..2583bfa 100644 --- a/arraycontext/impl/pyopencl/fake_numpy.py +++ b/arraycontext/impl/pyopencl/fake_numpy.py @@ -231,7 +231,7 @@ class PyOpenCLFakeNumpyNamespace(LoopyBasedFakeNumpyNamespace): else: return reduce( partial(cl_array.minimum, queue=queue), - [rec_equal(ix, iy)for (_, ix), (_, iy) in iterable], + [rec_equal(x_i, y_i)for (_, x_i), (_, y_i) in iterable], true) result = rec_equal(a, b) diff --git a/arraycontext/impl/pyopencl/taggable_cl_array.py b/arraycontext/impl/pyopencl/taggable_cl_array.py index af3ab15..a0f3ef4 100644 --- a/arraycontext/impl/pyopencl/taggable_cl_array.py +++ b/arraycontext/impl/pyopencl/taggable_cl_array.py @@ -20,8 +20,9 @@ from pytools.tag import Tag, Taggable, ToTagSetConvertible @dataclass(frozen=True, eq=True) class Axis(Taggable): """ - Records the tags corresponding to a dimensions of :class:`TaggableCLArray`. + Records the tags corresponding to a dimension of :class:`TaggableCLArray`. """ + tags: FrozenSet[Tag] def _with_new_tags(self, tags: FrozenSet[Tag]) -> "Axis": diff --git a/arraycontext/impl/pytato/fake_numpy.py b/arraycontext/impl/pytato/fake_numpy.py index aa0e0e8..9c41b52 100644 --- a/arraycontext/impl/pytato/fake_numpy.py +++ b/arraycontext/impl/pytato/fake_numpy.py @@ -189,7 +189,7 @@ class PytatoFakeNumpyNamespace(LoopyBasedFakeNumpyNamespace): else: return reduce( pt.logical_and, - [rec_equal(ix, iy) for (_, ix), (_, iy) in iterable], + [rec_equal(x_i, y_i) for (_, x_i), (_, y_i) in iterable], true) return rec_equal(a, b) diff --git a/pyproject.toml b/pyproject.toml index 10dba60..6c4cdc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,3 +135,8 @@ module = [ "jax.*", ] ignore_missing_imports = true + +[tool.typos.default] +extend-ignore-re = [ + "(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$" +] -- GitLab