From c9344ceb607d7b9bb3fde6f5a64943507454b9e7 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 16 Jul 2012 23:02:11 -0400 Subject: [PATCH] Add the test suite that's been driving today's changes. Samples are from TN003.zip, downloaded from ftp://www.wavemetrics.net/IgorPro/Technical_Notes/TN003.zip --- README | 2 +- test/data/README | 1 + test/data/mac-double.ibw | Bin 0 -> 182 bytes test/data/mac-textWave.ibw | Bin 0 -> 422 bytes test/data/mac-version2.ibw | Bin 0 -> 177 bytes test/data/mac-version3Dependent.ibw | Bin 0 -> 150 bytes test/data/mac-version5.ibw | Bin 0 -> 483 bytes test/data/mac-zeroPointWave.ibw | Bin 0 -> 384 bytes test/data/win-double.ibw | Bin 0 -> 182 bytes test/data/win-textWave.ibw | Bin 0 -> 422 bytes test/data/win-version2.ibw | Bin 0 -> 177 bytes test/data/win-version5.ibw | Bin 0 -> 483 bytes test/data/win-zeroPointWave.ibw | Bin 0 -> 384 bytes test/test.py | 614 ++++++++++++++++++++++++++++ 14 files changed, 616 insertions(+), 1 deletion(-) create mode 100644 test/data/README create mode 100644 test/data/mac-double.ibw create mode 100644 test/data/mac-textWave.ibw create mode 100644 test/data/mac-version2.ibw create mode 100644 test/data/mac-version3Dependent.ibw create mode 100644 test/data/mac-version5.ibw create mode 100644 test/data/mac-zeroPointWave.ibw create mode 100644 test/data/win-double.ibw create mode 100644 test/data/win-textWave.ibw create mode 100644 test/data/win-version2.ibw create mode 100644 test/data/win-version5.ibw create mode 100644 test/data/win-zeroPointWave.ibw create mode 100644 test/test.py diff --git a/README b/README index f76d225..6b73aae 100644 --- a/README +++ b/README @@ -57,7 +57,7 @@ Testing Run internal unit tests with:: - $ nosetests --with-doctest --doctest-tests igor + $ nosetests --with-doctest --doctest-tests igor test Licence diff --git a/test/data/README b/test/data/README new file mode 100644 index 0000000..4f621bf --- /dev/null +++ b/test/data/README @@ -0,0 +1 @@ +.ibw samples are from TN003.zip. diff --git a/test/data/mac-double.ibw b/test/data/mac-double.ibw new file mode 100644 index 0000000000000000000000000000000000000000..9518508867b743fdbed9757e390341eb3c55ec6b GIT binary patch literal 182 zcmZQzVqjoc2E<^HWXQk*Vx;7kCgr3;#PE=;3=H-k@W^A4+Vo;Z69WT;WMFU*fhchh RfYKaL8mbeU>B>$F3;>`84Hp0a literal 0 HcmV?d00001 diff --git a/test/data/mac-textWave.ibw b/test/data/mac-textWave.ibw new file mode 100644 index 0000000000000000000000000000000000000000..4d8334e076afed1fb87e92691687171af5dbddc5 GIT binary patch literal 422 zcmZQz72U+Zz!=0p8W2HNzUf7HJrMT;#aNNV8B0a0OPZ$hVX29Tp6gS1^}1k5BC57 literal 0 HcmV?d00001 diff --git a/test/data/win-double.ibw b/test/data/win-double.ibw new file mode 100644 index 0000000000000000000000000000000000000000..ec768b878c681ecb17ee8efc0bbcc5143c3e1620 GIT binary patch literal 182 zcmZQ#SjK<=N`)+7PD*}hQcfyD92<)jN$`U`5(h7{X~v693=9wwrclHI!V-Ye98j78 IN@JQ10E!I^vH$=8 literal 0 HcmV?d00001 diff --git a/test/data/win-textWave.ibw b/test/data/win-textWave.ibw new file mode 100644 index 0000000000000000000000000000000000000000..416cc0210555bdda7f461cab59fbc687b46aa33d GIT binary patch literal 422 zcmZQ&*ufCQ$UqVhK~r5H{$f)<5VN9)GcuHVv8IU=Ly8qG9TW z0*we@1+a4k|9IGzGrWHz literal 0 HcmV?d00001 diff --git a/test/data/win-version2.ibw b/test/data/win-version2.ibw new file mode 100644 index 0000000000000000000000000000000000000000..1a3f7a0143f940985011265b3b6f463de434e555 GIT binary patch literal 177 zcmZQ#n8d)qzz@VAAkM-Brpr=`iZk=`jKCZm1S^vG2YVzAUS@a2<4p_0!c)O{_p+Cb$$MLs@E3ab|v=DO?B( z!(~@B14thx_+Sqa!$o82poWNoK@EyAJR+!k6iK2v&;SOimjmk&{PO{B?g9q}h6W&Z k0AdCZ+dd>CvseL$5*12Pi%ax?!gzsmeokp_o&ioZ0MG6q(*OVf literal 0 HcmV?d00001 diff --git a/test/data/win-zeroPointWave.ibw b/test/data/win-zeroPointWave.ibw new file mode 100644 index 0000000000000000000000000000000000000000..521af569cd82ad19420abc5d8a8e447d39dfb6eb GIT binary patch literal 384 zcmZQ&n40at$Urs_k*Z>> dump('mac-double.ibw', strict=False) # doctest: +REPORT_UDIFF +array([ 5., 4., 3., 2., 1.]) +{'checksum': 25137, + 'note': '', + 'noteSize': 0, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 166} +{'aModified': 0, + 'bname': array(['d', 'o', 'u', 'b', 'l', 'e', '', '', '', '', '', '', '', '', '', + '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001587842, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 3001587842, + 'next': 0, + 'npnts': 5, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 4, + 'useBits': '\x00', + 'wData': array([ 2.3125, 0. , 2.25 , 0. ]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} + +>>> dump('mac-textWave.ibw') # doctest: +REPORT_UDIFF +array(['Mary', 'had', 'a', 'little', 'lamb'], + dtype='|S6') +{'checksum': 5554, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': '', + 'formulaSize': 0, + 'note': '', + 'noteSize': 0, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndices': '\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x0e\x00\x00\x00\x12', + 'sIndicesSize': 20, + 'version': 5, + 'wfmSize': 338} +{'aModified': 0, + 'bname': array(['t', 'e', 'x', 't', '0', '', '', '', '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001571199, + 'dFolder': 69554896, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 22, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], + ['', '', '', ''], + ['', '', '', ''], + ['', '', '', '']], + dtype='|S1'), + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 3001571215, + 'nDim': array([5, 0, 0, 0]), + 'next': 0, + 'npnts': 5, + 'sIndices': 69557296, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': 0, + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 0, + 'useBits': '\x00', + 'wData': 236398480.0, + 'wModified': 0, + 'waveNoteH': 0, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} + +>>> dump('mac-version2.ibw', strict=False) # doctest: +REPORT_UDIFF +array([ 5., 4., 3., 2., 1.], dtype=float32) +{'checksum': -16803, + 'note': 'This is a test.', + 'noteSize': 15, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 146} +{'aModified': 0, + 'bname': array(['v', 'e', 'r', 's', 'i', 'o', 'n', '2', '', '', '', '', '', '', '', + '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001251979, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 3001573594, + 'next': 0, + 'npnts': 5, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': array([ 5., 4., 3., 2.]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} + +>>> dump('mac-version3Dependent.ibw', strict=False) # doctest: +REPORT_UDIFF +array([], dtype=int8) +{'checksum': 0, + 'formula': '', + 'formulaSize': 0, + 'note': '', + 'noteSize': 8257536, + 'pictSize': 262144, + 'version': 3, + 'wfmSize': 0} +{'aModified': 10, + 'bname': array(['', '', 'v', 'e', 'r', 's', 'i', 'o', 'n', '3', 'D', 'e', 'p', 'e', + 'n', 'd', 'e', 'n', 't', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 1507328, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': -487849984, + 'fileName': 0, + 'formula': 1577, + 'fsValid': 1, + 'hsA': 4.5193417557662e-309, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 45801, + 'next': 131072, + 'npnts': 0, + 'srcFldr': 0, + 'swModified': 1, + 'topFullScale': 0.0, + 'type': -32334, + 'useBits': '\x00', + 'wData': array([ 0., 0., 0., 0.]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 3835494400, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} + +>>> dump('mac-version5.ibw') # doctest: +REPORT_UDIFF +array([ 5., 4., 3., 2., 1.], dtype=float32) +{'checksum': -12033, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [['Column0'], [], [], []], + 'dimLabelsSize': array([64, 0, 0, 0]), + 'formula': '', + 'formulaSize': 0, + 'note': 'This is a test.', + 'noteSize': 15, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 340} +{'aModified': 0, + 'bname': array(['v', 'e', 'r', 's', 'i', 'o', 'n', '5', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001252180, + 'dFolder': 69554896, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 27, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([69554136, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], + ['', '', '', ''], + ['', '', '', ''], + ['', '', '', '']], + dtype='|S1'), + 'fileName': 69554292, + 'formula': 0, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 3001573601, + 'nDim': array([5, 0, 0, 0]), + 'next': 69555212, + 'npnts': 5, + 'sIndices': 0, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': -32349, + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 5.0, + 'wModified': 0, + 'waveNoteH': 69554032, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} + +>>> dump('mac-zeroPointWave.ibw') # doctest: +REPORT_UDIFF +array([], dtype=float32) +{'checksum': -15649, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': '', + 'formulaSize': 0, + 'note': '', + 'noteSize': 0, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 320} +{'aModified': 3, + 'bname': array(['z', 'e', 'r', 'o', 'W', 'a', 'v', 'e', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001573964, + 'dFolder': 69554896, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 29, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], + ['', '', '', ''], + ['', '', '', ''], + ['', '', '', '']], + dtype='|S1'), + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 3001573964, + 'nDim': array([0, 0, 0, 0]), + 'next': 0, + 'npnts': 0, + 'sIndices': 0, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': 0, + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 0.0, + 'wModified': 1, + 'waveNoteH': 0, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} + +>>> dump('win-double.ibw') # doctest: +REPORT_UDIFF +array([ 5., 4., 3., 2., 1.]) +{'checksum': 28962, + 'note': '', + 'noteSize': 0, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 166} +{'aModified': 0, + 'bname': array(['d', 'o', 'u', 'b', 'l', 'e', '', '', '', '', '', '', '', '', '', + '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001587842, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 3001587842, + 'next': 0, + 'npnts': 5, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 4, + 'useBits': '\x00', + 'wData': array([ 0. , 2.3125, 0. , 2.25 ]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} + +>>> dump('win-textWave.ibw') # doctest: +REPORT_UDIFF +array(['Mary', 'had', 'a', 'little', 'lamb'], + dtype='|S6') +{'checksum': 184, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': '', + 'formulaSize': 0, + 'note': '', + 'noteSize': 0, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndices': '\x04\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x0e\x00\x00\x00\x12\x00\x00\x00', + 'sIndicesSize': 20, + 'version': 5, + 'wfmSize': 338} +{'aModified': 0, + 'bname': array(['t', 'e', 'x', 't', '0', '', '', '', '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001571199, + 'dFolder': 8108612, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 32, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], + ['', '', '', ''], + ['', '', '', ''], + ['', '', '', '']], + dtype='|S1'), + 'fileName': 7814472, + 'formula': 0, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 3001571215, + 'nDim': array([5, 0, 0, 0]), + 'next': 0, + 'npnts': 5, + 'sIndices': 8133100, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': -1007, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 0, + 'useBits': '\x00', + 'wData': 7.865683337909351e+34, + 'wModified': 1, + 'waveNoteH': 0, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} + +>>> dump('win-version2.ibw') # doctest: +REPORT_UDIFF +array([ 5., 4., 3., 2., 1.], dtype=float32) +{'checksum': 1047, + 'note': 'This is a test.', + 'noteSize': 15, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 146} +{'aModified': 0, + 'bname': array(['v', 'e', 'r', 's', 'i', 'o', 'n', '2', '', '', '', '', '', '', '', + '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001251979, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 3001573594, + 'next': 0, + 'npnts': 5, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': array([ 5., 4., 3., 2.]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} + +>>> dump('win-version5.ibw') # doctest: +REPORT_UDIFF +array([ 5., 4., 3., 2., 1.], dtype=float32) +{'checksum': 13214, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [['Column0'], [], [], []], + 'dimLabelsSize': array([64, 0, 0, 0]), + 'formula': '', + 'formulaSize': 0, + 'note': 'This is a test.', + 'noteSize': 15, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 340} +{'aModified': 0, + 'bname': array(['v', 'e', 'r', 's', 'i', 'o', 'n', '5', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001252180, + 'dFolder': 8108612, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 30, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([8138784, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], + ['', '', '', ''], + ['', '', '', ''], + ['', '', '', '']], + dtype='|S1'), + 'fileName': 8131824, + 'formula': 0, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 3001573601, + 'nDim': array([5, 0, 0, 0]), + 'next': 8125236, + 'npnts': 5, + 'sIndices': 0, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': -1007, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 5.0, + 'wModified': 1, + 'waveNoteH': 8131596, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} + +>>> dump('win-zeroPointWave.ibw') # doctest: +REPORT_UDIFF +array([], dtype=float32) +{'checksum': 27541, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': '', + 'formulaSize': 0, + 'note': '', + 'noteSize': 0, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 320} +{'aModified': 3, + 'bname': array(['z', 'e', 'r', 'o', 'W', 'a', 'v', 'e', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + dtype='|S1'), + 'botFullScale': 0.0, + 'creationDate': 3001573964, + 'dFolder': 8108612, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 31, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], + ['', '', '', ''], + ['', '', '', ''], + ['', '', '', '']], + dtype='|S1'), + 'fileName': 8125252, + 'formula': 0, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 3001573964, + 'nDim': array([0, 0, 0, 0]), + 'next': 8133140, + 'npnts': 0, + 'sIndices': 0, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': -1007, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 0.0, + 'wModified': 1, + 'waveNoteH': 0, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} +""" + +import os.path +from pprint import pformat +import sys + +from igor.binarywave import loadibw + + +_this_dir = os.path.dirname(__file__) +_data_dir = os.path.join(_this_dir, 'data') + +def dump(filename, strict=True): + sys.stderr.write('Testing {}\n'.format(filename)) + path = os.path.join(_data_dir, filename) + data,bin_info,wave_info = loadibw(path, strict=strict) + pprint(data) + pprint(bin_info) + pprint(wave_info) + +def pprint(data): + lines = pformat(data).splitlines() + print('\n'.join([line.rstrip() for line in lines])) -- 2.26.2