Skip to content

Commit

Permalink
Merge branch '408-remove-numpy-warbning' into 'release'
Browse files Browse the repository at this point in the history
Resolve "Update après release 2.0.0 numpy"

See merge request 3d/PandoraBox/pandora!359
  • Loading branch information
lecontm committed Jul 22, 2024
2 parents 5b106f6 + ebbdf1a commit 4db6bc8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pandora/img_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def shift_right_img(img_right: xr.Dataset, subpix: int, band: str = None) -> Lis
# For each index, shift the right image for subpixel precision 1/subpix*index
data = zoom(selected_band, (1, (nx_ * subpix - (subpix - 1)) / float(nx_)), order=1)[:, ind::subpix]
col = np.arange(
img_right.coords["col"][0] + shift * ind, img_right.coords["col"][-1], step=1
img_right.coords["col"].values[0] + shift * ind, img_right.coords["col"].values[-1], step=1
) # type: np.ndarray
img_right_shift.append(
xr.Dataset(
Expand Down
4 changes: 2 additions & 2 deletions pandora/matching_cost/matching_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def grid_estimation(
:rtype: xarray.Dataset
"""
# Get col dimension
c_col = img["im"].coords["col"]
c_col = img["im"].coords["col"].values

# Get the index of the columns that should be computed
if cfg and "ROI" in cfg:
Expand Down Expand Up @@ -569,7 +569,7 @@ def masks_dilatation(

# Whatever the sub-pixel precision, only one sub-pixel mask is created,
# since 0.5 shifted mask == 0.25 shifted mask
col_shift = np.arange(col[0] + 0.5, col[0] + nx_ - 1, step=1) # type: np.ndarray
col_shift = np.arange(col.values[0] + 0.5, col.values[0] + nx_ - 1, step=1) # type: np.ndarray
dilatate_right_mask_shift = xr.DataArray(
dilatate_right_mask_shift, coords=[row, col_shift], dims=["row", "col"]
)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ setup_requires =

# Pandora packages dependencies
install_requires =
numpy<2.0
numpy
xarray>=0.13.0
scipy
rasterio
Expand Down
4 changes: 2 additions & 2 deletions tests/test_matching_cost/test_matching_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def test_grid_estimation(self, default_input_roi, step, ground_truth_attrs):

# Create ground truth for output of grid_estimation() function
c_row = img_left["im"].coords["row"]
row = np.arange(c_row[0], c_row[-1] + 1)
row = np.arange(c_row.values[0], c_row.values[-1] + 1)

ground_truth = xr.Dataset(
{},
Expand Down Expand Up @@ -435,7 +435,7 @@ def test_grid_estimation_with_roi(self, default_input_roi, roi, step, ground_tru

# Create ground truth for output of grid_estimation() function
c_row = img_left["im"].coords["row"]
row = np.arange(c_row[0], c_row[-1] + 1)
row = np.arange(c_row.values[0], c_row.values[-1] + 1)

ground_truth = xr.Dataset(
{},
Expand Down

0 comments on commit 4db6bc8

Please sign in to comment.