Skip to content

Commit

Permalink
Validation should succeed for time when exposure == 0.0 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
SharonGoliath authored and andamian committed Jun 12, 2018
1 parent aed7d45 commit ef5dc77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions caom2utils/caom2utils/tests/test_wcsvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_bad_temporalwcs(self):
bad_temporal_wcs = TimeTestUtil.bad_range_wcs()
with pytest.raises(InvalidWCSError) as ex:
wcsvalidator._validate_temporal_wcs(bad_temporal_wcs)
assert('range.end not > range.start' in str(ex))
assert('range.end not >= range.start' in str(ex))

bad_temporal_wcs = TimeTestUtil.bad_delta()
with pytest.raises(InvalidWCSError) as ex:
Expand Down Expand Up @@ -281,8 +281,8 @@ def bad_range_wcs():
c3 = wcs.RefCoord(px + nx * 0.66, sx + nx * ds * 0.66)
c4 = wcs.RefCoord(px + nx, sx + nx * ds)
temporal_wcs.axis.bounds = wcs.CoordBounds1D()
temporal_wcs.axis.bounds.samples.append(wcs.CoordRange1D(c1, c2))
temporal_wcs.axis.bounds.samples.append(wcs.CoordRange1D(c3, c4))
temporal_wcs.axis.bounds.samples.append(wcs.CoordRange1D(c1, c3))
temporal_wcs.axis.bounds.samples.append(wcs.CoordRange1D(c4, c2))

return temporal_wcs

Expand Down
4 changes: 2 additions & 2 deletions caom2utils/caom2utils/wcs_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def range1d_to_interval(temporal_wcs, range_1d):
# since they are offsets from mjdref
a = range_1d.start.val
b = range_1d.end.val
if b <= a:
raise ValueError("range.end not > range.start in Temporal WCS")
if b < a:
raise ValueError("range.end not >= range.start in Temporal WCS")

if temporal_wcs.mjdref is not None:
a += float(temporal_wcs.mjdref)
Expand Down

0 comments on commit ef5dc77

Please sign in to comment.