Skip to content

Commit

Permalink
o changing dtype=np.float64 to dtype=x.dtype, dynamically sets the da…
Browse files Browse the repository at this point in the history
…ta type, it will be more efficient than always converting to np.float64. All tests pass (#837)
  • Loading branch information
rajeeja authored Jul 5, 2024
1 parent b0e0651 commit c428694
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uxarray/grid/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def calculate_face_area(
# Using tempestremap GridElements: https://github.com/ClimateGlobalChange/tempestremap/blob/master/src/GridElements.cpp
# loop through all sub-triangles of face
for j in range(0, num_triangles):
node1 = np.array([x[0], y[0], z[0]], dtype=np.float64)
node2 = np.array([x[j + 1], y[j + 1], z[j + 1]], dtype=np.float64)
node3 = np.array([x[j + 2], y[j + 2], z[j + 2]], dtype=np.float64)
node1 = np.array([x[0], y[0], z[0]], dtype=x.dtype)
node2 = np.array([x[j + 1], y[j + 1], z[j + 1]], dtype=x.dtype)
node3 = np.array([x[j + 2], y[j + 2], z[j + 2]], dtype=x.dtype)

if coords_type == "spherical":
node1 = _lonlat_rad_to_xyz(np.deg2rad(x[0]), np.deg2rad(y[0]))
Expand Down

0 comments on commit c428694

Please sign in to comment.