Skip to content

Create empty space Spatiotemporal Xarray coordinate difference tolerance #78

@nilsleh

Description

@nilsleh

I am looking to change the predict step according to #75 and I am working with CMIP6 data. I am currently getting the ValueError that Coordinates must be uniformly spaced here, given small numerical differences that cause the ValueError:

print(np.diff(x2_predict))
array([1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 0.9999924 ,
       1.0000076 , 1.        , 1.        , 0.9999924 , 1.0000076 ,
       1.        , 1.        , 0.9999924 , 1.0000076 , 1.        ,
       1.        , 0.9999924 , 1.0000076 , 1.        , 1.        ,
       0.9999924 , 1.0000076 , 1.        , 1.        , 0.9999924 ,
       1.0000076 , 1.        , 1.        , 1.0000076 , 0.9999924 ,
       1.        , 1.        , 1.0000076 , 0.9999924 , 1.        ,
       1.        , 1.0000076 , 0.9999924 , 1.        , 1.        ,
       1.0000076 , 0.9999924 , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 0.99998474, 1.0000153 , 1.        , 1.0000153 ,
       0.99998474, 1.        , 1.        , 1.        , 0.99998474,
       1.0000153 , 1.        , 1.0000153 , 0.99998474, 1.        ,
       1.        , 1.        , 0.99998474, 1.0000153 , 1.        ,
       1.0000153 , 0.99998474, 0.99998474, 1.0000153 , 1.        ,
       1.0000153 , 0.99998474, 1.        , 1.        , 1.        ,
       0.99998474, 1.0000153 , 1.        , 1.0000153 , 0.99998474,
       1.        , 1.        , 1.        , 0.99998474, 1.0000153 ,
       1.        , 1.0000153 , 0.99998474, 1.        , 1.        ,
       1.        , 0.99998474, 1.0000153 , 1.        , 1.0000153 ,
       0.99998474, 1.        , 1.        , 1.        , 0.99998474,
       1.0000153 , 1.        , 1.0000153 , 0.99998474, 1.        ,
       1.        , 1.        , 0.99998474, 1.0000153 , 1.        ,
       1.0000153 , 0.99998474, 0.99998474, 1.0000153 , 1.        ,
       1.0000153 , 0.99998474, 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        ], dtype=float32)

the np.allclose() functions default absolute tolerance is 1e-8, with a tolerance of 1e-5 this assert statement would be true. But currently, there seems no other way around than changing the source code?

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