Skip to content

Attributing fill_value when writing DataArray with to_netcdf fails #2728

Closed
@mommebutenschoen

Description

@mommebutenschoen

Code Sample, a copy-pastable example if possible

This is fairly simple, so I might easily be doing something wrong, I'm failing to attribute a fill_value to a DataArray when writing it to netcdf:

from numpy import ones
from xarry import DataArray
data=DataArray(ones(10),name="testvar")
data.to_netcdf("testvar.nc",encoding={"testvar": {"fill_value': -1.e12}})

throws:

ValueError: unexpected encoding parameters for 'netCDF4' backend:  ['fill_value']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions