Skip to content

Commit

Permalink
Merge pull request #1401 from compas-dev/fix-doctest
Browse files Browse the repository at this point in the history
Fix remaining/new doctest failures
  • Loading branch information
tomvanmele authored Oct 24, 2024
2 parents fa49860 + 86f3912 commit 166ac9d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fixed bug in `Box.scaled` causing a `TypeError` due to incorrect parameter forwarding.
* 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.
* Fixed import errors in `compas_rhino.conduits` for Rhino 8.
* Fixed doctest failures.
* Fixed bug in serialization when `compas.datastructures.attributes.AttributeView` is used.

### Removed
Expand Down
12 changes: 6 additions & 6 deletions src/compas/colors/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Color(Data):
By default, this class will create a color with the RGB components in the range ``[0.0, 1.0]``.
>>> Color(1, 0, 0)
Color(1, 0, 0, alpha=1.0)
Color(red=1, green=0, blue=0, alpha=1.0)
Attempting to create a color with components outside of the range ``[0.0, 1.0]`` will raise a ``ValueError``.
Expand All @@ -111,7 +111,7 @@ class Color(Data):
To create a color with components in the range ``[0, 255]``, use the :meth:`from_rgb255` constructor.
>>> Color.from_rgb255(255, 0, 0)
Color(1.0, 0.0, 0.0, alpha=1.0)
Color(red=1.0, green=0.0, blue=0.0, alpha=1.0)
Similarly, other constructors are available to create colors from other color spaces.
Expand All @@ -132,13 +132,13 @@ class Color(Data):
>>> color = Color.red()
>>> color.desaturated(25)
Color(0.875, 0.125, 0.125, alpha=1.0)
Color(red=0.875, green=0.125, blue=0.125, alpha=1.0)
>>> color.desaturated(50)
Color(0.75, 0.25, 0.25, alpha=1.0)
Color(red=0.75, green=0.25, blue=0.25, alpha=1.0)
>>> color.desaturated(75)
Color(0.625, 0.375, 0.375, alpha=1.0)
Color(red=0.625, green=0.375, blue=0.375, alpha=1.0)
>>> color.desaturated(100)
Color(0.5, 0.5, 0.5, alpha=1.0)
Color(red=0.5, green=0.5, blue=0.5, alpha=1.0)
See Also
--------
Expand Down
1 change: 1 addition & 0 deletions src/compas/datastructures/tree/hashtree.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import hashlib

from compas.data import Data
Expand Down
5 changes: 2 additions & 3 deletions src/compas/scene/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def clear(self, clear_scene=True, clear_context=True):
-----
To redraw the scene, without modifying any of the other objects in the visualisation context:
>>> scene.clear(clear_scene=False, clear_context=True)
>>> scene.draw()
>>> scene.clear(clear_scene=False, clear_context=True) # doctest: +SKIP
>>> scene.draw() # doctest: +SKIP
"""
guids = []
Expand Down Expand Up @@ -209,7 +209,6 @@ def redraw(self):
before drawing all scene objects in the scene tree.
"""

self.clear(clear_scene=False, clear_context=True)
self.draw()

Expand Down

0 comments on commit 166ac9d

Please sign in to comment.