Skip to content

Commit 3f9deb8

Browse files
committed
update tests and config
1 parent ec8b9ed commit 3f9deb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2855
-1581
lines changed

.bumpversion.cfg

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ commit = True
55
tag = True
66

77
[bumpversion:file:setup.py]
8-
search = version='{current_version}'
9-
replace = version='{new_version}'
8+
search = version="{current_version}"
9+
replace = version="{new_version}"
1010

1111
[bumpversion:glob:schemas/*.json]
1212
search = "$compas": "{current_version}"
@@ -17,24 +17,24 @@ search = release = "{current_version}"
1717
replace = release = "{new_version}"
1818

1919
[bumpversion:file:src/compas/__init__.py]
20-
search = __version__ = '{current_version}'
21-
replace = __version__ = '{new_version}'
20+
search = __version__ = "{current_version}"
21+
replace = __version__ = "{new_version}"
2222

2323
[bumpversion:file:src/compas_blender/__init__.py]
24-
search = __version__ = '{current_version}'
25-
replace = __version__ = '{new_version}'
24+
search = __version__ = "{current_version}"
25+
replace = __version__ = "{new_version}"
2626

2727
[bumpversion:file:src/compas_ghpython/__init__.py]
28-
search = __version__ = '{current_version}'
29-
replace = __version__ = '{new_version}'
28+
search = __version__ = "{current_version}"
29+
replace = __version__ = "{new_version}"
3030

3131
[bumpversion:file:src/compas_plotters/__init__.py]
32-
search = __version__ = '{current_version}'
33-
replace = __version__ = '{new_version}'
32+
search = __version__ = "{current_version}"
33+
replace = __version__ = "{new_version}"
3434

3535
[bumpversion:file:src/compas_rhino/__init__.py]
36-
search = __version__ = '{current_version}'
37-
replace = __version__ = '{new_version}'
36+
search = __version__ = "{current_version}"
37+
replace = __version__ = "{new_version}"
3838

3939
[bumpversion:file:CHANGELOG.md]
4040
search = Unreleased

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def pytest_ignore_collect(path):
1919
if "matlab" in str(path):
2020
return True
2121

22-
if str(path).endswith('_cli.py'):
22+
if str(path).endswith("_cli.py"):
2323
return True
2424

2525

docs/conf.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import sphinx_compas_theme
1515
from sphinx.ext.napoleon.docstring import NumpyDocstring
1616

17-
sys.path.append(os.path.join(os.path.dirname(__file__), '_ext'))
17+
sys.path.append(os.path.join(os.path.dirname(__file__), "_ext"))
1818

1919
# patches
2020

@@ -28,7 +28,9 @@ def patched_m2r2_setup(app):
2828
app.add_source_suffix(".md", "markdown")
2929
app.add_source_parser(m2r2.M2RParser)
3030
return dict(
31-
version=m2r2.__version__, parallel_read_safe=True, parallel_write_safe=True,
31+
version=m2r2.__version__,
32+
parallel_read_safe=True,
33+
parallel_write_safe=True,
3234
)
3335

3436

@@ -76,7 +78,7 @@ def patched_m2r2_setup(app):
7678
"m2r2",
7779
# "nbsphinx",
7880
"sphinx.ext.autodoc.typehints",
79-
"tabs"
81+
"tabs",
8082
]
8183

8284
# autodoc options
@@ -98,7 +100,7 @@ def patched_m2r2_setup(app):
98100
"rhinoscriptsyntax",
99101
"bpy",
100102
"bmesh",
101-
"mathutils"
103+
"mathutils",
102104
]
103105

104106
autodoc_default_options = {
@@ -112,7 +114,7 @@ def patched_m2r2_setup(app):
112114

113115

114116
def skip(app, what, name, obj, would_skip, options):
115-
if name.startswith('_'):
117+
if name.startswith("_"):
116118
return True
117119
return would_skip
118120

@@ -134,7 +136,7 @@ def setup(app):
134136
"rhinoscriptsyntax",
135137
"bpy",
136138
"bmesh",
137-
"mathutils"
139+
"mathutils",
138140
]
139141

140142
# graph options
@@ -205,7 +207,7 @@ def patched_parse(self):
205207
plot_include_source = False
206208
plot_html_show_source_link = False
207209
plot_html_show_formats = False
208-
plot_formats = ['png']
210+
plot_formats = ["png"]
209211
# plot_pre_code
210212
# plot_basedir
211213
# plot_rcparams
@@ -237,26 +239,26 @@ def patched_parse(self):
237239

238240

239241
def linkcode_resolve(domain, info):
240-
if domain != 'py':
242+
if domain != "py":
241243
return None
242-
if not info['module']:
244+
if not info["module"]:
243245
return None
244-
if not info['fullname']:
246+
if not info["fullname"]:
245247
return None
246248

247-
package = info['module'].split('.')[0]
248-
if not package.startswith('compas'):
249+
package = info["module"].split(".")[0]
250+
if not package.startswith("compas"):
249251
return None
250252

251-
module = importlib.import_module(info['module'])
252-
parts = info['fullname'].split('.')
253+
module = importlib.import_module(info["module"])
254+
parts = info["fullname"].split(".")
253255

254256
if len(parts) == 1:
255-
obj = getattr(module, info['fullname'])
257+
obj = getattr(module, info["fullname"])
256258
mod = inspect.getmodule(obj)
257259
if not mod:
258260
return None
259-
filename = mod.__name__.replace('.', '/')
261+
filename = mod.__name__.replace(".", "/")
260262
lineno = inspect.getsourcelines(obj)[1]
261263
elif len(parts) == 2:
262264
obj_name, attr_name = parts
@@ -266,7 +268,7 @@ def linkcode_resolve(domain, info):
266268
mod = inspect.getmodule(attr)
267269
if not mod:
268270
return None
269-
filename = mod.__name__.replace('.', '/')
271+
filename = mod.__name__.replace(".", "/")
270272
lineno = inspect.getsourcelines(attr)[1]
271273
else:
272274
return None
@@ -281,7 +283,7 @@ def linkcode_resolve(domain, info):
281283

282284
extlinks = {
283285
"rhino": ("https://developer.rhino3d.com/api/RhinoCommon/html/T_%s.htm", "%s"),
284-
"blender": ("https://docs.blender.org/api/2.93/%s.html", "%s")
286+
"blender": ("https://docs.blender.org/api/2.93/%s.html", "%s"),
285287
}
286288

287289
# -- Options for HTML output ----------------------------------------------
@@ -292,7 +294,7 @@ def linkcode_resolve(domain, info):
292294
"navbar_active": "compas",
293295
"package_version": release,
294296
"package_docs": "https://compas.dev/compas/",
295-
"package_old_versions_txt": "https://compas.dev/compas/doc_versions.txt"
297+
"package_old_versions_txt": "https://compas.dev/compas/doc_versions.txt",
296298
}
297299
html_context = {}
298300
html_static_path = sphinx_compas_theme.get_html_static_path()

docs/tutorial/artists/try_artists_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
artist = Artist(network)
1515
artist.draw(
1616
nodecolor={n: Color.pink() for n in [node] + nbrs},
17-
edgecolor={e: Color.pink() for e in edges}
17+
edgecolor={e: Color.pink() for e in edges},
1818
)
1919

2020
Artist.redraw()

docs/tutorial/artists/try_artists_shapes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Cone(Circle(Plane([0, 0, 0], [0, 0, 1]), 0.3), 1.0),
1313
Capsule([[0, 0, 0], [1, 0, 0]], 0.2),
1414
Torus(Plane([0, 0, 0], [0, 0, 1]), 1.0, 0.3),
15-
Polyhedron.from_platonicsolid(12)
15+
Polyhedron.from_platonicsolid(12),
1616
]
1717

1818
cloud = Pointcloud.from_bounds(8, 5, 3, len(shapes))

docs/tutorial/assembly_blocks.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
assembly = Assembly()
1616

17-
a = Part(name='A',
18-
geometry=Box.from_width_height_depth(1, 1, 1))
19-
20-
b = Part(name='B',
21-
frame=Frame([0, 0, 1], [1, 0, 0], [0, 1, 0]),
22-
shape=Box.from_width_height_depth(1, 1, 1),
23-
features=[(Cylinder(Circle(Plane.worldXY(), 0.2), 1.0), 'difference')])
17+
a = Part(name="A", geometry=Box.from_width_height_depth(1, 1, 1))
18+
19+
b = Part(
20+
name="B",
21+
frame=Frame([0, 0, 1], [1, 0, 0], [0, 1, 0]),
22+
shape=Box.from_width_height_depth(1, 1, 1),
23+
features=[(Cylinder(Circle(Plane.worldXY(), 0.2), 1.0), "difference")],
24+
)
2425

2526
b.transform(Rotation.from_axis_and_angle([0, 0, 1], radians(45)))
2627
b.transform(Translation.from_vector([0, 0, 1]))

docs/tutorial/curves_and_surfaces/curve_closest_point.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
Artist.clear()
2121

22-
Artist(curve, color=Color.from_hex('#0092D2')).draw()
22+
Artist(curve, color=Color.from_hex("#0092D2")).draw()
2323

2424
Artist(projection_point).draw()
2525
Artist(closest_point).draw()

docs/tutorial/curves_and_surfaces/curve_comparison1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
weights=[1.0, 1.0, 1.0],
1616
knots=[0.0, 1.0],
1717
multiplicities=[3, 3],
18-
degree=2
18+
degree=2,
1919
)
2020

2121
curve2 = NurbsCurve.from_parameters(
2222
points=points,
2323
weights=[1.0, 2.0, 1.0],
2424
knots=[0.0, 1.0],
2525
multiplicities=[3, 3],
26-
degree=2
26+
degree=2,
2727
)
2828

2929
curve3 = NurbsCurve.from_parameters(
3030
points=points,
3131
weights=[1.0, 1.0, 1.0],
3232
knots=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0],
3333
multiplicities=[1, 1, 1, 1, 1, 1],
34-
degree=2
34+
degree=2,
3535
)
3636

3737
# ==============================================================================

docs/tutorial/curves_and_surfaces/curve_comparison2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,39 @@
1515
weights=[1.0, 1.0, 1.0, 1.0],
1616
knots=[0.0, 1.0],
1717
multiplicities=[4, 4],
18-
degree=3
18+
degree=3,
1919
)
2020

2121
curve2 = NurbsCurve.from_parameters(
2222
points=points,
2323
weights=[1.0, 2.0, 2.0, 1.0],
2424
knots=[0.0, 1.0],
2525
multiplicities=[4, 4],
26-
degree=3
26+
degree=3,
2727
)
2828

2929
curve3 = NurbsCurve.from_parameters(
3030
points=points,
3131
weights=[1.0, 1.0, 1.0, 1.0],
32-
knots=[0.0, 1/3, 2/3, 1.0],
32+
knots=[0.0, 1 / 3, 2 / 3, 1.0],
3333
multiplicities=[3, 1, 1, 3],
34-
degree=3
34+
degree=3,
3535
)
3636

3737
curve4 = NurbsCurve.from_parameters(
3838
points=points,
3939
weights=[1.0, 1.0, 1.0, 1.0],
40-
knots=[0.0, 1/5, 2/5, 3/5, 4/5, 1.0],
40+
knots=[0.0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1.0],
4141
multiplicities=[2, 1, 1, 1, 1, 2],
42-
degree=3
42+
degree=3,
4343
)
4444

4545
curve5 = NurbsCurve.from_parameters(
4646
points=points,
4747
weights=[1.0, 1.0, 1.0, 1.0],
48-
knots=[0.0, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1.0],
48+
knots=[0.0, 1 / 7, 2 / 7, 3 / 7, 4 / 7, 5 / 7, 6 / 7, 1.0],
4949
multiplicities=[1, 1, 1, 1, 1, 1, 1, 1],
50-
degree=3
50+
degree=3,
5151
)
5252

5353
# curve6 = NurbsCurve.from_parameters(

docs/tutorial/curves_and_surfaces/curve_from_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
weights=[1.0, 1.0, 1.0, 1.0],
1313
knots=[0.0, 1.0],
1414
multiplicities=[4, 4],
15-
degree=3
15+
degree=3,
1616
)
1717

1818
# ==============================================================================

0 commit comments

Comments
 (0)