Example #1
0
 def test_dimension_variable_name_mismatch(self):
     self.netcdf = netCDF4.Dataset(self.invalid_netcdf_path, mode='r')
     self.lat = local._get_netcdf_variable_name(
         ["lat_dim"] + local.LAT_NAMES,
         self.netcdf,
         "value")
     self.assertEquals(self.lat, "latitude")
Example #2
0
 def test_dimension_variable_name_mismatch(self):
     self.netcdf = netCDF4.Dataset(self.invalid_netcdf_path, mode='r')
     self.lat = local._get_netcdf_variable_name(
         ["lat_dim"] + local.LAT_NAMES,
         self.netcdf,
         "value")
     self.assertEquals(self.lat, "latitude")
 def test_invalid_dimension_latitude(self):
     """Test than an invalid  latitude variable can be found in file."""
     self.netcdf = netCDF4.Dataset(self.invalid_netcdf_path, mode='r')
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES,
                                                self.netcdf,
                                                "value")
     self.assertEquals(self.lat, "latitude")
Example #4
0
 def test_no_match_latitude(self):
     with self.assertRaises(ValueError):
         self.lat = local._get_netcdf_variable_name(['notAVarName'],
                                                    self.netcdf,
                                                    "tasmax")
Example #5
0
 def test_valid_latitude(self):
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES,
                                                self.netcdf,
                                                "tasmax")
     self.assertEquals(self.lat, "rlat")
Example #6
0
 def test_valid_latitude(self):
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES,
                                                self.netcdf, "tasmax")
     self.assertEquals(self.lat, "rlat")
Example #7
0
 def test_no_match_latitude(self):
     with self.assertRaises(ValueError):
         self.lat = local._get_netcdf_variable_name(['notAVarName'],
                                                    self.netcdf, "tasmax")
Example #8
0
 def test_no_match_latitude(self):
     """Test that retrieving a nonexistent variable name raises exception."""
     with self.assertRaises(ValueError):
         self.lat = local._get_netcdf_variable_name(['notAVarName'],
                                                    self.netcdf, "tasmax")
Example #9
0
 def test_invalid_dimension_latitude(self):
     """Test than an invalid  latitude variable can be found in file."""
     self.netcdf = netCDF4.Dataset(self.invalid_netcdf_path, mode='r')
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES,
                                                self.netcdf, "value")
     self.assertEquals(self.lat, "latitude")
Example #10
0
 def test_valid_latitude(self):
     """Test that a latitude variable (rlat) can be found in netCDF file."""
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES,
                                                self.netcdf, "tasmax")
     self.assertEquals(self.lat, "rlat")
Example #11
0
 def test_invalid_dimension_latitude(self):
     self.netcdf = netCDF4.Dataset(self.invalid_netcdf_path, mode="r")
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES, self.netcdf, "value")
     self.assertEquals(self.lat, "latitude")
 def test_no_match_latitude(self):
     """Test that retrieving a nonexistent variable name raises exception."""
     with self.assertRaises(ValueError):
         self.lat = local._get_netcdf_variable_name(['notAVarName'],
                                                    self.netcdf,
                                                    "tasmax")
 def test_valid_latitude(self):
     """Test that a latitude variable (rlat) can be found in netCDF file."""
     self.lat = local._get_netcdf_variable_name(local.LAT_NAMES,
                                                self.netcdf,
                                                "tasmax")
     self.assertEquals(self.lat, "rlat")