Skip to content

Require z to be a matrix #81

@aabacchus

Description

@aabacchus

interpolate requires that z is an AbstractMatrix, ie rank 2, but contours and contour etc are happy to take any kind of data, as long as the first two dimensions match x and y.
I passed a rank 3 array (of eigenenergies over 2d momentum space), hoping to get contours over all the energies, but the error only appears in the interpolate function. Since z should be a matrix there, the higher-level functions should also only accept a matrix.

Weirdly, the MethodError isn't thrown if I pass a list of levels directly, or if those levels don't intersect with the data, because get_levels_cells returns an empty Dict, so the iteration in trace_contour doesn't happen and so the preallocated ContourLevel is returned without anything actually put in it:

contours = ContourLevel(h, Curve2{VT}[])

which relates to #80

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