Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Make sure that the Converter class handles masked arrays correctly #1

Open
ckhroulev opened this issue Feb 19, 2013 · 1 comment
Open
Assignees

Comments

@ckhroulev
Copy link
Owner

See the title.

@ghost ghost assigned ckhroulev Feb 19, 2013
@aaschwanden
Copy link

Constantine,

I've been running into this issue again and realize it's still open. Would it be hard to fix?

Minimal example:

import numpy as np
from udunits2 import Converter, System, Unit 
sys = System()

data = np.array([1000., 1000.])
mask = np.array([0, 1])

x = np.ma.array(data=data, mask=mask)
i_unit = Unit(sys, "m")
o_unit = Unit(sys, "km")

c = Converter((i_unit, o_unit))
y = c(x)
y = [1., 1.]

instead of

y = [1., --]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants