Skip to content

Cannot save complex/Hilbert models with engine=netcdf4 #214

Open
@nicrie

Description

@nicrie

Describe the bug
Trying to save a complex/Hilbert model with engine=netcdf4 results in the following error:

TypeError: illegal primitive data type, must be one of dict_keys(['S1', 'i1', 'u1', 'i2', 'u2', 'i4', 'u4', 'i8', 'u8', 'f4', 'f8']), got complex128

Reproducible Minimal Working Example
Provide a concise Python code snippet that demonstrates the issue. To display the code clearly, use GitHub Flavored Markdown for formatting:

import xarray as xr
import xeofs as xe

t2m = xr.tutorial.open_dataset("air_temperature").air
heof = xe.models.HilbertEOF()
heof.fit(t2m, "time")
heof.save("test.nc", engine="netcdf4")

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: Ubuntu 22
  • xeofs version 2.4.1

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions