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

use the preference system for nan safe mode #539

Merged
merged 1 commit into from
Oct 14, 2021
Merged

Conversation

KristofferC
Copy link
Collaborator

No description provided.

@KristofferC
Copy link
Collaborator Author

Closes #181 I think

@KristofferC KristofferC reopened this Jul 28, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #539 (7639166) into master (80a13d9) will decrease coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #539      +/-   ##
==========================================
- Coverage   84.90%   84.76%   -0.14%     
==========================================
  Files           9        9              
  Lines         828      827       -1     
==========================================
- Hits          703      701       -2     
- Misses        125      126       +1     
Impacted Files Coverage Δ
src/prelude.jl 37.50% <ø> (ø)
src/dual.jl 72.43% <0.00%> (-0.36%) ⬇️
src/apiutils.jl 100.00% <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 80a13d9...7639166. Read the comment docs.

@devmotion
Copy link
Member

What's holding back this PR? It would be great if switching to NaN-safe mode would be easier.

@KristofferC
Copy link
Collaborator Author

Nothing really. Someone to review it perhaps.

Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

My knowledge about Preferences is only based on its README, but according to this it looks good to me. Seems to match the instructions in https://github.com/JuliaPackaging/Preferences.jl#conditional-loading.

@KristofferC KristofferC merged commit 2395bb3 into master Oct 14, 2021
@devmotion devmotion deleted the kc/pref_nan branch October 14, 2021 18:19
@devmotion devmotion mentioned this pull request Oct 14, 2021
@chriselrod
Copy link
Contributor

How does one @set_preferences!?

@devmotion
Copy link
Member

devmotion commented Aug 22, 2022

As a user you would use set_preferences!: https://juliadiff.org/ForwardDiff.jl/dev/user/advanced/#Fixing-NaN/Inf-Issues

@chriselrod
Copy link
Contributor

julia> using ForwardDiff, Preferences

julia> set_preferences!(ForwardDiff, "nansafe_mode" => true)

Ah, thanks!

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