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

"Input array is not C_CONTIGUOUS" warning despite c-contiguous input #329

Open
tyfolino opened this issue Jan 28, 2024 · 1 comment
Open

Comments

@tyfolino
Copy link

Hi!

I'm using xESMF in my Python package to take care of regridding. A certain input dataset constantly raises UserWarning: Input array is not C_CONTIGUOUS. Will affect performance.. The dataset in question can be found in this Zenodo repository under kernels/HadGEM3-GA7.1/TOA_HadGEM-GA7.1_Kerns.nc. A word of caution: they are quite large files.

What is confusing me, however, is that when I check the C_CONTIGUOUS flag of each variable, I get back True:

> False in [np.array(v).flags['C_CONTIGUOUS'] for v in ds_in_question.variables]

False

> False in [np.array(v).flags['C_CONTIGUOUS'] for v in ds_in_question.coords]

False

I have even tried casting to C-order using Xarray's .astype() function without success.

I'd love to get some insight into this issue so I don't have to arbitrarily suppress these warnings when using my package.

Thank you!

@Timothy-W-Hilton
Copy link

I'm experiencing the same thing. I'd love to get some insight.

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

No branches or pull requests

2 participants