Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from findmyway/change_push
Browse files Browse the repository at this point in the history
change the default implementation of push! for trajectory
  • Loading branch information
findmyway authored Jan 31, 2020
2 parents 95a81c9 + 160f035 commit 7677fa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,13 @@ The length of `names` and `types` must match.
end

@interface function Base.push!(t::AbstractTrajectory; kwargs...)
for (k, v) in kwargs
push!(get_trace(t, k), v)
for kv in kwargs
push!(t, kv)
end
end

@interface Base.push!(t::AbstractTrajectory, kv::Pair{Symbol})

"""
extract_transitions(trajectory::AbstractTrajectory, learner::AbstractLearner)
Expand Down

0 comments on commit 7677fa1

Please sign in to comment.