bat / BAT.jl

A Bayesian Analysis Toolkit in Julia
Other
198 stars 30 forks source link

Register extensions #420

Closed waldie11 closed 1 year ago

waldie11 commented 1 year ago

Restore Plotting functionality.

waldie11 commented 1 year ago

Without the register, using Plots does not autoload BATPlotsExt, thus preventing access to implemented _Plots_Surface etc

using BAT
using Plots

posterior = BAT.example_posterior()
r_mh = BAT.bat_sample(BAT.example_posterior())

plot(r_mh.result)

As Iam unfamiliar with this extensions infrastructure, @oschulz probably want to check especially on the BATFoldsExt - as this seems to depend on both Folds and Transducer, Iam unsure if you left it on purpose or if the register proposed here for Folds is enough.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.15 :tada:

Comparison is base (380e07b) 54.79% compared to head (622835e) 54.95%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #420 +/- ## ========================================== + Coverage 54.79% 54.95% +0.15% ========================================== Files 116 116 Lines 5617 5621 +4 ========================================== + Hits 3078 3089 +11 + Misses 2539 2532 -7 ``` | [Impacted Files](https://app.codecov.io/gh/bat/BAT.jl/pull/420?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat) | Coverage Δ | | |---|---|---| | [ext/BATFoldsExt.jl](https://app.codecov.io/gh/bat/BAT.jl/pull/420?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat#diff-ZXh0L0JBVEZvbGRzRXh0Lmps) | `0.00% <0.00%> (ø)` | | | [ext/BATPlotsExt.jl](https://app.codecov.io/gh/bat/BAT.jl/pull/420?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat#diff-ZXh0L0JBVFBsb3RzRXh0Lmps) | `0.00% <0.00%> (ø)` | | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/bat/BAT.jl/pull/420/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat)

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

oschulz commented 1 year ago

using Plots should autoload BATPlotsExt. BAT.pkgext is only a little "trick" for algorithms that have the algorithm type defined in BAT but the rest in an extension. This is not applicable to Plots.

waldie11 commented 1 year ago

Well, seems inded to work. Did the BATPlotsExt enter later than BATAdvancedHMCExt ? Might have been a mixup with a old manifest. Closing.

oschulz commented 1 year ago

When you are in "development mode" and change between branches/commits with different Pkg extensions, you need to run Pkg.resolve() afterwards.