Skip to content

Commit

Permalink
Check bounding box space spec sith volume space spec to prevent recur…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
AhmetNSimsek committed Apr 10, 2024
1 parent 5845cbc commit 8b1fb9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions siibra/configuration/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def build_volume(cls, spec):
bbox=cls.build_boundingbox(spec)
)
if result._boundingbox is not None:
assert result._boundingbox.space == result.space, "BoundingBox of a volume cannot be in a different space than the volume's space."
assert result._boundingbox._space_spec == result._space_spec, "BoundingBox of a volume cannot be in a different space than the volume's space."

return result

Expand Down Expand Up @@ -358,9 +358,9 @@ def build_boundingbox(cls, spec):
bboxspec = spec.get("boundingbox", None)
if bboxspec is None:
return None
space_id = bboxspec.get("space").get("@id")
space_spec = bboxspec.get("space")
coords = [tuple(c) for c in bboxspec.get("coordinates")]
return boundingbox.BoundingBox(coords[0], coords[1], space=space_id)
return boundingbox.BoundingBox(coords[0], coords[1], space=space_spec)

@classmethod
@build_type("siibra/feature/fingerprint/receptor/v0.1")
Expand Down
2 changes: 1 addition & 1 deletion test/core/test_parcellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_get_region(self, regionspec, find_topmost, allow_tuple, result):


@pytest.mark.parametrize('space_id,parc_id,map_type', [
('waxholm', 'v4', 'labelled')
('waxholm', 'waxholm v4', 'labelled')
])
def test_should_be_able_to_fetch_map(space_id, parc_id, map_type):

Expand Down

0 comments on commit 8b1fb9f

Please sign in to comment.