Skip to content

Commit

Permalink
Make sure time_slice(...) returns a Vector
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelma committed Apr 29, 2024
1 parent c5b1ffb commit 9a62649
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/data_structure/temporal_structure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ struct TOverlapsT
overlapping_time_slices::Dict{TimeSlice,Array{TimeSlice,1}}
end

(h::TimeSliceSet)(; temporal_block=anything, t=anything) = h(temporal_block, t)
(h::TimeSliceSet)(; temporal_block=anything, t=anything)::Vector{TimeSlice} = h(temporal_block, t)
(h::TimeSliceSet)(::Anything, ::Anything) = h.time_slices
(h::TimeSliceSet)(temporal_block::Object, ::Anything) = h.block_time_slices[temporal_block]
(h::TimeSliceSet)(::Anything, t) = t
(h::TimeSliceSet)(temporal_block::Object, t) = (s for s in t if temporal_block in blocks(s))
(h::TimeSliceSet)(temporal_blocks::Array{T,1}, t) where {T} = (s for blk in temporal_blocks for s in h(blk, t))
(h::TimeSliceSet)(temporal_block::Object, t) = [s for s in t if temporal_block in blocks(s)]
(h::TimeSliceSet)(temporal_blocks::Array{T,1}, t) where {T} = unique(s for blk in temporal_blocks for s in h(blk, t))

"""
(::TOverlapsT)(t::Union{TimeSlice,Array{TimeSlice,1}})
Expand Down

0 comments on commit 9a62649

Please sign in to comment.