-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from anuradhawick/dev
Dev
- Loading branch information
Showing
8 changed files
with
162 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "rsbio-seq" | ||
version = "0.1.2" | ||
version = "0.1.3" | ||
edition = "2021" | ||
authors = [ | ||
"Anuradha Wickramarachchi <[email protected]>", | ||
|
@@ -22,3 +22,9 @@ pyo3 = { version = "0.22.0", features = ["abi3-py39"] } | |
|
||
[features] | ||
extension-module = ["pyo3/extension-module"] | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
lto = true | ||
codegen-units = 1 | ||
panic = "abort" |
This file contains 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 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 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 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 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 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,47 @@ | ||
from rsbio_seq import ascii_to_phred, phred_to_ascii | ||
|
||
|
||
def test_to_phred(): | ||
# Test with typical input | ||
ascii_values = '!"#$%' | ||
expected_phred = [0, 1, 2, 3, 4] | ||
assert ( | ||
ascii_to_phred(ascii_values) == expected_phred | ||
), "Failed: ASCII to Phred conversion with typical input" | ||
|
||
# Test with empty string | ||
ascii_values_empty = "" | ||
expected_phred_empty = [] | ||
assert ( | ||
ascii_to_phred(ascii_values_empty) == expected_phred_empty | ||
), "Failed: ASCII to Phred conversion with empty input" | ||
|
||
# Test with lower boundary edge case | ||
ascii_values_low = chr(33) | ||
expected_phred_low = [0] | ||
assert ( | ||
ascii_to_phred(ascii_values_low) == expected_phred_low | ||
), "Failed: ASCII to Phred conversion with lower boundary" | ||
|
||
|
||
def test_to_ascii(): | ||
# Test with typical input | ||
phred_scores = [0, 1, 2, 3, 4] | ||
expected_ascii = '!"#$%' | ||
assert ( | ||
phred_to_ascii(phred_scores) == expected_ascii | ||
), "Failed: Phred to ASCII conversion with typical input" | ||
|
||
# Test with empty list | ||
phred_scores_empty = [] | ||
expected_ascii_empty = "" | ||
assert ( | ||
phred_to_ascii(phred_scores_empty) == expected_ascii_empty | ||
), "Failed: Phred to ASCII conversion with empty input" | ||
|
||
# Test with zero only | ||
phred_scores_zero = [0] | ||
expected_ascii_zero = "!" | ||
assert ( | ||
phred_to_ascii(phred_scores_zero) == expected_ascii_zero | ||
), "Failed: Phred to ASCII conversion with zero" |