Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Feb 14, 2024
1 parent 3629732 commit ca1bb44
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 53 deletions.
8 changes: 4 additions & 4 deletions compass/ocean/tests/global_ocean/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
from compass.ocean.mesh.remap_topography import RemapTopography
from compass.ocean.tests.global_ocean.mesh.arrm10to60 import ARRM10to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.ec30to60 import EC30to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris01to60 import FRIS01to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris02to60 import FRIS02to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris04to60 import FRIS04to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris08to60 import FRIS08to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.kuroshio import KuroshioBaseMesh
from compass.ocean.tests.global_ocean.mesh.qu import (
IcosMeshFromConfigStep,
QUMeshFromConfigStep,
)
from compass.ocean.tests.global_ocean.mesh.rrs6to18 import RRS6to18BaseMesh
from compass.ocean.tests.global_ocean.mesh.so12to60 import SO12to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris01to60 import FRIS01to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris02to60 import FRIS02to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris04to60 import FRIS04to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.fris08to60 import FRIS08to60BaseMesh
from compass.ocean.tests.global_ocean.mesh.wc14 import WC14BaseMesh
from compass.ocean.tests.global_ocean.metadata import (
get_author_and_email_from_git,
Expand Down
6 changes: 3 additions & 3 deletions compass/ocean/tests/global_ocean/mesh/ec30to60/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import mpas_tools.mesh.creation.mesh_definition_tools as mdt
import numpy as np

from compass.mesh import QuasiUniformSphericalMeshStep

Expand Down Expand Up @@ -28,8 +28,8 @@ def build_cell_width_lat_lon(self):

dlon = 10.
dlat = 0.1
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

Expand Down
23 changes: 13 additions & 10 deletions compass/ocean/tests/global_ocean/mesh/fris01to60/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import numpy as np

import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson
import numpy as np
from geometric_features import read_feature_collection
from mpas_tools.cime.constants import constants
from mpas_tools.mesh.creation.signed_distance import (
signed_distance_from_geojson,
)

from compass.mesh import QuasiUniformSphericalMeshStep

Expand All @@ -30,8 +30,9 @@ def setup(self):
self.add_input_file(filename='fris_v1_peninsula_12km_v2.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)
self.add_input_file(
filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1.geojson',
package=self.__module__)
Expand All @@ -58,8 +59,8 @@ def build_cell_width_lat_lon(self):
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

Expand Down Expand Up @@ -164,7 +165,8 @@ def build_cell_width_lat_lon(self):
cellWidth = dx_min * (1 - weights) + cellWidth * weights

# Add 12 km transition correction west of the peninsula
fc = read_feature_collection('fris_v1_peninsula_12km_transition.geojson')
fc = read_feature_collection(
'fris_v1_peninsula_12km_transition.geojson')

so_signed_distance = signed_distance_from_geojson(fc, lon, lat,
earth_radius,
Expand All @@ -187,7 +189,8 @@ def build_cell_width_lat_lon(self):
earth_radius,
max_length=0.25)

# Equivalent to 100 km (0 should be enough given the setup but to be safe)
# Equivalent to 100 km (0 should be enough given the setup but to be
# safe)
trans_width = 100e3
trans_start = 0
dx_min = dx_min_fris
Expand Down
23 changes: 13 additions & 10 deletions compass/ocean/tests/global_ocean/mesh/fris02to60/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import numpy as np

import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson
import numpy as np
from geometric_features import read_feature_collection
from mpas_tools.cime.constants import constants
from mpas_tools.mesh.creation.signed_distance import (
signed_distance_from_geojson,
)

from compass.mesh import QuasiUniformSphericalMeshStep

Expand All @@ -30,8 +30,9 @@ def setup(self):
self.add_input_file(filename='fris_v1_peninsula_12km_v2.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)
self.add_input_file(
filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1.geojson',
package=self.__module__)
Expand All @@ -58,8 +59,8 @@ def build_cell_width_lat_lon(self):
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

Expand Down Expand Up @@ -164,7 +165,8 @@ def build_cell_width_lat_lon(self):
cellWidth = dx_min * (1 - weights) + cellWidth * weights

# Add 12 km transition correction west of the peninsula
fc = read_feature_collection('fris_v1_peninsula_12km_transition.geojson')
fc = read_feature_collection(
'fris_v1_peninsula_12km_transition.geojson')

so_signed_distance = signed_distance_from_geojson(fc, lon, lat,
earth_radius,
Expand All @@ -187,7 +189,8 @@ def build_cell_width_lat_lon(self):
earth_radius,
max_length=0.25)

# Equivalent to 100 km (0 should be enough given the setup but to be safe)
# Equivalent to 100 km (0 should be enough given the setup but to be
# safe)
trans_width = 100e3
trans_start = 0
dx_min = dx_min_fris
Expand Down
23 changes: 13 additions & 10 deletions compass/ocean/tests/global_ocean/mesh/fris04to60/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import numpy as np

import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson
import numpy as np
from geometric_features import read_feature_collection
from mpas_tools.cime.constants import constants
from mpas_tools.mesh.creation.signed_distance import (
signed_distance_from_geojson,
)

from compass.mesh import QuasiUniformSphericalMeshStep

Expand All @@ -30,8 +30,9 @@ def setup(self):
self.add_input_file(filename='fris_v1_peninsula_12km_v2.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)
self.add_input_file(
filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1.geojson',
package=self.__module__)
Expand All @@ -58,8 +59,8 @@ def build_cell_width_lat_lon(self):
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

Expand Down Expand Up @@ -164,7 +165,8 @@ def build_cell_width_lat_lon(self):
cellWidth = dx_min * (1 - weights) + cellWidth * weights

# Add 12 km transition correction west of the peninsula
fc = read_feature_collection('fris_v1_peninsula_12km_transition.geojson')
fc = read_feature_collection(
'fris_v1_peninsula_12km_transition.geojson')

so_signed_distance = signed_distance_from_geojson(fc, lon, lat,
earth_radius,
Expand All @@ -187,7 +189,8 @@ def build_cell_width_lat_lon(self):
earth_radius,
max_length=0.25)

# Equivalent to 100 km (0 should be enough given the setup but to be safe)
# Equivalent to 100 km (0 should be enough given the setup but to be
# safe)
trans_width = 100e3
trans_start = 0
dx_min = dx_min_fris
Expand Down
23 changes: 13 additions & 10 deletions compass/ocean/tests/global_ocean/mesh/fris08to60/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import numpy as np

import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson
import numpy as np
from geometric_features import read_feature_collection
from mpas_tools.cime.constants import constants
from mpas_tools.mesh.creation.signed_distance import (
signed_distance_from_geojson,
)

from compass.mesh import QuasiUniformSphericalMeshStep

Expand All @@ -30,8 +30,9 @@ def setup(self):
self.add_input_file(filename='fris_v1_peninsula_12km_v2.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)
self.add_input_file(
filename='fris_v1_peninsula_12km_transition.geojson',
package=self.__module__)

self.add_input_file(filename='fris_v1.geojson',
package=self.__module__)
Expand All @@ -58,8 +59,8 @@ def build_cell_width_lat_lon(self):
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

Expand Down Expand Up @@ -164,7 +165,8 @@ def build_cell_width_lat_lon(self):
cellWidth = dx_min * (1 - weights) + cellWidth * weights

# Add 12 km transition correction west of the peninsula
fc = read_feature_collection('fris_v1_peninsula_12km_transition.geojson')
fc = read_feature_collection(
'fris_v1_peninsula_12km_transition.geojson')

so_signed_distance = signed_distance_from_geojson(fc, lon, lat,
earth_radius,
Expand All @@ -187,7 +189,8 @@ def build_cell_width_lat_lon(self):
earth_radius,
max_length=0.25)

# Equivalent to 100 km (0 should be enough given the setup but to be safe)
# Equivalent to 100 km (0 should be enough given the setup but to be
# safe)
trans_width = 100e3
trans_start = 0
dx_min = dx_min_fris
Expand Down
12 changes: 6 additions & 6 deletions compass/ocean/tests/global_ocean/mesh/so12to60/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import numpy as np

import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson
import numpy as np
from geometric_features import read_feature_collection
from mpas_tools.cime.constants import constants
from mpas_tools.mesh.creation.signed_distance import (
signed_distance_from_geojson,
)

from compass.mesh import QuasiUniformSphericalMeshStep

Expand Down Expand Up @@ -46,8 +46,8 @@ def build_cell_width_lat_lon(self):
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
nlon = int(360./dlon) + 1
nlat = int(180./dlat) + 1
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
lon = np.linspace(-180., 180., nlon)
lat = np.linspace(-90., 90., nlat)

Expand Down

0 comments on commit ca1bb44

Please sign in to comment.