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

Pass RNG as first argument #4

Merged
merged 1 commit into from
Jan 16, 2019
Merged

Conversation

devmotion
Copy link
Member

It seems the convention in Julia is to pass the random number generator as first argument, see e.g. the documentation of rand, rand!, and randn!. I changed the definitions of count_rand, ad_rand, and pois_rand accordingly.

Moreover, when I updated the README I realized that not only the benchmarks do not consider some already existing implementations of the algorithms in this package in Distributions but also compare the performance of different random number generators - n_dist uses Rmath's internal random number generator whereas the other functions (n_count, n_ad, and n_pois) use rng = Xorshifts.Xoroshiro128Plus(). I'm not sure whether this could explain the differences seen in the benchmarks but at least it does not seem to be completely fair.

@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #4 into master will decrease coverage by 0.73%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
- Coverage    55.4%   54.66%   -0.74%     
==========================================
  Files           1        1              
  Lines          74       75       +1     
==========================================
  Hits           41       41              
- Misses         33       34       +1
Impacted Files Coverage Δ
src/PoissonRandom.jl 54.66% <100%> (-0.74%) ⬇️

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 82d88c6...96d39e7. Read the comment docs.

@ChrisRackauckas
Copy link
Member

Oops, thanks. Can you make sure an update gets to DiffEqJump as well?

@ChrisRackauckas ChrisRackauckas merged commit 9860b09 into SciML:master Jan 16, 2019
@devmotion devmotion deleted the change_order branch January 16, 2019 08:09
@devmotion
Copy link
Member Author

Sure, I also didn't consider the fact that it's a breaking change... I checked METADATA and it seems that DiffEqJump is the only registered package that depends on PoissonRandom, so I guess it's not necessary to add a deprecation warning and we can just upper bound existing releases of DiffEqJump, release a new version of PoissonRandom, change the order of the arguments in DiffEqJump, and then release a new version of DiffEqJump.

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.

2 participants