Draft: Get rid of deprecation warnings#45
Open
nordlow wants to merge 24 commits intoDlangScience:masterfrom
Open
Draft: Get rid of deprecation warnings#45nordlow wants to merge 24 commits intoDlangScience:masterfrom
nordlow wants to merge 24 commits intoDlangScience:masterfrom
Conversation
skoppe
reviewed
Sep 4, 2021
Author
|
Shall I move static if (__VERSION__ < 2096)
alias approxEqual = std.math.approxEqual;
else
bool approxEqual(T, U, V)(T lhs, U rhs, V maxRelDiff = 1e-2, V maxAbsDiff = 1e-5)
{
return std.math.isClose(lhs, rhs, maxRelDiff, maxAbsDiff); // mimic old sloppy approxEqual for now
}to a common place? Say, |
|
What I understand from this:
It seems to me for the modules you did manage to fix you would want to use the Instead of hijacking For the modules you didn't manage to fix you should not hide the deprecation warnings, however horrid they are. |
Author
|
I think I've found a way to automate the precision refactoring of the |
John-Colvin
reviewed
Sep 8, 2021
John-Colvin
reviewed
Sep 8, 2021
Member
yes |
Author
|
Gonna try update the constants now and hopefully get rid of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gets rid of deprecation warnings via:
body=>doapproxEqual=>isClose: I started updating all those darn floating point literals to a better precision to fitisClose's requirements but I got fed up with it because it wasted a lot of time and I couldn't find a way to automated it. So I added anapproxEqualthat mimics old deprecated version to make tests pass without warnings nor unittest failures. But kept the constants refactorings. I can continue updating the rest of literals if needed but I'd rather not. :)dstats-test-libraryReady for review now, @John-Colvin .
For reference see https://dlang.org/changelog/2.096.0.html#deprecate-approxEqual.