Skip to content

Use scipy distance_transform_edt to replace slow loop#947

Open
trhille wants to merge 1 commit intoMPAS-Dev:mainfrom
trhille:landice/speed_up_distance_calculation
Open

Use scipy distance_transform_edt to replace slow loop#947
trhille wants to merge 1 commit intoMPAS-Dev:mainfrom
trhille:landice/speed_up_distance_calculation

Conversation

@trhille
Copy link
Collaborator

@trhille trhille commented Mar 25, 2026

Use scipy distance_transform_edt to replace slow loop, speeding up get_dist_to_edge_and_gl by orders of magnitude.

Checklist

  • User's Guide has been updated
  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.rst) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected
  • The E3SM-Project submodule has been updated with relevant E3SM changes
  • The MALI-Dev submodule has been updated with relevant MALI changes
  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes
  • New tests have been added to a test suite

Use scipy distance_transform_edt to replace slow loop, speeding up
get_dist_to_edge_and_gl by about five orders of magnitude.
@trhille
Copy link
Collaborator Author

trhille commented Mar 25, 2026

Testing

Testing on 8–30km Antarctica mesh.
With these changes: compass.landice.mesh.get_dist_to_edge_and_gl() took 0.05 seconds
With previous: compass.landice.mesh.get_dist_to_edge_and_gl() took 57.52 seconds

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.

1 participant