Skip to content

Add append for RelativeTrace to MultiplexArrays #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 28, 2023
Merged

Add append for RelativeTrace to MultiplexArrays #41

merged 4 commits into from
Jun 28, 2023

Conversation

HenriDeh
Copy link
Member

Currently, appending a Traces to a Traces fails if they contain a MultiplexTrace. This is because in the append code

    @eval function Base.$f(ts::Traces, xs::Traces)
        for k in keys(xs)
            t = ts.traces[ts.inds[k]]
            $f(t, xs[k])
        end
    end

where f is :append!, t is a MultiplexTrace and xs[k] is a RelativeTrace. Appending to a MutliplexTrace was only defined for a NamedTuple but this is not what is called in the loop above. This PR implements a second append that should only be called once by the above loop (avoiding appending twice, once :state and once :next_state).

@HenriDeh HenriDeh requested a review from jeremiahpslewis June 28, 2023 09:54
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #41 (8a5ac1b) into main (323793d) will increase coverage by 0.20%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   69.73%   69.94%   +0.20%     
==========================================
  Files          13       13              
  Lines         575      579       +4     
==========================================
+ Hits          401      405       +4     
  Misses        174      174              
Impacted Files Coverage Δ
src/traces.jl 83.81% <100.00%> (+0.28%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@HenriDeh HenriDeh merged commit 8aebc3c into main Jun 28, 2023
@HenriDeh HenriDeh deleted the append branch June 28, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants