| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…om_shuffle with shuffle and used mersenne twister engine to generate uniform random bit generator for the shuffle.
|
It looks like std::shuffle came in in c++11 which we just switch to having as our floor. It looks like moving that forwards was a good choice as it made this simple (I assume with enough #ifdef we could support a wider range of c++ versions....). This seems reasonable and at least our tests are not sensitive to the different random order. |
Sorry, something went wrong.
|
Thanks @tybeller. It is usual to mention the issue that the PR closes within the text (not just within the title) so that there is a link between the two and the issue automatically closes when the PR is merged. Also, I said in the issue that it would need a release note but I realise now that this is classified as a behaviour change ("API that stays valid but will yield a different result") which therefore needs an API change note. The README file in the next_api_changes directory describes what is required here, see https://github.com/matplotlib/matplotlib/blob/main/doc/api/next_api_changes/README.rst and let me know if this is not clear enough and I will help out. |
Sorry, something went wrong.
|
Thank you, sorry for any issues as this is my first time. If I'm reading this right I need to add the issue within the pull request and add and API change note correct? I'll get working on that and please let me know if there is anything else I'm missing. |
Sorry, something went wrong.
|
One question, is there a way to edit these changes into this pull request or should I make a separate pull request with these fixes? |
Sorry, something went wrong.
|
@tybeller if you edit your original post here and put “closes #24010“, that will link the issue to the PR, see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword Once you make any changes to you branch and push them to github, they will show in this pull request. There is advice for updating your branch in response to the review here: https://matplotlib.org/devdocs/devel/coding_guide.html#summary-for-pull-request-authors |
Sorry, something went wrong.
Added API notes for changed output from TrapezoidMapTriFinder, triangulation interpolation, and refinement
There was a problem hiding this comment.
The code changes are fine, just a slight tweak to the API change note and this will be good to merge.
Sorry, something went wrong.
Fix api change Co-authored-by: Ian Thomas <ianthomas23@gmail.com>
| @@ -0,0 +1,3 @@ | |||
| Change in TrapezoidMapTriFinder, triangulation interpolation, and refinement output due to change in shuffle. | |||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
There was a problem hiding this comment.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
would solve the failing doc build (if I got the length right...).
Sorry, something went wrong.
There was a problem hiding this comment.
If you're having trouble aligning the underline, then that's a sign the title is probably too long. I would leave out all of the details and just say "Change in triangulation output ..." Also, no trailing period in titles.
Sorry, something went wrong.
| @@ -0,0 +1,3 @@ | |||
| Change in TrapezoidMapTriFinder, triangulation interpolation, and refinement output due to change in shuffle. | |||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
There was a problem hiding this comment.
If you're having trouble aligning the underline, then that's a sign the title is probably too long. I would leave out all of the details and just say "Change in triangulation output ..." Also, no trailing period in titles.
Sorry, something went wrong.
| @@ -0,0 +1,3 @@ | |||
| Change in TrapezoidMapTriFinder, triangulation interpolation, and refinement output due to change in shuffle. | |||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
| With std::random_shuffle removed from C++17, TrapezoidMapTriFinder, triangular grid interpolation and refinement now use std::shuffle with a new random generator which may give different results. | |||
There was a problem hiding this comment.
Different results how? Does a plot change? Is the order different? This is too vague and as a user I have no idea whether I need to do anything here. Also, please word-wrap lines at 80 characters.
Sorry, something went wrong.
Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com>
clarified that the conditions of the change in output
|
@tybeller The definition of class RandomNumberGenerator at the end of src/tri/_tri.h can be removed. |
Sorry, something went wrong.
|
Here is a possible improved api change note: ``TrapezoidMapTriFinder`` uses different random number generator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The random number generator used to determine the order of insertion of triangle edges in ``TrapezoidMapTriFinder`` has changed. This can result in a different triangle index being returned for a point that lies exactly on an edge between two triangles. This can also affect triangulation interpolation and refinement algorithms that use ``TrapezoidMapTriFinder``. |
Sorry, something went wrong.
Updated with ianthomas23's API documentations
|
@tybeller Don't forget the changes in src/tri/_tri.h. |
Sorry, something went wrong.
| _seed = (_seed*_a + _c) % _m; | ||
| return (_seed*max_value) / _m; | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please end the file with an empty line. That will fix the pre-commit issue. (The pyside6 issue is fixed in #24158.)
Sorry, something went wrong.
added empty line at end
|
Thank you for this work @tybeller and congratulations on your first merged Matplotlib PR 🎉 Hopefully we will hear from you again! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Replaced std::random_shuffle with std::shuffle for compliance with C++17. Deleted RandomNumberGenerator class. Included random library and used 32 bit mersenne twister as uniform random bit generator for shuffle. Note: TrapezoidMapTriFinder, triangulation interpolation, and refinement may yield different results due to this change. Closes #24010
PR Checklist
Tests and Styling
Documentation