Skip to content

Commit

Permalink
Document Contains for Categoricals more clearly (#534)
Browse files Browse the repository at this point in the history
* Add refs to subtypes to Selector docstrings

* Clarify Contains docstring

* Update src/LookupArrays/selector.jl

---------

Co-authored-by: Rafael Schouten <[email protected]>
  • Loading branch information
felixcremer and rafaqz authored Sep 26, 2023
1 parent cd77569 commit b4decde
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/LookupArrays/selector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,25 @@ abstract type Selector{T} end
IntSelector <: Selector
Abstract supertype for [`Selector`](@ref)s that return a single `Int` index.
IntSelectors provided by DimensionalData are:
- [`At`](@ref)
- [`Contains`](@ref)
- [`Near`](@ref)
"""
abstract type IntSelector{T} <: Selector{T} end

"""
ArraySelector <: Selector
Abstract supertype for [`Selector`](@ref)s that return an `AbstractArray`.
ArraySelectors provided by DimensionalData are:
- [`Between`](@ref)
- [`Touches`](@ref)
- [`Where`](@ref)
"""
abstract type ArraySelector{T} <: Selector{T} end

Expand Down Expand Up @@ -255,6 +267,8 @@ Selector that selects the interval the value is contained by. If the
interval is not present in the index, an error will be thrown.
Can only be used for [`Intervals`](@ref) or [`Categorical`](@ref).
For [`Categorical`](@ref) it falls back to using [`At`](@ref).
`Contains` should not be confused with `Base.contains` - use `Where(contains(x))` to check for if values are contain in categorical values like strings.
## Example
Expand Down

0 comments on commit b4decde

Please sign in to comment.