Skip to content

Commit c7605e7

Browse files
authored
Merge pull request #163 from nschloe/pyright
pyright fixes, lfs cache
2 parents d1ff1c6 + 930ad4e commit c7605e7

4 files changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ jobs:
2525
- uses: actions/setup-python@v2
2626
with:
2727
python-version: "3.x"
28-
- uses: actions/checkout@v2
29-
with:
30-
lfs: true
28+
29+
- name: Checkout code
30+
uses: nschloe/action-cached-lfs-checkout@v1
31+
3132
- name: Install CGAL 5
3233
run: |
3334
# Leave that here in case we ever need a PPA again
@@ -50,9 +51,10 @@ jobs:
5051
- uses: actions/setup-python@v2
5152
with:
5253
python-version: "3.x"
53-
- uses: actions/checkout@v2
54-
with:
55-
lfs: true
54+
55+
- name: Checkout code
56+
uses: nschloe/action-cached-lfs-checkout@v1
57+
5658
- name: Install system dependencies
5759
run: |
5860
brew install cgal eigen

pygalmesh/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import math
44
import os
55
import tempfile
6+
from typing import Callable
67

78
import meshio
89
import numpy
@@ -38,10 +39,10 @@ def generate_mesh(
3839
exude: bool = True,
3940
max_edge_size_at_feature_edges: float = 0.0,
4041
min_facet_angle: float = 0.0,
41-
max_radius_surface_delaunay_ball: float = 0.0,
42+
max_radius_surface_delaunay_ball: float | Callable[..., float] = 0.0,
4243
max_facet_distance: float = 0.0,
4344
max_circumradius_edge_ratio: float = 0.0,
44-
max_cell_circumradius: float = 0.0,
45+
max_cell_circumradius: float | Callable[..., float] = 0.0,
4546
verbose: bool = True,
4647
seed: int = 0,
4748
):
@@ -291,7 +292,7 @@ def generate_from_inr(
291292
max_radius_surface_delaunay_ball: float = 0.0,
292293
max_facet_distance: float = 0.0,
293294
max_circumradius_edge_ratio: float = 0.0,
294-
max_cell_circumradius: float = 0.0,
295+
max_cell_circumradius: float | dict[int | str, float] = 0.0,
295296
verbose: bool = True,
296297
seed: int = 0,
297298
):
@@ -436,7 +437,7 @@ def generate_from_array(
436437
max_edge_size_at_feature_edges: float = 0.0,
437438
min_facet_angle: float = 0.0,
438439
max_radius_surface_delaunay_ball: float = 0.0,
439-
max_cell_circumradius: float = 0.0,
440+
max_cell_circumradius: float | dict[int | str, float] = 0.0,
440441
max_facet_distance: float = 0.0,
441442
max_circumradius_edge_ratio: float = 0.0,
442443
verbose: bool = True,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pygalmesh
3-
version = 0.10.4
3+
version = 0.10.5
44
author = Nico Schlömer
55
author_email = nico.schloemer@gmail.com
66
description = Python frontend to CGAL's mesh generation capabilities

tests/test_from_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def test_from_array():
88
n = 200
99
shape = (n, n, n)
10-
h = [1.0 / s for s in shape]
10+
h = (1.0 / shape[0], 1.0 / shape[1], 1.0 / shape[2])
1111
vol = np.zeros(shape, dtype=np.uint16)
1212
i, j, k = np.arange(shape[0]), np.arange(shape[1]), np.arange(shape[2])
1313
ii, jj, kk = np.meshgrid(i, j, k)
@@ -41,7 +41,7 @@ def test_from_array():
4141
def test_from_array_with_subdomain_sizing():
4242
n = 200
4343
shape = (n, n, n)
44-
h = [1.0 / s for s in shape]
44+
h = (1.0 / shape[0], 1.0 / shape[1], 1.0 / shape[2])
4545
vol = np.zeros(shape, dtype=np.uint16)
4646
i, j, k = np.arange(shape[0]), np.arange(shape[1]), np.arange(shape[2])
4747
ii, jj, kk = np.meshgrid(i, j, k)

0 commit comments

Comments
 (0)