-
Notifications
You must be signed in to change notification settings - Fork 37
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 #539 from AllenInstitute/release-1.0.5
Release 1.0.5
- Loading branch information
Showing
9 changed files
with
58 additions
and
25 deletions.
There are no files selected for viewing
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 was deleted.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import Union | ||
|
||
def to_str(s: Union[str, bytes] | ||
)-> str: | ||
"""Convert bytes to string if not string | ||
Parameters | ||
---------- | ||
s (Union[str,bytes]): variable to convert | ||
Returns | ||
------- | ||
str | ||
""" | ||
if isinstance(s, bytes): | ||
return s.decode('utf-8') | ||
else: | ||
return s | ||
|
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 +1 @@ | ||
1.0.4 | ||
1.0.5 |
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,4 +1,5 @@ | ||
sphinx | ||
sphinx-gallery | ||
m2r | ||
numpydoc>=0.6.0,<1.0.0 | ||
numpydoc>=0.6.0,<1.0.0 | ||
mistune<2 |
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,22 @@ | ||
from ipfx.string_utils import to_str | ||
import pytest | ||
|
||
|
||
|
||
|
||
@pytest.mark.parametrize( | ||
"input, expected", | ||
[ | ||
# Case 0: supplied string | ||
( | ||
"a_string", "a_string" | ||
), | ||
# Case 1: supplied bytes | ||
( | ||
b"a_string", "a_string" | ||
), | ||
] | ||
) | ||
def test_to_string(input, expected): | ||
obtained = to_str(input) | ||
assert obtained == expected |