Skip to content

Conversation

@erikvansebille
Copy link
Member

This PR implements the proposal for a simpler Field interpolation API (#2287).

Note that it's blocked by #2294

Comment on lines 305 to 310
particle_positions = {"time": time, "z": z, "lat": y, "lon": x}
grid_positions = {}
grid_positions.update(_search_time_index(self.U, time))
grid_positions.update(self.grid.search(z, y, x, ei=_ei))
_update_particles_ei(particles, grid_positions, self)
_update_particle_states_position(particles, grid_positions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the API to reflect @erikvansebille’s and @VeckoTheGecko’s proposed structure (#2287) with two dictionaries, particle_positions and grid_positions. It seems like everything works as before, but I wasn’t 100% sure about initializing the dictionaries here within field.eval(); is there a nicer/better way to do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that creating a dictionary like this is fine.

What I rather wonder is whether we should move this duplicate code (for Field.eval() and for VectorField.eval() into one helper function?

@VeckoTheGecko
Copy link
Contributor

I have just approved #2294 - would you still like a review from me

Would you still like a review from me on this? (post #2294 being merged and this being rebased?)

Base automatically changed from removing_applyconversion_from_vectorinterpolation to v4-dev October 27, 2025 15:03
@erikvansebille
Copy link
Member Author

Yes, a review would be very useful, @VeckoTheGecko. And ideally also one from @fluidnumerics-joe to check if this Interpolation-API would also work for unstructured grids

Copy link
Contributor

@fluidnumerics-joe fluidnumerics-joe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple minor changes in the interpolators.py

@github-project-automation github-project-automation bot moved this from Backlog to Ready in Parcels development Oct 28, 2025
Copy link
Contributor

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@erikvansebille erikvansebille merged commit 1cb2a45 into v4-dev Oct 31, 2025
10 checks passed
@erikvansebille erikvansebille deleted the implementing_field_interpolation_api branch October 31, 2025 12:54
@github-project-automation github-project-automation bot moved this from Ready to Done in Parcels development Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants