Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] Modify the deprecated interp2d method into the supported RegularGridInterpolator method #508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CloudRipple
Copy link

将不受新版本SciPy支持的方法interp2d,修改为受支持的RegularGridInterpolator方法
Modify the method interp2d, which is not supported by the new version of SciPy, into the supported RegularGridInterpolator method.

issue #507

具体修改如下:

    # f = interpolate.interp2d(y, x, height_field_downsampled, kind="linear")
    f = interpolate.RegularGridInterpolator((y, x), height_field_downsampled, method="linear")

    x_upsampled = np.linspace(0, terrain.width * terrain.horizontal_scale, terrain.width)
    y_upsampled = np.linspace(0, terrain.length * terrain.horizontal_scale, terrain.length)
    # z_upsampled = np.rint(f(y_upsampled, x_upsampled))
    z_upsampled = np.rint(f((y_upsampled, x_upsampled)))

@zhenjia-xu
Copy link
Collaborator

Thanks for fixing this!

@Kashu7100
Copy link
Collaborator

I think we need to add the scipy requirements to pyproject.toml.

@Nate711
Copy link

Nate711 commented Jan 15, 2025

Thanks, I needed this change to make the terrain work with scipy 1.15. I also agree the pyproject.toml should be updated. Although it's a separate issue, open3d also needs to be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants