# Box2I(bbox.getMin(), bbox.getMax()) fails for an empty bbox

XMLWordPrintable

## Details

• Type: Improvement
• Status: Invalid
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Templates:
• Story Points:
1
• Team:
Data Release Production

## Description

Empty Box2I cannot be round tripped:

 from lsst.afw.geom import Box2I b1 = Box2I() b2 = Box2I(b1.getMin(), b1.getMax()) assert b2.isEmpty()

It is confusing and surprising that this round tripping fails.

It is also a trap for the unwary because saving min and max is the logical way to store boxes in afw tables. Records can contain points but not extents and so it saves casting back and forth and simplifies and clarifies the code to save max instead of extent. Thus that is the path most users will take, and the problem can be a time bomb: it could be quite some time before somebody tries to store an empty box and finds that it does not get retrieved correctly.

## People

• Assignee:
Jim Bosch
Reporter:
Russell Owen
Watchers:
Jim Bosch, Russell Owen