Skip to content

Commit 41a4386

Browse files
authored
Merge branch 'main' into rajeeja/issue_1098
2 parents 6dc2954 + 7760ab6 commit 41a4386

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Upload code coverage to Codecov
7777
if: github.repository == 'UXARRAY/uxarray'
78-
uses: codecov/[email protected].1
78+
uses: codecov/[email protected].2
7979
env:
8080
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8181
with:

benchmarks/mpas_ocean.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def time_inverse_distance_weighted_remapping(self):
138138

139139
class HoleEdgeIndices(DatasetBenchmark):
140140
def time_construct_hole_edge_indices(self, resolution):
141-
ux.grid.geometry._construct_hole_edge_indices(self.uxds.uxgrid.edge_face_connectivity)
141+
ux.grid.geometry._construct_boundary_edge_indices(self.uxds.uxgrid.edge_face_connectivity)
142142

143143

144144
class DualMesh(DatasetBenchmark):
@@ -167,10 +167,19 @@ def time_check_norm(self, resolution):
167167
from uxarray.grid.validation import _check_normalization
168168
_check_normalization(self.uxgrid)
169169

170+
class CrossSection:
171+
param_names = DatasetBenchmark.param_names + ['lat_step']
172+
params = DatasetBenchmark.params + [[1, 2, 4]]
170173

171-
class CrossSections(DatasetBenchmark):
172-
param_names = DatasetBenchmark.param_names + ['n_lat']
173-
params = DatasetBenchmark.params + [[1, 2, 4, 8]]
174-
def time_constant_lat_fast(self, resolution, n_lat):
175-
for lat in np.linspace(-89, 89, n_lat):
176-
self.uxds.uxgrid.constant_latitude_cross_section(lat, method='fast')
174+
def setup(self, resolution, lat_step):
175+
self.uxgrid = ux.open_grid(file_path_dict[resolution][0])
176+
self.uxgrid.normalize_cartesian_coordinates()
177+
self.lats = np.arange(-45, 45, lat_step)
178+
_ = self.uxgrid.bounds
179+
180+
def teardown(self, resolution, lat_step):
181+
del self.uxgrid
182+
183+
def time_const_lat(self, resolution, lat_step):
184+
for lat in self.lats:
185+
self.uxgrid.cross_section.constant_latitude(lat)

uxarray/cross_sections/dataarray_accessor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def constant_latitude(self, lat: float):
4646
Examples
4747
--------
4848
>>> # Extract data at 15.5°S latitude
49-
>>> cross_section = uxda.constant_latitude(lat=-15.5)
49+
>>> cross_section = uxda.cross_section.constant_latitude(lat=-15.5)
5050
5151
Notes
5252
-----
@@ -86,7 +86,7 @@ def constant_longitude(self, lon: float):
8686
Examples
8787
--------
8888
>>> # Extract data at 0° longitude
89-
>>> cross_section = uxda.constant_latitude(lon=0.0)
89+
>>> cross_section = uxda.cross_section.constant_latitude(lon=0.0)
9090
9191
Notes
9292
-----

uxarray/cross_sections/grid_accessor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def constant_latitude(
5151
Examples
5252
--------
5353
>>> # Extract data at 15.5°S latitude
54-
>>> cross_section = grid.constant_latitude(lat=-15.5)
54+
>>> cross_section = grid.cross_section.constant_latitude(lat=-15.5)
5555
5656
Notes
5757
-----
@@ -103,7 +103,7 @@ def constant_longitude(
103103
Examples
104104
--------
105105
>>> # Extract data at 0° longitude
106-
>>> cross_section = grid.constant_latitude(lon=0.0)
106+
>>> cross_section = grid.cross_section.constant_latitude(lon=0.0)
107107
108108
Notes
109109
-----

0 commit comments

Comments
 (0)