xgcm / xrft

Fourier transforms on xarray data structures
https://xrft.readthedocs.io/en/latest/
MIT License
153 stars 44 forks source link

handling error when coordinates are not numerical #188

Closed lanougue closed 1 year ago

lanougue commented 2 years ago

Hello,

I tried to apply fft on an xarray whose one of coordinates are not numerical (string in my case). The returned error is not explicit:

TypeError: unsupported operand type(s) for -: 'str' and 'str'

I think that an explicit error should be raised when the coordinate is not numerical.

roxyboy commented 1 year ago

Hi @lanougue , I support this idea. Would you mind making a PR?

lanougue commented 1 year ago

Hi @roxyboy , Ok, I will try to do a PR when I'll find some spare time !

lanougue commented 1 year ago

Opening PR #190

roxyboy commented 1 year ago

Closing with PR #190