-
Notifications
You must be signed in to change notification settings - Fork 124
BitGenerator support #499
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
Open
flying-sheep
wants to merge
47
commits into
PyO3:main
Choose a base branch
from
flying-sheep:pa/bitgen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
BitGenerator support #499
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
06d6ce1
WIP bitgen
flying-sheep 07e2416
nonnull
flying-sheep b611943
fix and test
flying-sheep d93a264
cmt
flying-sheep f52b2fa
safer: don’t allow trying to get `BitGen` from any PyAny
flying-sheep 05814d6
less indirection
flying-sheep 37d360e
add tryfrom
flying-sheep eed5b19
implement rand
flying-sheep 6c1a89b
fmt
flying-sheep d1909d3
rename and deref
flying-sheep bde2553
order
flying-sheep a0b9ec5
make into lock
flying-sheep ee32246
docs
flying-sheep 1be6838
more docs
flying-sheep 2aa3d90
guard
flying-sheep 0258e6d
call_method0
flying-sheep 876001b
reaname test
flying-sheep 71ce8be
manually drop and capsule
flying-sheep 2de7072
remove useless test
flying-sheep 016eb7a
doctests
flying-sheep 1f7f37f
smaller
flying-sheep 1d01c7a
clarify where to release the GIL
flying-sheep c90176a
safety
flying-sheep f49d3fa
oops
flying-sheep a16846d
less unsafe
flying-sheep 573d890
add thread test
flying-sheep 06bb693
back to lock acquiring
flying-sheep 663fa29
docs
flying-sheep c6105c9
no copy/clone
flying-sheep 3a0aa92
rename to release
flying-sheep a92861a
remove lifetime
flying-sheep 6dbb6dc
static
flying-sheep b102d20
no mut ref conversion
flying-sheep e5e440e
disambiguate
flying-sheep e73e3a2
rand_core only
flying-sheep c6493df
rename bitgen type
flying-sheep 2327f36
c_str macro
flying-sheep e5c6458
intern strings
flying-sheep e8cd5e8
docs
flying-sheep 0868405
more doc
flying-sheep 8667203
clean up tests
flying-sheep 1fd7bb5
no let-else
flying-sheep 3913171
use GILOnceCell::import
flying-sheep 7bc0be8
add `released` attr
flying-sheep 8caf054
f64
flying-sheep d8b62ac
correct locking
flying-sheep 43e2d97
test that double locking fails
flying-sheep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"[rust]": { | ||
"editor.defaultFormatter": "rust-lang.rust-analyzer", | ||
"editor.formatOnSave": true, | ||
}, | ||
"rust-analyzer.cargo.features": "all", | ||
} | ||
flying-sheep marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use std::ffi::c_void; | ||
|
||
#[repr(C)] | ||
#[derive(Debug)] | ||
pub struct bitgen_t { | ||
pub state: *mut c_void, | ||
pub next_uint64: unsafe extern "C" fn(*mut c_void) -> super::npy_uint64, //nogil | ||
pub next_uint32: unsafe extern "C" fn(*mut c_void) -> super::npy_uint32, //nogil | ||
pub next_double: unsafe extern "C" fn(*mut c_void) -> libc::c_double, //nogil | ||
pub next_raw: unsafe extern "C" fn(*mut c_void) -> super::npy_uint64, //nogil | ||
flying-sheep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
Oops, something went wrong.
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.
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.
This should be removed
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.
sure, will do when I’m done. I like working on multiple machines, and I don’t like re-doing settings for individual projects