Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Unreleased
- fix: preserve column-major ordering of multidimensional text waves (#25)
0.5.13
- fix: thread safety issues and add better concurrent tests (#27)
0.5.12
Expand Down
2 changes: 1 addition & 1 deletion igor2/binarywave.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def post_unpack(self, parents, data):
wdata = _numpy.array(strings)
shape = [n for n in wave_header['nDim'] if n > 0] or (0,)
try:
wdata = wdata.reshape(shape)
wdata = wdata.reshape(shape, order='F')
except ValueError:
logger.error(
'could not reshape strings from %s to %s',
Expand Down
5 changes: 5 additions & 0 deletions tests/data/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

polar-graphs-demo.pxp was distributed with IGOR Pro 5.04 as
Examples/Graphing Techniques/Obsolete/Polar Graphs Demo.pxp

text3.ibw was provided by jbemis99 in issue #25:
https://github.com/AFM-analysis/igor2/issues/25
The 3-by-2 text wave contains columns (cat, dog, fish) and
(tiger, wolf, shark), as shown by the reporter in Igor Pro.
Binary file added tests/data/text3.ibw
Binary file not shown.
12 changes: 12 additions & 0 deletions tests/test_ibw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from helper import assert_equal_dump_no_whitespace_no_byte, dumpibw
from helper import data_dir, loadibw


def test_ibw01():
Expand Down Expand Up @@ -629,3 +630,14 @@ def test_ibw_10():
'whpad4': 0}}}
"""
assert_equal_dump_no_whitespace_no_byte(act, exp)


def test_multidimensional_text_wave():
data = loadibw(data_dir / 'text3.ibw')['wave']['wData']

assert data.shape == (3, 2)
assert data.tolist() == [
[b'cat', b'tiger'],
[b'dog', b'wolf'],
[b'fish', b'shark'],
]
Loading