-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix doctests #342
Fix doctests #342
Conversation
Weird, I ran |
How about throwing away some compatibility stuff for Julia version 1.6 and lower? We're helping almost no one with that and just making the lives of the few Turing developers more difficult EDIT: Also, if someone is still on Julia 1.2, it's very unlikely that that person is gonna install the newest MCMCChains version anyway. Those people can just keep using their old MCMCChains version even after bumping the lower compat bound here. |
The main problem is not 1.0. We don't have to do anything special in this package to support it, so I don't think we should drop it. The main problems are 1) that array printing is different depending on the Julia version, also from 1.6 to 1.6, and 2) the MLJ dependencies for the Rstar tests. Both require fixes even if we would support only >= 1.6. The XGBoost dependency is annoying (and eg doesn't work on 32bit so we can't run tests there), and hence probably it would be helpful to use some simpler model in the tests (eg in MCMCDiagnosticTools I use Libsvm as well but it also has binary dependencies, so maybe eg naive Bayes would be even better). Additionally, there's a new release of MLJBase that breaks our tests - however, fixing it to an old version breaks our current test setup. |
This is special: MCMCChains.jl/test/runtests.jl Lines 3 to 8 in e7b3db5
MCMCChains.jl/test/runtests.jl Lines 22 to 27 in e7b3db5
EDIT: Let's move this discussion to the Turing slack. No need for me to spam you here on this PR. |
Also, who runs 32 bit in this day and age? Apple dropped support for 32-bit in OS X Lion in 2011. |
These specialization are not the problem here, and at least the second one is still needed even if we drop < 1.6. 32bit tests helped to uncover Int32/Int64 issues. |
nice okay |
Codecov Report
@@ Coverage Diff @@
## master #342 +/- ##
==========================================
+ Coverage 82.94% 83.09% +0.15%
==========================================
Files 19 19
Lines 979 988 +9
==========================================
+ Hits 812 821 +9
Misses 167 167
Continue to review full report at Codecov.
|
I fixed the issues and the annoying binary dependencies by replacing XGBoost with DecisionTree. There are no additional fixes or workarounds for specific Julia versions needed, and actually now the rstar statistic can be tested with any Julia version and also on 32bit architectures Doctests are only performed with Julia >= 1.7 and on 64bit which fixes all issues with array printing in different Julia versions (again, not a Julia 1.0 thing but also a problem for Julia 1.6 vs 1.7). IMO doctests really should only be performed with one specific Julia versions due to changes in e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good to me. Pure Julia is definitely better than XGBoost with its binary dependency
# run tests related to rstar statistic | ||
println("Rstar") | ||
@time include("rstar_tests.jl") | ||
|
||
# Array printing depends on Julia version and architecture, | ||
# therefore we only run doctests with Julia >= 1.7 and on 64bit where `Int === Int64` | ||
if VERSION >= v"1.7" && Sys.WORD_SIZE == 64 | ||
DocMeta.setdocmeta!( | ||
MCMCChains, | ||
:DocTestSetup, | ||
:(using MCMCChains); | ||
recursive = true | ||
) | ||
doctest(MCMCChains) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Great improvement
No description provided.