Skip to content

Commit 3983110

Browse files
committed
Fix remaining/new doctest failures
1 parent 040a902 commit 3983110

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Fixed bug in `Box.scaled` causing a `TypeError` due to incorrect parameter forwarding.
1616
* Changed argument names of `Box.scale()` to `x`, `y`, `z`, instead of `factor` and made `y` and `z` optional to keep positional arguments backwards compatible.
1717
* Fixed import errors in `compas_rhino.conduits` for Rhino 8.
18+
* Fixed doctest failures.
1819

1920
### Removed
2021

src/compas/colors/color.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Color(Data):
9999
By default, this class will create a color with the RGB components in the range ``[0.0, 1.0]``.
100100
101101
>>> Color(1, 0, 0)
102-
Color(1, 0, 0, alpha=1.0)
102+
Color(red=1, green=0, blue=0, alpha=1.0)
103103
104104
Attempting to create a color with components outside of the range ``[0.0, 1.0]`` will raise a ``ValueError``.
105105
@@ -111,7 +111,7 @@ class Color(Data):
111111
To create a color with components in the range ``[0, 255]``, use the :meth:`from_rgb255` constructor.
112112
113113
>>> Color.from_rgb255(255, 0, 0)
114-
Color(1.0, 0.0, 0.0, alpha=1.0)
114+
Color(red=1.0, green=0.0, blue=0.0, alpha=1.0)
115115
116116
Similarly, other constructors are available to create colors from other color spaces.
117117
@@ -132,13 +132,13 @@ class Color(Data):
132132
133133
>>> color = Color.red()
134134
>>> color.desaturated(25)
135-
Color(0.875, 0.125, 0.125, alpha=1.0)
135+
Color(red=0.875, green=0.125, blue=0.125, alpha=1.0)
136136
>>> color.desaturated(50)
137-
Color(0.75, 0.25, 0.25, alpha=1.0)
137+
Color(red=0.75, green=0.25, blue=0.25, alpha=1.0)
138138
>>> color.desaturated(75)
139-
Color(0.625, 0.375, 0.375, alpha=1.0)
139+
Color(red=0.625, green=0.375, blue=0.375, alpha=1.0)
140140
>>> color.desaturated(100)
141-
Color(0.5, 0.5, 0.5, alpha=1.0)
141+
Color(red=0.5, green=0.5, blue=0.5, alpha=1.0)
142142
143143
See Also
144144
--------

src/compas/datastructures/tree/hashtree.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,21 @@ class HashTree(Tree):
117117
>>> tree1 = HashTree.from_dict({"a": {"b": 1, "c": 3}, "d": [1, 2, 3], "e": 2})
118118
>>> tree2 = HashTree.from_dict({"a": {"b": 1, "c": 2}, "d": [1, 2, 3], "f": 2})
119119
>>> print(tree1)
120-
+-- ROOT @ 4cd56
121-
+-- .a @ c16fd
122-
| +-- .b:1 @ c9b55
123-
| +-- .c:3 @ 518d4
124-
+-- .d:[1, 2, 3] @ 9be3a
125-
+-- .e:2 @ 68355
120+
<Tree with 6 nodes>
121+
└── ROOT @ 4cd56
122+
├── .a @ c16fd
123+
│ ├── .b:1 @ c9b55
124+
│ └── .c:3 @ 518d4
125+
├── .d:[1, 2, 3] @ 9be3a
126+
└── .e:2 @ 68355
126127
>>> print(tree2)
127-
+-- ROOT @ fbe39
128-
+-- .a @ c2022
129-
| +-- .b:1 @ c9b55
130-
| +-- .c:2 @ e3365
131-
+-- .d:[1, 2, 3] @ 9be3a
132-
+-- .f:2 @ 93861
128+
<Tree with 6 nodes>
129+
└── ROOT @ fbe39
130+
├── .a @ c2022
131+
│ ├── .b:1 @ c9b55
132+
│ └── .c:2 @ e3365
133+
├── .d:[1, 2, 3] @ 9be3a
134+
└── .f:2 @ 93861
133135
>>> tree2.print_diff(tree1)
134136
Added:
135137
{'path': '.f', 'value': 2}

src/compas/scene/scene.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def clear(self, clear_scene=True, clear_context=True):
163163
-----
164164
To redraw the scene, without modifying any of the other objects in the visualisation context:
165165
166-
>>> scene.clear(clear_scene=False, clear_context=True)
167-
>>> scene.draw()
166+
>>> scene.clear(clear_scene=False, clear_context=True) # doctest: +SKIP
167+
>>> scene.draw() # doctest: +SKIP
168168
169169
"""
170170
guids = []
@@ -209,7 +209,6 @@ def redraw(self):
209209
before drawing all scene objects in the scene tree.
210210
211211
"""
212-
213212
self.clear(clear_scene=False, clear_context=True)
214213
self.draw()
215214

0 commit comments

Comments
 (0)