Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nalimilan/typedmissings.jl
Support for different kinds of missing values in Julia
https://github.com/nalimilan/typedmissings.jl
Last synced: 5 days ago
JSON representation
Support for different kinds of missing values in Julia
- Host: GitHub
- URL: https://github.com/nalimilan/typedmissings.jl
- Owner: nalimilan
- License: other
- Created: 2022-02-28T21:30:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T23:09:37.000Z (about 1 year ago)
- Last Synced: 2024-10-30T18:28:33.299Z (about 2 months ago)
- Language: Julia
- Size: 37.1 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TypedMissings.jl
[![CI](https://github.com/nalimilan/TypedMissings.jl/workflows/CI/badge.svg)](https://github.com/nalimilan/TypedMissings.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/nalimilan/TypedMissings.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/nalimilan/TypedMissings.jl)*Support for different kinds of missing values in Julia*
Note : This package is currently experimental. It relies on overwriting
some fundamental Julia Base methods until they are changed to use
`ismissing(x)` instead of hardcoding `x === missing`.TypedMissings.jl provides the `TypedMissing` type which is
similar to `Missing` but allows representing multiple kinds
of missing values.
Values of type `TypedMissing` behave identically to `missing`, except that
`isequal(TypedMissing(kind), missing)` is `true` if and only if
`kind == MissingKinds.NI`. The default kind is `MissingKinds.NI` ("No information"),
which is equivalent to `missing`.`TypedMissing` values propagate their `kind` across operations
which involve only missing values of the same `kind` or non-missing
values. Operations mixing `TypedMissing` values of different `kind`s
fall back to the `MissingKinds.NI` kind.If provided, `kind` must be an instance of the `MissingKind` enum.
Supported `kind`s are `NI`, lowercase letters from a to z, and "null flavour"
values [defined by FHIR HL7 v3](https://terminology.hl7.org/5.3.0/ValueSet-v3-NullFlavor.html)/ISO 21090:
- NI: No information
- INV: Invalid
- OTH: Other
- NINF: Negative infinity
- PINF: Positive infinity
- UNC: Unencoded
- DER: Derived
- UNK: Unknown
- ASKU: Asked but unknown
- NAV: Temporarily not available
- NAVU: Not available
- QS: Sufficient quantity
- NASK: Not asked
- TRC: Trace
- MSK: Masked
- NA: Not applicable# Examples
```julia
julia> TypedMissing()
TypedMissing()julia> TypedMissing(MissingKinds.NI)
TypedMissing()julia> TypedMissing() + 1
TypedMissing()julia> TypedMissing(MissingKinds.a) + 1
TypedMissing(MissingKinds.a)julia> TypedMissing(MissingKinds.NASK) + 1
TypedMissing(MissingKinds.NASK)julia> TypedMissing(MissingKinds.NASK) + TypedMissing(MissingKinds.INV)
TypedMissing()julia> TypedMissing(MissingKinds.NASK) + missing
TypedMissing()julia> TypedMissing(MissingKinds.NASK) + 1
TypedMissing(MissingKinds.NASK)julia> isequal(TypedMissing(MissingKinds.NASK), TypedMissing(MissingKinds.NASK))
truejulia> isequal(TypedMissing(MissingKinds.NASK), TypedMissing(MissingKinds.INV))
falsejulia> isequal(TypedMissing(MissingKinds.NASK), missing)
falsejulia> isequal(TypedMissing(MissingKinds.NI), missing)
true
```