Skip to content

Error in num2date cinversion #981

Closed
Closed

Description

@rkouznetsov
#!/usr/bin/env python

import numpy as np
import netCDF4 as nc4
iarr=np.arange(86400, dtype=np.int32)
units='hours since 2018-01-01 00:00:00 UTC'
dates1 = nc4.num2date(iarr,units)[-5:]
dates2 = nc4.num2date(iarr[-5:],units)
print dates1 == dates2

Results in
[ True False True True False]
Should be
[ True True True True True]
as it used to be for me until recent update.

Environment:
Ubuntu 18.04, python-numpy 1:1.13.3-2ubuntu1, python-netcdf4 1.3.1-1

Actually, result is the same for iarr dtype of float32, float64, or int64.

Thank you!

Activity

  1. rkouznetsov commented on Nov 20, 2019

    @rkouznetsov
    Author

    Also reproducible with latest cftime: Unidata/cftime#134
    Sorry for cross-posting.

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

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