Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing measurements #59

Closed
briochemc opened this issue Jan 7, 2020 · 2 comments · Fixed by #62
Closed

missing measurements #59

briochemc opened this issue Jan 7, 2020 · 2 comments · Fixed by #62

Comments

@briochemc
Copy link

I'm not sure it makes sense, but wouldn't it be nice to be able to deal with missing measurements?

E.g., have

x = 1.0 ± 2.0
y = 1.0 ± missing
z = missing ± missing

not throw errors and just propagate the missings for things like x+y or x+z?

@giordano
Copy link
Member

I've been thinking about best do this, but I think it's a bit tricky. My initial idea was to allow Measurement type to have parameter of type Union{AbstractFloat,Missing}, instead of just AbstractFloat. Note that this is the type of both the measurement value and its uncertainty, so

y = 1.0 ± missing

wouldn't be allowed, or at least it'll be automatically converted to

y = missing ± missing

I don't see great value in separating the types of the value and the uncertainties, this helps us keeping type-stability in many situations.

The idea proposed above is doable, it just requires some work to be done -- help is always much appreciate! What worries me most about my suggestion is that you can have a missing measurement Measurement{Missing}, but this will be subtype of AbstractFloat instead of Missing: we can certainly define

Base.ismissing(::Measurement{Missing}) = true

but any code relying on a missing value being subtype of Missing would fail to detect it.

@giordano
Copy link
Member

Well, it turned out that this can be done in a much simpler way, see #62. Thanks to @simeonschaub!

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

Successfully merging a pull request may close this issue.

2 participants