Skip to content

utime no longer a class in cftime #248

Open
@RuthG

Description

I'm putting together some new SST input files and found that in recent cftime installations the utime class is not supported.
This seems to be quite an old update, and breaks src/python/extra/scripts/calendar_calc.py in my current environment.
I found I can get the code running with the below, based on cftime's docs & noting its updates say that utime is defunct.
As I'm not clear on what utime originally should have done I thought I'd raise this as an issue rather than immediately changing anything.

If/when I do amend this, I'll try to add some comments to the code as well to make it easier to navigate/see how files interrelate.


def day_number_to_datetime_array(time_in, calendar_type, units_in):

    #cdftime = utime(units_in, calendar = calendar_type)

    date_out = cftime.num2date(time_in, units_in, calendar = calendar_type)

    return date_out

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions