Skip to content

Commit 2df65c0

Browse files
committed
Merge branch 'release-recalculate_renormalize_platonic' of https://github.com/glotzerlab/coxeter into release-recalculate_renormalize_platonic
2 parents 73e175a + 145de7b commit 2df65c0

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: 'v4.3.0'
6+
rev: 'v4.4.0'
77
hooks:
88
- id: end-of-file-fixer
99
- id: trailing-whitespace
@@ -19,29 +19,29 @@ repos:
1919
- id: check-json
2020
- id: check-yaml
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: 'v2.34.0'
22+
rev: 'v3.3.1'
2323
hooks:
2424
- id: pyupgrade
2525
args:
2626
- --py38-plus
2727
exclude: '(?:extern/.*)'
2828
- repo: https://github.com/PyCQA/isort
29-
rev: '5.10.1'
29+
rev: '5.12.0'
3030
hooks:
3131
- id: isort
3232
exclude: '(?:extern/.*)'
3333
- repo: https://github.com/psf/black
34-
rev: '22.6.0'
34+
rev: '23.1.0'
3535
hooks:
3636
- id: black
3737
exclude: '(?:extern/.*)'
3838
- repo: https://github.com/PyCQA/pydocstyle
39-
rev: '6.1.1'
39+
rev: '6.3.0'
4040
hooks:
4141
- id: pydocstyle
4242
exclude: '(?:extern/.*|tests/.*|setup.py|conf.py)'
4343
- repo: https://github.com/PyCQA/flake8
44-
rev: '4.0.1'
44+
rev: '6.0.0'
4545
hooks:
4646
- id: flake8
4747
additional_dependencies: [
@@ -52,7 +52,7 @@ repos:
5252
'flake8-comprehensions==3.8.0',
5353
]
5454
- repo: https://github.com/nbQA-dev/nbQA
55-
rev: 1.3.1
55+
rev: 1.6.1
5656
hooks:
5757
- id: nbqa-pyupgrade
5858
args:

paper/figure1/shape_images/Shapes.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@
243243
"outputs": [],
244244
"source": [
245245
"def draw_bun():\n",
246-
"\n",
247246
" data = np.load(\"data/low_poly_stanford_bunny/data.npz\")\n",
248247
" vertices = data[\"vertices\"]\n",
249248
" indices = data[\"indices\"]\n",

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ exclude = coxeter/extern/*
2020
select = E,F,W,B,RST,N
2121
per-file-ignores =
2222
coxeter/__init__.py: F401
23+
# We prefer line breaks before, not after, binary operators.
2324
ignore =
24-
W503 # We prefer line breaks before, not after, binary operators.
25+
W503
2526
rst-roles =
2627
attr,class,func,meth,mod,obj,ref,term,cite
2728

tests/conftest.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,12 @@ def points_from_ellipsoid_surface(a, b, c=0, n=10):
135135
Returns:
136136
:math:`(N, 3)` or :math:`(N, 2)` :class:`numpy.ndarray`: The points.
137137
"""
138-
points = []
139-
points = np.zeros((n, 3))
140-
points[:, 0] = np.random.normal(0, a, n)
141-
points[:, 1] = np.random.normal(0, b, n)
142-
if c > 0:
143-
points[:, 2] = np.random.normal(0, c, n)
144-
ds = np.linalg.norm(points / [a, b, c if c else 1], axis=-1)
138+
scale = (a, b, c) if c > 0 else (a, b)
139+
size = (n, 3 if c > 0 else 2)
140+
points = np.random.normal(0, scale, size)
141+
ds = np.linalg.norm(points / ([a, b, c] if c > 0 else [a, b]), axis=-1)
145142
points /= ds[:, np.newaxis]
146-
return points if c else points[:, :2]
143+
return points
147144

148145

149146
EllipsoidSurfaceStrategy = builds(

tests/test_polyhedron.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def test_convex_surface_area(points):
106106
)
107107
def test_volume_center_shift(cube):
108108
"""Make sure that moving the center doesn't affect the volume."""
109+
109110
# Use a nested function to avoid warnings from hypothesis. In this case, it
110111
# is safe to reuse the cube fixture.
111112
# See https://github.com/HypothesisWorks/hypothesis/issues/377
@@ -417,9 +418,7 @@ def test_inside(convex_cube):
417418
# Use a nested function to avoid warnings from hypothesis. In this case, it
418419
# is safe to reuse the convex cube.
419420
# See https://github.com/HypothesisWorks/hypothesis/issues/377
420-
@given(
421-
arrays(np.float64, (100, 3), elements=floats(-10, 10, width=64), unique=True)
422-
)
421+
@given(arrays(np.float64, (100, 3), elements=floats(-10, 10, width=64)))
423422
def testfun(test_points):
424423
expected = np.all(np.logical_and(test_points >= 0, test_points <= 1), axis=1)
425424
actual = convex_cube.is_inside(test_points)
@@ -428,10 +427,10 @@ def testfun(test_points):
428427
testfun()
429428

430429

431-
@settings(deadline=500)
430+
@settings(max_examples=10)
432431
@given(
433432
EllipsoidSurfaceStrategy,
434-
arrays(np.float64, (100, 3), elements=floats(0, 1, width=64), unique=True),
433+
arrays(np.float64, (100, 3), elements=floats(0, 1, width=64)),
435434
)
436435
def test_maximal_centered_bounded_sphere_convex_hulls(points, test_points):
437436
hull = ConvexHull(points)

0 commit comments

Comments
 (0)