Skip to content

Commit

Permalink
Version bump to 1.0.0, since package structure should not change too …
Browse files Browse the repository at this point in the history
…much and deployment is somewhat streamlined now.
  • Loading branch information
tmtenbrink committed Sep 19, 2021
1 parent ca32010 commit 7fca4ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustfrc"
version = "0.1.2"
version = "1.0.0"
edition = "2018"

[lib]
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[tool.poetry]
name = "rustfrc"
version = "0.1.2"
version = "1.0.0"
description = "Package with some fast Rust functions for use with FRC resolution determination for microscopy. TU Delft BEP 2021-2022."
authors = ["Tip ten Brink <[email protected]>"]
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Rust",
Expand Down
3 changes: 2 additions & 1 deletion rustfrc/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@


def binom_split(a: np.ndarray) -> np.ndarray:
"""Takes an image (some) and splits every pixel value according to the
"""Takes an image (numpy array) and splits every pixel (element) value according to the
binomial distribution (n, p) with n = pixel value and p = 0.5. Returns a single image.
This conserves shot noise.
"""
return _internal.binom_split(a.astype(np.int32))
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ fn rustfrc(py: Python<'_>, m: &PyModule) -> PyResult<()> {
Ok(())
}


/// binom_split(a)
/// --
///
Expand All @@ -31,6 +30,8 @@ fn binom_split<'py>(py: Python<'py>, a: PyReadonlyArrayDyn<'py, i32>) -> PyResul
if error_i.load(Ordering::Relaxed) == 0 {
let mut rng = thread_rng();
let n = u64::try_from(i).unwrap_or_else(|_| {
// Since this is a parallel function, a special AtomicI32 is necessary to communicate
// if there is a failure.
error_i.store(i, Ordering::Relaxed);
0
});
Expand Down

0 comments on commit 7fca4ad

Please sign in to comment.