Skip to content

cube.convert_units converting from 'unknown' #1977

@rcomer

Description

@rcomer

I just noticed that cube.convert_units works when the cube doesn't have an existing unit. E.g.:

mycube = iris.cube.Cube(1.)
mycube.convert_units('mm day-1')
print mycube
print mycube.data

produces this output:

unknown / (mm day-1) 
1.0

Shouldn't convert_units produce an exception if it doesn't have a unit to map from?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions