File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222from uxarray .cross_sections import GridCrossSectionAccessor
2323from uxarray .formatting_html import grid_repr
2424from 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
2626from 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.
Original file line number Diff line number Diff line change 22
33import numpy as np
44import polars as pl
5- import xarray as xr
65
76from 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
You can’t perform that action at this time.
0 commit comments