def test_time_values(self): ancillary_var = AncillaryVariable( np.array([2, 5, 9]), units="hours since 1970-01-01 01:00", long_name="time of previous valid detection", ) expected = ( "<AncillaryVariable: time of previous valid detection / (hours since 1970-01-01 01:00) " "[...] shape(3,)>") self.assertEqual(expected, ancillary_var.__repr__())
def test_time_values(self): ancillary_var = AncillaryVariable( np.array([2, 5, 9]), units='hours since 1970-01-01 01:00', long_name='time of previous valid detection') expected = ("AncillaryVariable(array([2, 5, 9]), standard_name=None, " "units=Unit('hours since 1970-01-01 01:00', " "calendar='gregorian'), " "long_name='time of previous valid detection')") self.assertEqual(expected, ancillary_var.__repr__())
def test_non_time_values(self): ancillary_var = AncillaryVariable( np.array([2, 5, 9]), standard_name="height", long_name="height of detector", var_name="height", units="m", attributes={"notes": "Measured from sea level"}, ) expected = "<AncillaryVariable: height / (m) [2, 5, 9] shape(3,)>" self.assertEqual(expected, ancillary_var.__repr__())
def test_non_time_values(self): ancillary_var = AncillaryVariable( np.array([2, 5, 9]), standard_name="height", long_name="height of detector", var_name="height", units="m", attributes={"notes": "Measured from sea level"}, ) expected = ( "AncillaryVariable(array([2, 5, 9]), " "standard_name='height', units=Unit('m'), " "long_name='height of detector', var_name='height', " "attributes={'notes': 'Measured from sea level'})" ) self.assertEqual(expected, ancillary_var.__repr__())