diff --git a/.editorconfig b/.editorconfig index dcbc21d..ee0c1d9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,6 @@ # https://editorconfig.org/ -# https://github.com/editorconfig/editorconfig-vim -# https://github.com/editorconfig/editorconfig-emacs +# https://github.com/editorconfig/editorconfig-vim +# https://github.com/editorconfig/editorconfig-emacs root = true @@ -23,6 +23,9 @@ indent_size = 2 [*.hpp] indent_size = 2 +[*.yml] +indent_size = 4 + # There may be one in doc/ [Makefile] indent_style = tab diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6d0f5d..d4b8f4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: schedule: - cron: '17 3 * * 0' +concurrency: + group: ${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: ruff: name: Ruff @@ -26,7 +30,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.10', '3.x'] + python-version: ['3.10', '3.12', '3.x'] steps: - uses: actions/checkout@v4 - @@ -77,5 +81,3 @@ jobs: . ci-support.sh build_py_project_in_venv build_docs - -# vim: sw=4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 723a7a6..bda86f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,34 +1,33 @@ Ruff: - script: | - pipx install ruff - ruff check - tags: - - docker-runner - except: - - tags + script: | + pipx install ruff + ruff check + tags: + - docker-runner + except: + - tags Python 3: - script: | - py_version=3 - PROJECT_INSTALL_FLAGS="--no-build-isolation" - EXTRA_INSTALL="numpy pybind11 meson-python ninja" + script: | + PROJECT_INSTALL_FLAGS="--no-build-isolation" + EXTRA_INSTALL="numpy pybind11 meson-python ninja" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh - . ./build-and-test-py-project.sh - tags: - - python3 - except: - - tags - artifacts: - reports: - junit: test/pytest.xml + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh + . ./build-and-test-py-project.sh + tags: + - python3 + except: + - tags + artifacts: + reports: + junit: test/pytest.xml Documentation: - script: | - PROJECT_INSTALL_FLAGS="--no-build-isolation" - EXTRA_INSTALL="numpy pybind11 meson-python ninja" + script: | + PROJECT_INSTALL_FLAGS="--no-build-isolation" + EXTRA_INSTALL="numpy pybind11 meson-python ninja" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-docs.sh - . ./build-docs.sh - tags: - - python3 + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-docs.sh + . ./build-docs.sh + tags: + - python3 diff --git a/examples/airfoil3d.py b/examples/airfoil3d.py index 1f2ba48..cd6a857 100644 --- a/examples/airfoil3d.py +++ b/examples/airfoil3d.py @@ -22,6 +22,7 @@ def main(): for x, r in zip( numpy.linspace(-wing_length, 0, wing_subdiv, endpoint=False), numpy.linspace(0.8, 1, wing_subdiv, endpoint=False), + strict=True ) ] + [(1, 0)] @@ -30,6 +31,7 @@ def main(): for x, r in zip( numpy.linspace(wing_length, 0, wing_subdiv, endpoint=False), numpy.linspace(0.8, 1, wing_subdiv, endpoint=False), + strict=True ) ][::-1] + [(0.7, wing_length * 1.05), (0, wing_length * 1.05)] diff --git a/examples/test_tri_quadratic.py b/examples/test_tri_quadratic.py index d94ec35..e16bb3c 100644 --- a/examples/test_tri_quadratic.py +++ b/examples/test_tri_quadratic.py @@ -12,7 +12,8 @@ def loop(a, b): return list( - zip(list(range(a, b)), islice(cycle(list(range(a, b))), 1, None)) + zip(list(range(a, b)), islice(cycle(list(range(a, b))), 1, None), + strict=True) ) diff --git a/meshpy/common.py b/meshpy/common.py index e90cbe3..c26793f 100644 --- a/meshpy/common.py +++ b/meshpy/common.py @@ -12,7 +12,7 @@ def __str__(self): lines = [ " ".join([cell.ljust(col_width) - for cell, col_width in zip(row, col_widths)]) + for cell, col_width in zip(row, col_widths, strict=True)]) for row in self.Rows] return "\n".join(lines) diff --git a/meshpy/geometry.py b/meshpy/geometry.py index ab5d91d..376585d 100644 --- a/meshpy/geometry.py +++ b/meshpy/geometry.py @@ -289,7 +289,7 @@ def round_trip_connect(seq): x = r*np.cos(phi) + cx y = r*np.sin(phi) + cy - return ([np.array(pt) for pt in zip(x, y)], + return ([np.array(pt) for pt in zip(x, y, strict=True)], round_trip_connect(list(range(subdivisions))), None, subdivisions*[marker]) @@ -490,7 +490,8 @@ def connect_ring(ring1_idx, ring2_idx, marker): pairs1 = pair_with_successor(ring1) pairs2 = pair_with_successor(ring2) add_polygons( - [(a, b, c, d) for ((a, b), (d, c)) in zip(pairs1, pairs2)], + [(a, b, c, d) + for ((a, b), (d, c)) in zip(pairs1, pairs2, strict=True)], marker=marker) points = [] diff --git a/meshpy/ply.py b/meshpy/ply.py index 2eb5ffd..a5718f2 100644 --- a/meshpy/ply.py +++ b/meshpy/ply.py @@ -1,11 +1,10 @@ from dataclasses import dataclass -from typing import List @dataclass(frozen=True) class DataBlock: - properties: List[str] - data: List[str] + properties: list[str] + data: list[str] def parse_int(it): @@ -80,7 +79,7 @@ def parse_line(parsers, line): return result for name, line_count, props in data_queue: - prop_names, parsers = list(zip(*props)) + prop_names, parsers = list(zip(*props, strict=True)) result[name] = DataBlock( properties=prop_names, data=[parse_line(parsers, ln) for ln in lines[i:i+line_count]]) diff --git a/meshpy/triangle.py b/meshpy/triangle.py index 34b552b..acdce28 100644 --- a/meshpy/triangle.py +++ b/meshpy/triangle.py @@ -1,11 +1,11 @@ -from typing import ClassVar, List +from typing import ClassVar import meshpy._internals as internals from meshpy.common import MeshInfoBase, dump_array class MeshInfo(internals.TriMeshInfo, MeshInfoBase): - _constituents: ClassVar[List[str]] = [ + _constituents: ClassVar[list[str]] = [ "points", "point_attributes", "point_markers", "elements", "element_attributes", "element_volumes", "neighbors", @@ -84,7 +84,7 @@ def subdivide_facets(subdivisions, points, facets, facet_markers=None): def intermediate_points(pa, pb, n): for i in range(1, n): tau = i/n - yield [pai*(1-tau) + tau*pbi for pai, pbi in zip(pa, pb)] + yield [pai*(1-tau) + tau*pbi for pai, pbi in zip(pa, pb, strict=True)] if isinstance(subdivisions, int): from itertools import repeat @@ -100,7 +100,8 @@ def intermediate_points(pa, pb, n): assert len(facets) == len(facet_markers) new_facet_markers = [] - for facet_idx, ((pidx_a, pidx_b), subdiv) in enumerate(zip(facets, subdiv_it)): + for facet_idx, ((pidx_a, pidx_b), subdiv) in enumerate( + zip(facets, subdiv_it, strict=True)): facet_points = [pidx_a] for p in intermediate_points(points[pidx_a], points[pidx_b], subdiv): facet_points.append(len(new_points)) diff --git a/pyproject.toml b/pyproject.toml index f6f5671..b42c0a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,13 +9,13 @@ requires = [ [project] name = "meshpy" -version = "2022.1.3" +version = "2024.1" description = "Triangular and Tetrahedral Mesh Generator" readme= "README.rst" license = { file = "LICENSE" } authors = [{ name = "Andreas Kloeckner", email = "inform@tiker.net" }] maintainers = [{ name = "Andreas Kloeckner", email = "inform@tiker.net" }] -requires-python = ">=3.8" +requires-python = ">=3.10" classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers",