Skip to content
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

make ChainRulesCore dependency into an extension #421

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Dec 29, 2022

Shouldn't be merged until the Registrator deployment of JuliaRegistries/Registrator.jl#397 is done.

@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Base: 91.87% // Head: 93.77% // Increases project coverage by +1.89% 🎉

Coverage data is based on head (639fdb3) compared to base (2cbb4ae).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #421      +/-   ##
==========================================
+ Coverage   91.87%   93.77%   +1.89%     
==========================================
  Files          14       14              
  Lines        2967     2908      -59     
==========================================
+ Hits         2726     2727       +1     
+ Misses        241      181      -60     
Flag Coverage Δ
unittests 93.77% <ø> (+1.89%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ext/ChainRulesCoreExt.jl 100.00% <ø> (ø)
src/SpecialFunctions.jl 100.00% <ø> (ø)
src/gamma.jl 94.52% <0.00%> (ø)
src/beta_inc.jl 92.51% <0.00%> (+0.14%) ⬆️
src/gamma_inc.jl 93.46% <0.00%> (+1.84%) ⬆️
src/expint.jl 94.34% <0.00%> (+5.04%) ⬆️
src/erf.jl 100.00% <0.00%> (+5.84%) ⬆️
src/sincosint.jl 100.00% <0.00%> (+34.54%) ⬆️

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

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

@stevengj
Copy link
Member

Could you summarize the practical effect for those of us who have not followed the "weak dependency" feature progress?

@KristofferC
Copy link
Member Author

KristofferC commented Dec 29, 2022

Sure, I'll summarize but also link to the docs: https://pkgdocs.julialang.org/dev/creating-packages/#Conditional-loading-of-code-in-packages-(Extensions)

Basically, you can think of ext/ChainRulesCore.jl as a "package" that gets automatically loaded when ChainRulesCore gets loaded. So "extensions" allow adding e.g. method extensions to packages without having to unconditionally load them (which can be expensive from a load time p.o.v). It is similar to Requires.jl except that it supports precompiling the conditional code (and adding compat on the conditional dependencies, now called weak dependencies).

@@ -91,7 +90,9 @@ include("gamma.jl")
include("gamma_inc.jl")
include("betanc.jl")
include("beta_inc.jl")
include("chainrules.jl")
if !isdefined(Base, :get_extension)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly this PR is basically removing functionality for Julia v1.8-?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be pretty unfortunate :p.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for Julia 1.8- my understanding is that it is the same as the old behavior (i.e. it loads ChainRulesCore unconditionally?)

@devmotion
Copy link
Member

Seems the PR is ready and the Registrator deployment is done?

@KristofferC KristofferC marked this pull request as ready for review January 18, 2023 16:22
@KristofferC
Copy link
Member Author

Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants