Skip to content

Data.map_variable: fails with non-orthogonal axes #1102

@ddkohler

Description

@ddkohler

Though not specified, map_variable assumes the axes are orthogonal. There is a code block that spells this out:

for v in self.variables:
if wt_kit.orthogonal(v.shape, variable.shape):
out.create_variable(values=v[:], **v.attrs)
out.transform(*self.axis_expressions)

More thought is needed to determine if this requirement is necessary, or whether minor changes could relieve this requirement.

The first thing to do to approach this issue is properly document the scope of map_variable so that users have clear expectations for what to work with. We could also include some error handling to better inform the user on what goes wrong when data has the incompatible axes.

Secondly, we should consider if we can make map_variable more general wrt the axes it works with.

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