Skip to content

Commit 723cb47

Browse files
Prefix all internal api functions with "_"
1 parent eddb351 commit 723cb47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parcels/spatialhash.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _hash_cell_size(self):
7979
"""Computes the size of the hash cells from the source grid.
8080
The hash cell size is set to 1/2 of the square root of the curvilinear cell area
8181
"""
82-
return np.sqrt(np.median(planar_quad_area(self._source_grid.lat, self._source_grid.lon))) * 0.5
82+
return np.sqrt(np.median(_planar_quad_area(self._source_grid.lat, self._source_grid.lon))) * 0.5
8383

8484
def _hash_index2d(self, coords):
8585
"""Computes the 2-d hash index (i,j) for the location (x,y), where x and y are given in spherical
@@ -112,7 +112,7 @@ def _initialize_face_hash_table(self):
112112
if self._face_hash_table is None or self.reconstruct:
113113
index_to_face = [[] for i in range(self._nx * self._ny)]
114114
# Get the bounds of each curvilinear faces
115-
lat_bounds, lon_bounds = curvilinear_grid_facebounds(
115+
lat_bounds, lon_bounds = _curvilinear_grid_facebounds(
116116
self._source_grid.lat,
117117
self._source_grid.lon,
118118
)
@@ -239,7 +239,7 @@ def _barycentric_coordinates(nodes, point, min_area=1e-8):
239239
return barycentric_coords
240240

241241

242-
def planar_quad_area(lat, lon):
242+
def _planar_quad_area(lat, lon):
243243
"""Computes the area of each quadrilateral face in a curvilinear grid.
244244
The lon and lat arrays are assumed to be 2D arrays of points with dimensions (n_y, n_x).
245245
The area is computed using the Shoelace formula.
@@ -272,7 +272,7 @@ def planar_quad_area(lat, lon):
272272
return area
273273

274274

275-
def curvilinear_grid_facebounds(lat, lon):
275+
def _curvilinear_grid_facebounds(lat, lon):
276276
"""Computes the bounds of each curvilinear face in the grid.
277277
The lon and lat arrays are assumed to be 2D arrays of points with dimensions (n_y, n_x).
278278
The bounds are for faces whose corner node vertices are defined by lat,lon.

0 commit comments

Comments
 (0)