-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: randomgen #13163
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
ENH: randomgen #13163
Conversation
So far I have begun to extend the |
License related question: if we list this under "bundled libraries" with its own license, does it mean that |
It's intended for incorporation. |
Nice. If that NCSA license is absolutely necessary then I guess it's no problem, however for something developed for inclusion in NumPy and only being a part of NumPy going forward, just having it under the NumPy license would be preferred. |
I had to move The The |
@mattip I would think that it should be squashed at least some eventually. When picking, I think it would be nice to keep at least one commit from randomgen contributors in, is possible. |
The current failures are due to cython using its own
|
I think a clear official #12284 would be the best path since it would resolve this ambiguity once and for all. |
@rkern please feel free to push to my branch, I would be happy for collaboration. |
Could maybe add a |
The code is sourced from places other than git. For instance, this file has contributors that do not appear in the git history, and has a different license than the rest of randomgen |
Many (all) of the C source files for the BRNGs have no git history since they were made available from the authors directly. |
@rkern 's idea is clearly the right way to do compat in PCG64. I once tried to do it but gave up since the upside for me was small in randomgen. I found it a bit tricky since Cython understands uint128 and so using a fake type wasn't so simple. At one point I thought some small abstraction beyond a simple #ifdef was needed before I stopped trying. |
which platforms do not support Does the strategy of breaking the single 128bit int into two 64 bit integers with |
Microsoft compilers (of course). |
I looked through it and I believe that it is endian independent (and it passed on ARM, but I'm not sure whether this is BE or LE, and it might depend). @rkern wrote it, so he would know better. |
Tests that come with
answers the demands of the NEP (selectively quoted below) except for the missing Am I on the right track?
|
I used a property for One or both of these should possibly be overruled. Does this the method you have above produce an identical |
The aliases are set in |
One further issue about using the same BRNG between legacy and a modern generator -- the legacy state has an additional value containing the next gaussian, since it uses a polar transformation. This might have some implications for setting the state if the basic RNG is shared. |
I am getting an non-terminating loop in I modified the code to print the values in each loop, details are below. I am not sure of how to provide a better stopping condition when a == 2.0, X == -sys.maxint - 1, V is very large.
code
```
int64_t random_zipf(brng_t *brng_state, double a) {
double T, U, V;
int64_t X;
double am1, b;
am1 = a - 1.0;
am1 1 T 0.188 U 0.518 V 1.8e+308 X -9223372036854775808
|
It helps to debug the debugging code. The |
Remove traces of the three removed bit generators Add lock to Cython examples
Attempt to avoid defining variables that are incorrect for some platforms
This reverts commit 17e0070.
Pep8 fixes Remove unused imports Fix name error
* PERF: Reorder header for philox Reorder header so that support uint128 is always used if avilable, irrespective of platform
hmm, getting a |
tests are passing |
I would like to thank everyone for making this milestone possible. Especially Robert and Kevin who made all of randomgen possible. I am also very happy and impressed to see so many specialists weighing in! I am looking forward to using the new API, thanks all! |
Great. How long does it take for this to make it out to projects that test using prerelease builds of NumPy? As fun as the API discussion is about |
Indeed, I do think we have a few projects testing against master so that should be fairly quick. The big test will be the rc releases probably. |
Would anyone object to a pull request that renames When I first saw the file name, I didn't realize that it was the file I was looking for. It only took a quick look to figure it out, so this isn't a high priority, but I think a more accurate name would be helpful. |
I switched in randomgen after @mattip started the process with https://github.com/bashtage/randomgen/tree/master/randomgen/src/legacy I also moved them to src/legacy which I'm not sure is totally necessary, so I'm +1 on the clarifications. IMO a git mv is minimal churn. Perhaps a comment at the top would be helpful to explain that this is the file where hanged fucntions from distributions.c go to maintain the RandomState promise would be helpful too. |
OK, pull request is #13743 |
@rkern could you rephrase that request in the PR? Do you mean frozen versions of the functions? |
Yes. I mean the canonical version that must be used in RandomState. |
Does their energy intake deviate systematically from the recommended | ||
value of 7725 kJ? | ||
|
||
We ha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the actual output not shown here? Is it because the indeterminate value causes problems with doctests?
A start at mMerging bashtage/randomgen into numpy, as part of NEP 19.The original repo was cloned, moved to a subdirectory, and then merged into numpy, as documented in
_randomgen/README-git.md
.Then I moved the code into
numpy/random
and the docs intodoc/source/random
anddoc/source/papers
.Still very much a work in progress.