Skip to content

Incorrect Voronoi bounds from DimensionCoordinate.create_bounds for cyclic coordinates #514

@davidhassell

Description

@davidhassell

At version 3.13.1, incorrect Voronoi bounds are created from DimensionCoordinate.create_bounds for cyclic and period coordinates.

>>> import cf
>>> cf.__version__
'3.13.1'
>>> d = cf.DimensionCoordinate(data=[180, 90, 40, 0.0])   
>>> d.period(360)
>>> d.cyclic(0)
set()
>>> b = d.create_bounds()
>>> print(b.array) 
[[225. 135.]   # Wrong
 [135.  65.]
 [ 65.  20.]
 [ 20. -20.]]  # Wrong

when the result should be

[[270. 135.]   # Correct
 [135.  65.]
 [ 65.  20.]
 [ 20. -90.]]  # Correct

Also, the docstring for the method is lacking in detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions