cscherrer / Soss.jl

Probabilistic programming via source rewriting
https://cscherrer.github.io/Soss.jl/stable/
MIT License
414 stars 30 forks source link

Fix optional import #256

Closed devmotion closed 3 years ago

devmotion commented 3 years ago

Currently, loading both Soss and SampleChainsDynamicHMC does not work correctly:

julia>] add Soss, SampleChainsDynamicHMC
julia> using Soss, SampleChainsDynamicHMC
┌ Warning: Package Soss does not have SampleChainsDynamicHMC in its dependencies:
│ 
│   •  If you have Soss checked out for development and have added SampleChainsDynamicHMC as a
│      dependency but haven't updated your primary environment's manifest file, try Pkg.resolve().
│ 
│   •  Otherwise you may need to report an issue with Soss
│ 
│ Loading SampleChainsDynamicHMC into Soss from project dependency, future warnings for Soss are
└ suppressed.

The optional import of SampleChainsDynamicHMC is not correct: As stated in the documentation of Requires,

In the @require block, or any included files, you can use or import the package, but note that you must use the syntax using .Gadfly or import .Gadfly, rather than the usual syntax. Otherwise you will get a warning about Gadfly not being in dependencies.

Unfortunately, AFAIK it is not possible to detect this error when running the tests if the optional dependency is a test dependency.

codecov[bot] commented 3 years ago

Codecov Report

Merging #256 (7eb87fe) into master (0440210) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #256   +/-   ##
=======================================
  Coverage   24.91%   24.91%           
=======================================
  Files          49       49           
  Lines        1204     1204           
=======================================
  Hits          300      300           
  Misses        904      904           
Impacted Files Coverage Δ
src/samplechains/dynamichmc.jl 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0440210...7eb87fe. Read the comment docs.

cscherrer commented 3 years ago

Great! Thank you @devmotion

devmotion commented 3 years ago

Is it possible to release a new version with the fix? I already updated the version number in this PR.

cscherrer commented 3 years ago

Thanks for the reminder, in progress now

devmotion commented 3 years ago

Great, thanks!