Skip to content

Implementation of an invalid value, similar to numpy's "NaT"? #145

Open
@aulemahal

Description

@aulemahal

With cftime 1.1.0 on Linux (Ubuntu, 64 bit)

I am using cftime through xarray and one my computation returns an array where the values are dates. I want to get the number of days between these dates and a reference date. Some of the pixels of the input array are masked and set to np.nan and when doing the subtraction, it raises an error TypeError: unsupported operand type(s) for -: 'float' and 'cftime._cftime_Datetime360Day.

I was wondering if there is recommended way to handle invalid values with cftime, or a plan to support this? Maybe cftime.datetime could return numpy.NaT when the other object is either numpy.nan or numpy.NaT?

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