Skip to content

Commit 1405f61

Browse files
committed
use regular abs, update numba cache check
1 parent a608439 commit 1405f61

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

uxarray/grid/grid.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from uxarray.cross_sections import GridCrossSectionAccessor
2323
from uxarray.formatting_html import grid_repr
2424
from uxarray.grid.area import get_all_face_area_from_coords
25-
from uxarray.grid.bounds import _populate_face_bounds
25+
from uxarray.grid.bounds import _construct_face_bounds_array, _populate_face_bounds
2626
from uxarray.grid.connectivity import (
2727
_populate_edge_face_connectivity,
2828
_populate_edge_node_connectivity,
@@ -1428,7 +1428,7 @@ def bounds(self):
14281428
14291429
"""
14301430
if "bounds" not in self._ds:
1431-
if not is_numba_function_cached(_populate_face_bounds):
1431+
if not is_numba_function_cached(_construct_face_bounds_array):
14321432
warn(
14331433
"Necessary functions for computing the bounds of each face are not yet compiled with Numba. "
14341434
"This initial execution will be significantly longer.",
@@ -1980,8 +1980,6 @@ def normalize_cartesian_coordinates(self):
19801980
self._ds[f"{prefix}_y"] = dy / norm
19811981
self._ds[f"{prefix}_z"] = dz / norm
19821982

1983-
self._normalized = True
1984-
19851983
def to_xarray(self, grid_format: Optional[str] = "ugrid"):
19861984
"""Returns an ``xarray.Dataset`` with the variables stored under the
19871985
``Grid`` encoded in a specific grid format.

uxarray/grid/validation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import numpy as np
44
import polars as pl
5-
import xarray as xr
65

76
from uxarray.constants import ERROR_TOLERANCE, INT_DTYPE
87

@@ -117,7 +116,7 @@ def _check_normalization(grid):
117116
z = grid._ds[f"{name}_z"]
118117

119118
# compute the max deviation from 1.0
120-
max_dev = xr.ufuncs.abs(x**2 + y**2 + z**2 - 1.0).max().compute()
119+
max_dev = abs((x**2 + y**2 + z**2 - 1.0).max().compute())
121120

122121
if max_dev > ERROR_TOLERANCE:
123122
grid._normalized = False

0 commit comments

Comments
 (0)