diff --git a/README.md b/README.md index aa66221..f650717 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Code Health](https://github.com/COSIMA/esmgrids/actions/workflows/ci.yml/badge.svg) +![Tests](https://github.com/COSIMA/esmgrids/actions/workflows/ci.yml/badge.svg) # esmgrids diff --git a/esmgrids/cice_grid.py b/esmgrids/cice_grid.py index 8e7585e..0d10cd1 100644 --- a/esmgrids/cice_grid.py +++ b/esmgrids/cice_grid.py @@ -81,7 +81,7 @@ def fromfile(cls, h_grid_def, mask_file=None, description="CICE tripolar"): description=description, ) - def create_2d_nc_var(self, nc, name): + def _create_2d_nc_var(self, nc, name): # set chunksizes based on OM2 config # To-do: load these from a configuration file? if self.num_lon_points == 360: # 1deg @@ -117,54 +117,54 @@ def write(self, nc): # names are based on https://cfconventions.org/Data/cf-standard-names/current/build/cf-standard-name-table.html nc.Conventions = "CF-1.6" - ulat = self.create_2d_nc_var(nc, "ulat") + ulat = self._create_2d_nc_var(nc, "ulat") ulat.units = "radians" ulat.long_name = "Latitude of U points" ulat.standard_name = "latitude" - ulon = self.create_2d_nc_var(nc, "ulon") + ulon = self._create_2d_nc_var(nc, "ulon") ulon.units = "radians" ulon.long_name = "Longitude of U points" ulon.standard_name = "longitude" - tlat = self.create_2d_nc_var(nc, "tlat") + tlat = self._create_2d_nc_var(nc, "tlat") tlat.units = "radians" tlat.long_name = "Latitude of T points" tlat.standard_name = "latitude" - tlon = self.create_2d_nc_var(nc, "tlon") + tlon = self._create_2d_nc_var(nc, "tlon") tlon.units = "radians" tlon.long_name = "Longitude of T points" tlon.standard_name = "longitude" - htn = self.create_2d_nc_var(nc, "htn") + htn = self._create_2d_nc_var(nc, "htn") htn.units = "cm" htn.long_name = "Width of T cells on North side." htn.coordinates = "ulat tlon" htn.grid_mapping = "crs" - hte = self.create_2d_nc_var(nc, "hte") + hte = self._create_2d_nc_var(nc, "hte") hte.units = "cm" hte.long_name = "Width of T cells on East side." hte.coordinates = "tlat ulon" hte.grid_mapping = "crs" - angle = self.create_2d_nc_var(nc, "angle") + angle = self._create_2d_nc_var(nc, "angle") angle.units = "radians" angle.long_name = "Rotation angle of U cells." angle.standard_name = "angle_of_rotation_from_east_to_x" angle.coordinates = "ulat ulon" angle.grid_mapping = "crs" - angleT = self.create_2d_nc_var(nc, "angleT") + angleT = self._create_2d_nc_var(nc, "angleT") angleT.units = "radians" angleT.long_name = "Rotation angle of T cells." angleT.standard_name = "angle_of_rotation_from_east_to_x" angleT.coordinates = "tlat tlon" angleT.grid_mapping = "crs" - area_t = self.create_2d_nc_var(nc, "tarea") + area_t = self._create_2d_nc_var(nc, "tarea") area_t.units = "m^2" area_t.long_name = "Area of T cells." area_t.standard_name = "cell_area" area_t.coordinates = "tlat tlon" area_t.grid_mapping = "crs" - area_u = self.create_2d_nc_var(nc, "uarea") + area_u = self._create_2d_nc_var(nc, "uarea") area_u.units = "m^2" area_u.long_name = "Area of U cells." area_u.standard_name = "cell_area" diff --git a/test/test_cice_grid.py b/test/test_cice_grid.py index ed1f465..03eb137 100644 --- a/test/test_cice_grid.py +++ b/test/test_cice_grid.py @@ -13,7 +13,7 @@ _test_resolutions = [4, 0.1] -# so that our fixtures are only create once in this pytest module, we need this special version of 'tmp_path' +# so that our fixtures are only created once in this pytest module, we need this special version of 'tmp_path' @pytest.fixture(scope="module") def tmp_path(tmp_path_factory: pytest.TempdirFactory) -> Path: return tmp_path_factory.mktemp("temp")