Skip to content

Commit e7ed52e

Browse files
authored
Nd bounding box intersected_with doc (#1186)
* Updated documentation and clarified cases for intersected_with method in nd_bounding_box * updated changelog * changed documentation according to PR comments * format changes correctly
1 parent 67b2333 commit e7ed52e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1717
### Added
1818

1919
### Changed
20+
- Updated and clarified documentation for nd_bounding_box intersected_with method
2021

2122
### Fixed
2223
- Fixed an issue with cattrs v24.1.0. [#1184](https://github.com/scalableminds/webknossos-libs/pull/1184)

webknossos/webknossos/geometry/nd_bounding_box.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,13 @@ def padded_with_margins(
554554
def intersected_with(self: _T, other: _T, dont_assert: bool = False) -> _T:
555555
"""
556556
Returns the intersection of two bounding boxes.
557-
558-
If dont_assert is set to False, this method may return empty bounding boxes (size == (0, 0, 0))
557+
If there is no intersection (resulting bounding box is empty) and dont_assert is False (default)
558+
the function raises an assertion error.
559+
If dont_assert is set to True this method returns an empty bounding box if there is no intersection.
559560
560561
Args:
561562
other (NDBoundingBox): The other bounding box to intersect with.
562-
dont_assert (bool): If True, the method may return empty bounding boxes.
563+
dont_assert (bool): If True, the method may return an empty bounding box. Default is False.
563564
564565
Returns:
565566
NDBoundingBox: The intersection of the two bounding boxes.

0 commit comments

Comments
 (0)