Skip to content

Commit

Permalink
Allow DataSelectors in PropsDB getindex
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Oct 2, 2023
1 parent 1a6802c commit 16f49a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/props_db.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,18 @@ end
(@nospecialize(pd::PropsDB{Nothing}))(filekey::FileKey) = pd(ValiditySelection(filekey))


function Base.getindex(@nospecialize(pd::PropsDB), a, b, cs...)
getindex(getindex(pd, a), b, cs...)
end

function Base.getindex(@nospecialize(pd::PropsDB), s::Symbol)
_get_md_property(pd, s)
end

function Base.getindex(@nospecialize(pd::PropsDB), s::DataSelector)
getindex(pd, Symbol(string(s)))
end

function Base.getindex(@nospecialize(pd::PropsDB), S::AbstractArray{<:Symbol})
_get_md_property.(Ref(pd), S)
end
Expand Down

0 comments on commit 16f49a7

Please sign in to comment.