def setUp(self): """Set up cube """ data = np.array([0.1, 0.3, 0.4, 0.2, 0.6, 0.7, 0.4, 0.2, 0.1, 0.2, 0.2, 0.5, 0.1, 0.3, 0.9, 0.8, 0.5, 0.3, 0.6, 0.3, 0.5, 0.6, 0.8, 0.2, 0.8, 0.1, 0.2]).reshape(3, 1, 3, 3) self.cube = set_up_probability_threshold_cube( data, 'air_temperature', 'K', spp__relative_to_threshold='above') self.wxcode = np.array(list(WX_DICT.keys())) self.wxmeaning = " ".join(WX_DICT.values())
def setUp(self): """Set up cube """ data = np.array([0, 1, 5, 11, 20, 5, 9, 10, 4, 2, 0, 1, 29, 30, 1, 5, 6, 6]).reshape(2, 1, 3, 3) self.cube = set_up_cube(data, 'air_temperature', 'K', realizations=np.array([0, 1])) self.wxcode = np.array(WX_DICT.keys()) self.wxmeaning = " ".join(WX_DICT.values()) self.data_directory = mkdtemp() self.nc_file = self.data_directory + '/wxcode.nc' Call(['touch', self.nc_file])
def setUp(self): """Set up cube """ data = np.array( [0, 1, 5, 11, 20, 5, 9, 10, 4, 2, 0, 1, 29, 30, 1, 5, 6, 6], dtype=np.int32).reshape(2, 1, 3, 3) self.cube = set_up_cube(data, 'air_temperature', 'K', realizations=np.array([0, 1], dtype=np.int32)) self.wxcode = np.array(list(WX_DICT.keys())) self.wxmeaning = " ".join(WX_DICT.values()) self.data_directory = mkdtemp() self.nc_file = self.data_directory + '/wxcode.nc' pathlib.Path(self.nc_file).touch(exist_ok=True)
def setUp(self): """Set up for update_daynight class""" self.wxcode = np.array(list(WX_DICT.keys())) self.wxmeaning = " ".join(WX_DICT.values()) self.cube_data = np.array( [[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17], [18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18], [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20], [23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23], [26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26], [27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27], [29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29]]])
def setUp(self): """ Set up wxcubes for testing. """ self.cubes = set_up_wxcubes() self.wxcode = np.array(list(WX_DICT.keys())) self.wxmeaning = " ".join(WX_DICT.values())