Skip to content

Commit

Permalink
adapt to changes in the API of xdggs (#55)
Browse files Browse the repository at this point in the history
* adapt to the changed name of the `grid_info` param

* use the new name of the kwarg
  • Loading branch information
keewis authored Jan 6, 2025
1 parent e258e2b commit 1db0cb5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions healpix_convolution/padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def agg_mode(cell_ids, neighbours, grid_info, *, agg, ring):

pad_neighbours = search_neighbours(
new_cell_ids,
resolution=grid_info.resolution,
resolution=grid_info.level,
indexing_scheme=grid_info.indexing_scheme,
ring=ring,
)
Expand Down Expand Up @@ -226,7 +226,7 @@ def pad(
# plus a method to apply the padding to data.
neighbours = search_neighbours(
cell_ids,
resolution=grid_info.resolution,
resolution=grid_info.level,
indexing_scheme=grid_info.indexing_scheme,
ring=ring,
)
Expand Down
2 changes: 1 addition & 1 deletion healpix_convolution/tests/test_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_gaussian_kernel(self, obj, kwargs):
reconstructed_sigma = reconstruct_sigma(
obj.cell_ids.data,
actual.data,
resolution=grid_info.resolution,
resolution=grid_info.level,
indexing_scheme=grid_info.indexing_scheme,
**kwargs,
)
Expand Down
4 changes: 2 additions & 2 deletions healpix_convolution/tests/test_padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class TestArray:
),
)
def test_pad(self, dask, ring, mode, kwargs, expected_cell_ids, expected_data):
grid_info = xdggs.healpix.HealpixInfo(resolution=4, indexing_scheme="nested")
grid_info = xdggs.healpix.HealpixInfo(level=4, indexing_scheme="nested")
cell_ids = np.array([172, 173])

if not dask:
Expand Down Expand Up @@ -302,7 +302,7 @@ class TestXarray:
def test_pad(
self, dask, ring, mode, kwargs, expected_cell_ids, expected_data, type_
):
grid_info = xdggs.healpix.HealpixInfo(resolution=4, indexing_scheme="nested")
grid_info = xdggs.healpix.HealpixInfo(level=4, indexing_scheme="nested")
cell_ids = np.array([172, 173])

if not dask:
Expand Down
4 changes: 2 additions & 2 deletions healpix_convolution/xarray/kernels/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def compute_ring(grid_info, sigma, kernel_size, truncate):
else:
import healpy as hp

cell_distance = hp.nside2resol(2**grid_info.resolution, arcmin=False)
cell_distance = hp.nside2resol(2**grid_info.level, arcmin=False)
return int((truncate * sigma / cell_distance) // 2)


Expand Down Expand Up @@ -46,7 +46,7 @@ def gaussian_kernel(

padded_cell_ids, matrix = gaussian.gaussian_kernel(
cell_ids.data,
resolution=grid_info.resolution,
resolution=grid_info.level,
indexing_scheme=grid_info.indexing_scheme,
sigma=sigma,
truncate=truncate,
Expand Down

0 comments on commit 1db0cb5

Please sign in to comment.