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
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-
Expand Down Expand Up @@ -77,5 +81,3 @@ jobs:
. ci-support.sh
build_py_project_in_venv
build_docs

# vim: sw=4
53 changes: 26 additions & 27 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions examples/airfoil3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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)]
Expand Down
3 changes: 2 additions & 1 deletion examples/test_tri_quadratic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)


Expand Down
2 changes: 1 addition & 1 deletion meshpy/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions meshpy/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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 = []
Expand Down
7 changes: 3 additions & 4 deletions meshpy/ply.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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]])
Expand Down
9 changes: 5 additions & 4 deletions meshpy/triangle.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" }]
maintainers = [{ name = "Andreas Kloeckner", email = "[email protected]" }]
requires-python = ">=3.8"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down
Loading