BAT.jl icon indicating copy to clipboard operation
BAT.jl copied to clipboard

Add flat index support for bat_marginalize()

Open Micki-D opened this issue 3 years ago • 2 comments

Adds support for doing

marg_s = BAT.bat_marginalize(some_shaped_samples, i)

where i is an Integer, Vector or Tuple of Integers or Unit Range.

The new marginalized samples will have N ScalarShaped parameters with the keys being encoded according to the keys of the input data. N being the number of columns selected in the marginalization process.

If a range is input, Expressions corresponding to the selected columns will be generated up to a range of 5. For larger ranges strings will be used to create the encoded symbols to save memory.

Micki-D avatar Jul 28 '22 15:07 Micki-D

@Cornelius-G can you give this a test?

oschulz avatar Jul 28 '22 15:07 oschulz

Codecov Report

Base: 54.71% // Head: 54.41% // Decreases project coverage by -0.30% :warning:

Coverage data is based on head (df9756e) compared to base (1f47ade). Patch coverage: 0.00% of modified lines in pull request are covered.

:exclamation: Current head df9756e differs from pull request most recent head 8875bb2. Consider uploading reports for the commit 8875bb2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #380      +/-   ##
==========================================
- Coverage   54.71%   54.41%   -0.31%     
==========================================
  Files         118      118              
  Lines        5547     5576      +29     
==========================================
- Hits         3035     3034       -1     
- Misses       2512     2542      +30     
Impacted Files Coverage Δ
src/plotting/MarginalDist_utils.jl 0.00% <0.00%> (ø)
src/plotting/recipes_prior_overview.jl 0.00% <0.00%> (ø)
src/plotting/vsel_processing.jl 0.00% <0.00%> (ø)
src/samplers/mcmc/mh/mh_tuner.jl 94.11% <0.00%> (-1.48%) :arrow_down:

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

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Jul 28 '22 15:07 codecov-commenter

@Cornelius-G, let me know when you're done checking this out?

oschulz avatar Sep 17 '22 16:09 oschulz

@oschulz I did now check this with our examples and the flat indexing seems to work again! So from my side, this would be ready to be merged. Thanks @Micki-D

Cornelius-G avatar Sep 19 '22 07:09 Cornelius-G

Thanks @Micki-D and @Cornelius-G !

oschulz avatar Sep 19 '22 10:09 oschulz