Index: trunk/tests/test_extract_data.py =================================================================== diff -u -r116 -r120 --- trunk/tests/test_extract_data.py (.../test_extract_data.py) (revision 116) +++ trunk/tests/test_extract_data.py (.../test_extract_data.py) (revision 120) @@ -16,73 +16,6 @@ class Test_get_era5: @pytest.mark.systemtest - def test_extract_non_gridded_then_gridded(self): - self.test_extract_nongridded_data() - self.test_extract_gridded_data() - - @pytest.mark.systemtest - def test_extract_nongridded_data(self): - acceptance_folder = TestUtils.get_local_test_data_dir('acceptance_tests\\data') - DS = Dataset(os.path.join(acceptance_folder, 'NS_WAM_ERA5.nc')) - assert DS - lonWAM = DS.variables['lon'][:] - latWAM = DS.variables['lat'][:] - - coordsWAM = {'LON': [], 'LAT': []} - for i, j in zip(lonWAM, latWAM): - coordsWAM['LON'].append(i) - coordsWAM['LAT'].append(j) - - # set other data variables - variables = [] # saved names of the entries - for i in DS.variables: - print(i, DS.variables[i].shape) - variables.append(i) - varWAM = [v.lower() for v in variables[5:]] - timeWAMy = [1981] # 1987 to 2018 - - # use the SDToolBox function to create input data - Input_DataWAM = InputData( - input_coordinates=coordsWAM, - input_variables=varWAM, - input_scenarios=['era5'], - input_years=timeWAMy) # default is_gridded is false, referring to points - - # use the SDToolBox function to extract data - # dir_test_data = 'P:\\metocean-data\\open\\ERA5\\data\\Global' - dir_test_data = TestUtils.get_local_test_data_dir('era5_test_data') - extracted_data = ExtractData.get_era_5(dir_test_data, Input_DataWAM) - assert extracted_data is not None - - - @pytest.mark.systemtest - def test_extract_gridded_data(self): - steplon = 0.5 # degrees - lonl = -5 # left lon value - lonr = 11 # right lon value - steplat = 0.5 - latl = 50 # lower lat value - latu = 62 # upper lat value - xrang = np.arange(lonl, lonr+steplon, steplon).tolist() - yrang = np.arange(latl, latu+steplat, steplat).tolist() - - coordsBOX = {'LON': xrang, 'LAT': yrang} - timeWAMy = [1981] # 1987 to 2018 - # use the SDToolBox function to create input data - Input_DataBOX = InputData( - input_coordinates=coordsBOX, - input_variables=['msl'], - input_scenarios=['era5'], - input_years=timeWAMy, - is_gridded = True) - # dir_test_data = 'P:\\metocean-data\\open\\ERA5\\data\\Global' - dir_test_data = TestUtils.get_local_test_data_dir('era5_test_data') - extracted_data = ExtractData.get_era_5(dir_test_data, Input_DataBOX) - - assert extracted_data is not None - - - @pytest.mark.systemtest def test_given_list_of_coordinates_then_subset_is_extracted(self): # 1. Given # When using local data you can just replace the comment in these lines