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

Fix type instability #157

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix type instability #157

wants to merge 3 commits into from

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Feb 24, 2025

This fixes the type instability of DataHandling.regridded_snapshot and Regridders.regrid.

dimensions_FT = map(dimensions, regridder.dim_increasing) do dim, increasing
!increasing ? reverse(FT.(dim)) : FT.(dim)
end
dimensions_FT = ntuple(
Copy link
Member

Choose a reason for hiding this comment

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

Can you also add a check to check that the number of dimensions match between the given data and the space?

"""Tuple of integers indicating which dimensions to reverse in data"""
decreasing_indices::DI

"Number of dimensions"
Copy link
Member

Choose a reason for hiding this comment

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

What is this the number of dimensions for?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is the number of dimensions of the space.

Copy link
Member

Choose a reason for hiding this comment

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

Which space? The target space? And is it number of physical dimensions? Can we update the doc string to make this more clear?

@ph-kev ph-kev force-pushed the kp/allocs branch 2 times, most recently from 2251e7d to bc7390b Compare February 24, 2025 19:33
This commit fixes the type instabilities in Regridders.regrid and
DataHandling.regridded_snapshot.
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.

3 participants