arviz-devs / InferenceObjects.jl

Storage for results of Bayesian inference
https://julia.arviz.org/InferenceObjects
MIT License
14 stars 1 forks source link

Change default dimension order to (draw, chain, params...) #40

Closed sethaxen closed 1 year ago

sethaxen commented 1 year ago

This PR changes the default dimension order from (params..., draw, chain) to (draw, chain, params...). While this is a breaking change, no user code that indexes and permutes dimensions using dimension names instead of indices will be impacted.

This changes the ordering from that adopted in #8. The benefits are:

Downsides of this approach:

sethaxen commented 1 year ago

cc @ParadaCarleton

codecov-commenter commented 1 year ago

Codecov Report

Merging #40 (ab61f6d) into main (e011ecb) will increase coverage by 0.98%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
+ Coverage   96.00%   96.98%   +0.98%     
==========================================
  Files           9        9              
  Lines         300      299       -1     
==========================================
+ Hits          288      290       +2     
+ Misses         12        9       -3     
Impacted Files Coverage Δ
src/dimensions.jl 100.00% <100.00%> (+5.12%) :arrow_up:
src/from_namedtuple.jl 97.29% <100.00%> (+2.17%) :arrow_up:
src/utils.jl 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

sethaxen commented 1 year ago

FYI @goedman after this PR is merged, you would need to use permute dimensions using permutedims or PermutedDimsArray in StanSample.