JuliaDecisionFocusedLearning / InferOpt.jl

Combinatorial optimization layers for machine learning pipelines
https://juliadecisionfocusedlearning.github.io/InferOpt.jl/
MIT License
113 stars 4 forks source link

Add static tests with JET #45

Closed gdalle closed 1 year ago

gdalle commented 1 year ago

JET.jl enables static testing of code correctness, it's good to catch typos among other things. We could also use it to test for dynamic dispatch (although I'm sure the Frank-Wolfe part is ripe with it)

I had to remove the generic methods throwing errors, and replace them with empty functions. It's better style anyway. However, this leads JET to assume that no method exists for compute_maximizer(base_loss, θ, α, y_true) in the SSVM. As a result, I switched the analysis to :typo mode for now instead of the more complete version. I opened an issue to keep track of this: https://github.com/aviatesk/JET.jl/issues/495

Tests might fail on Julia 1.10 because of a bug in Zygote: https://github.com/FluxML/Zygote.jl/issues/1410

codecov-commenter commented 1 year ago

Codecov Report

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

Comparison is base (7e65548) 88.97% compared to head (f057e5a) 92.87%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #45 +/- ## ========================================== + Coverage 88.97% 92.87% +3.90% ========================================== Files 19 21 +2 Lines 408 519 +111 ========================================== + Hits 363 482 +119 + Misses 45 37 -8 ``` | [Impacted Files](https://codecov.io/gh/axelparmentier/InferOpt.jl/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/imitation\_loss/imitation\_loss.jl](https://codecov.io/gh/axelparmentier/InferOpt.jl/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2ltaXRhdGlvbl9sb3NzL2ltaXRhdGlvbl9sb3NzLmps) | `100.00% <ø> (+4.34%)` | :arrow_up: | | [src/ssvm/isbaseloss.jl](https://codecov.io/gh/axelparmentier/InferOpt.jl/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3Nzdm0vaXNiYXNlbG9zcy5qbA==) | `100.00% <ø> (+100.00%)` | :arrow_up: | ... and [18 files with indirect coverage changes](https://codecov.io/gh/axelparmentier/InferOpt.jl/pull/45/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

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