Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/io/test_healpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,17 @@ def test_healpix_round_trip_consistency(tmp_path):
# Validate grid dimensions are preserved
assert reloaded_ugrid.n_face == original_grid.n_face
assert reloaded_exodus.n_face == original_grid.n_face

def test_healpix_grid_attr_access_order():
"""Ensure can access node_lon & node_lat attributes of healpix grid in any order.
(If problem turns out to exists with other attributes, can add them here later.)
Regression test for #1637.
"""
grid = ux.Grid.from_healpix(zoom=1)
grid.node_lon
grid.node_lat

# just making sure this doesn't crash:
grid = ux.Grid.from_healpix(zoom=1)
grid.node_lat
grid.node_lon
2 changes: 1 addition & 1 deletion uxarray/grid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ def node_lat(self) -> xr.DataArray:
"""
if "node_lat" not in self._ds:
if self.source_grid_spec == "HEALPix":
_populate_healpix_boundaries(self)
_populate_healpix_boundaries(self._ds)
else:
_set_desired_longitude_range(self)
_populate_node_latlon(self)
Expand Down