def test_partial_temporal_overlap(self): '''Ensure that safe_subset can handle out of bounds temporal values''' ds = dp.safe_subset(self.target_dataset, self.temporal_out_of_bounds) temporal_bounds = ds.time_range() start = datetime.datetime(2000, 1, 1) end = datetime.datetime(2009, 12, 1) self.assertEquals(temporal_bounds[0], start) self.assertEquals(temporal_bounds[1], end)
def test_partial_temporal_overlap(self): '''Ensure that safe_subset can handle out of bounds temporal values''' ds = dp.safe_subset(self.temporal_out_of_bounds, self.target_dataset) temporal_bounds = ds.time_range() start = datetime.datetime(2000, 1, 1) end = datetime.datetime(2009, 12, 1) self.assertEquals(temporal_bounds[0], start) self.assertEquals(temporal_bounds[1], end)
def test_entire_bounds_overlap(self): ds = dp.safe_subset(self.everything_out_of_bounds, self.target_dataset) spatial_bounds = ds.spatial_boundaries() temporal_bounds = ds.time_range() start = datetime.datetime(2000, 1, 1) end = datetime.datetime(2009, 12, 1) self.assertEquals(spatial_bounds[0], -60) self.assertEquals(spatial_bounds[1], 60) self.assertEquals(spatial_bounds[2], -170) self.assertEquals(spatial_bounds[3], 170) self.assertEquals(temporal_bounds[0], start) self.assertEquals(temporal_bounds[1], end)