-
Notifications
You must be signed in to change notification settings - Fork 18
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
Does YAXArrays.jl support interop with xarray? #483
Comments
Yes,and if some things don't work please open more issues. |
There is also https://github.com/meggart/PyYAXArrays.jl for interop in a session, so that you could load your data with xarray and then use YAXArrays functionality for the analysis. This is experimental at the moment so you might not want to rely on it too much. |
Thanks for the clarification! Closing this issue now. |
For clarification, this is because both package (xarray and YAXArrays.jl) reads standardized data in the netcdf/zarr format (and other metadata-based format I know less) |
I find out an inconsistency when open xarray saved np.complex64 data. YAXArrays.jl will read a Complex64 data, which is corresponding to np.complex128 data. using PythonCall
pyexec("
import numpy as np
import xarray as xr
", Main)
@pyexec """
data = np.random.random((3, 5)) + 1j*np.random.random((3, 5))
data = data.astype(np.complex64)
da = xr.DataArray(data, dims=["x", "y"], name="random_complex")
dtype = data.dtype
ds = xr.Dataset({"random_complex": da})
ds.to_zarr("random_complex.zarr", mode="w")
""" => dtype this will return
which means out data have np.complex64 datatype which consists 2 float32 array. open_dataset("random_complex.zarr", driver=:zarr)["random_complex"] it will return
here data type is ComplexF64, which contains 2 Float64 array. And we also cannot index this array.
|
That seems to be specifically a Zarr.jl issue. There is a mismatch in how python and Julia zarr implementations interpret the zarr metadata. |
That might be related but is not the main issue. |
If we have a
.nc
or.zarr
file generated by xarray, can we read and manipulate it with all functionality with YAXArrays.jl?I just don't know if it is intentionally supported or it just happen to work.
Also, from other direction, if we have files generated by YAXArrays.jl, is that possible to use all functionality from xarray?
The text was updated successfully, but these errors were encountered: