Skip to content

Commit

Permalink
tests: workaround for broken numpy repr
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jul 21, 2023
1 parent d15148e commit de0bf5d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.5.3
- setup: bump numpy to 1.25.1
- tests: workaround for broken numpy repr
0.5.2
- docs: cleanup readme
0.5.1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
]
license = {text = "GNU Lesser General Public License v3 or later (LGPLv3+)"}
dependencies = [
"numpy",
"numpy>=1.25.1",
]
dynamic = ["version"]

Expand Down
14 changes: 9 additions & 5 deletions tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@

from igor2.binarywave import load as loadibw


data_dir = pathlib.Path(__file__).parent / "data"


def assert_equal_dump_no_whitespace_no_byte(data_a, data_b):
a = data_a.replace(" ", "").replace("b'", "'").replace("\n", "")
b = data_b.replace(" ", "").replace("b'", "'").replace("\n", "")
assert a == b
def repl(x):
return x.replace(
" ", "").replace(
"b'", "'").replace(
"\n", "").replace(
"float32", "'>f4'")

assert repl(data_a) == repl(data_b)


def dumpibw(filename):
Expand All @@ -26,4 +30,4 @@ def format_data(data):

def walk_callback(dirpath, key, value):
return 'walk callback on ({}, {}, {})'.format(
dirpath, key, '{...}' if isinstance(value, dict) else value)
dirpath, key, '{...}' if isinstance(value, dict) else value)
2 changes: 1 addition & 1 deletion tests/test_ibw.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_ibw01():
'wfmSize': 166},
'note': '',
'padding': array([], dtype=float64),
'wData': array([ 5., 4., 3., 2., 1.]),
'wData': array([ 5., 4., 3., 2., 1.], dtype=float32),
'wave_header': {'aModified': 0,
'bname': 'double',
'botFullScale': 0.0,
Expand Down

0 comments on commit de0bf5d

Please sign in to comment.