From 1d20423e54811b421c59687cd0979775400feee6 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Feb 29 2016 16:15:45 +0000 Subject: Import package --- diff --git a/.gitignore b/.gitignore index e69de29..89d4202 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/igor-2c2a79d.tar.gz diff --git a/0001-Do-not-print-dictionaries-in-test-output.patch b/0001-Do-not-print-dictionaries-in-test-output.patch new file mode 100644 index 0000000..567a54e --- /dev/null +++ b/0001-Do-not-print-dictionaries-in-test-output.patch @@ -0,0 +1,129 @@ +From 0ea0895585f401af4870add85211b7584cbf9ba0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 28 Feb 2016 12:15:58 -0500 +Subject: [PATCH] Do not print dictionaries in test output + +Order of keys in the dictionary is not reliable. The order is +pseudo-random under Python 3. + +Tests still pass under Python 2. +--- + test/test.py | 82 ++++-------------------------------------------------------- + 1 file changed, 5 insertions(+), 77 deletions(-) + +diff --git a/test/test.py b/test/test.py +index 841cf452c9..c470972e88 100644 +--- a/test/test.py ++++ b/test/test.py +@@ -1,5 +1,7 @@ + # Copyright + ++from __future__ import print_function ++ + r"""Test the igor module by loading sample files. + + >>> dumpibw('mac-double.ibw') # doctest: +REPORT_UDIFF +@@ -1341,80 +1343,7 @@ record 49: + record 50: + '#include version >= 3.0\n' + +-filesystem: +-{'root': {'K0': 0.0, +- 'K1': 0.0, +- 'K10': 0.0, +- 'K11': 0.0, +- 'K12': 0.0, +- 'K13': 0.0, +- 'K14': 0.0, +- 'K15': 0.0, +- 'K16': 0.0, +- 'K17': 0.0, +- 'K18': 0.0, +- 'K19': 0.0, +- 'K2': 0.0, +- 'K20': 128.0, +- 'K3': 0.0, +- 'K4': 0.0, +- 'K5': 0.0, +- 'K6': 0.0, +- 'K7': 0.0, +- 'K8': 0.0, +- 'K9': 0.0, +- 'Packages': {'PolarGraphs': {'V_bottom': 232.0, +- 'V_left': 1.0, +- 'V_max': 2.4158518093414401, +- 'V_min': -2.1848498883412, +- 'V_right': 232.0, +- 'V_top': 1.0, +- 'u_UniqWaveNdx': 8.0, +- 'u_UniqWinNdx': 3.0, +- 'u_angle0': 0.0, +- 'u_angleRange': 6.2831853071795862, +- 'u_colorList': 'black;blue;green;cyan;red;magenta;yellow;white;special', +- 'u_debug': 0.0, +- 'u_debugStr': 'Turn Debugging On', +- 'u_majorDelta': 0.0, +- 'u_numPlaces': 0.0, +- 'u_polAngle0': 0.26179938779914941, +- 'u_polAngleAxesWherePop': 'Off;Radius Start;Radius End;Radius Start and End;All Major Radii;At Listed Radii', +- 'u_polAngleRange': 1.0471975511965976, +- 'u_polAngleUnitsPop': 'deg;rad', +- 'u_polInnerRadius': -20.0, +- 'u_polLineStylePop': 'solid;dash 1;dash 2;dash 3;dash 4;dash 5;dash 6;dash 7;dash 8;dash 9;dash 10;dash 11;dash 12;dash 13;dash 14;dash 15;dash 16;dash 17;', +- 'u_polMajorAngleInc': 0.26179938779914941, +- 'u_polMajorRadiusInc': 10.0, +- 'u_polMinorAngleTicks': 3.0, +- 'u_polMinorRadiusTicks': 1.0, +- 'u_polOffOn': 'Off;On', +- 'u_polOuterRadius': 0.0, +- 'u_polRadAxesWherePop': ' Off; Angle Start; Angle Middle; Angle End; Angle Start and End; 0; 90; 180; -90; 0, 90; 90, 180; -180, -90; -90, 0; 0, 180; 90, -90; 0, 90, 180, -90; All Major Angles; At Listed Angles', +- 'u_polRotPop': ' -90; 0; +90; +180', +- 'u_popup': '', +- 'u_prompt': '', +- 'u_segsPerMinorArc': 3.0, +- 'u_tickDelta': 0.0, +- 'u_var': 0.0, +- 'u_x1': 11.450159535018935, +- 'u_x2': 12.079591517721363, +- 'u_y1': 42.732577139459856, +- 'u_y2': 45.081649278814126}, +- 'WMDataBase': {'u_dataBase': ';PolarGraph0:,appendRadius=radiusData,...,useCircles=2,maxArcLine=6;', +- 'u_dbBadStringChars': ',;=:', +- 'u_dbCurrBag': 'PolarGraph1', +- 'u_dbCurrContents': ',appendRadius=radiusQ1,...,useCircles=2,maxArcLine=6;', +- 'u_dbReplaceBadChars': '\xa9\xae\x99\x9f', +- 'u_str': '2'}}, +- 'W_plrX5': , +- 'W_plrX6': , +- 'W_plrY5': , +- 'W_plrY6': , +- 'angleData': , +- 'angleQ1': , +- 'radiusData': , +- 'radiusQ1': }} ++filesystem keys: ['root'] + + walking filesystem: + walk callback on ([], root, {'K0': 0.0,...}) +@@ -1456,7 +1385,7 @@ def dumpibw(filename): + + def walk_callback(dirpath, key, value): + print('walk callback on ({}, {}, {})'.format( +- dirpath, key, pformat(value))) ++ dirpath, key, '{...}' if isinstance(value, dict) else value)) + + def dumppxp(filename, walk=True): + LOG.info('Testing {}\n'.format(filename)) +@@ -1474,8 +1403,7 @@ def dumppxp(filename, walk=True): + pprint(record.wave) + else: + pprint(record) +- print('\nfilesystem:') +- pprint(filesystem) ++ print('\nfilesystem keys:', sorted(filesystem.keys())) + if walk: + print('\nwalking filesystem:') + _walk(filesystem, walk_callback) +-- +2.5.0 + diff --git a/0002-OSError-is-used-under-Python-3.patch b/0002-OSError-is-used-under-Python-3.patch new file mode 100644 index 0000000..90da007 --- /dev/null +++ b/0002-OSError-is-used-under-Python-3.patch @@ -0,0 +1,25 @@ +From 6a2920855b219c54be864cce98bd448c615f4f3a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 28 Feb 2016 12:16:44 -0500 +Subject: [PATCH] OSError is used under Python 3 + +--- + test/test-igorpy.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test-igorpy.py b/test/test-igorpy.py +index 1f88927e35..a015b33ea0 100644 +--- a/test/test-igorpy.py ++++ b/test/test-igorpy.py +@@ -170,7 +170,7 @@ Try to load a binary wave: + >>> d = igor.load(path) + Traceback (most recent call last): + ... +-IOError: final record too long; bad pxp file? ++OSError: final record too long; bad pxp file? + """ + + import os.path +-- +2.5.0 + diff --git a/0003-Add-b-prefixes-for-Python-3.patch b/0003-Add-b-prefixes-for-Python-3.patch new file mode 100644 index 0000000..7a713ed --- /dev/null +++ b/0003-Add-b-prefixes-for-Python-3.patch @@ -0,0 +1,88 @@ +From e8a80ba09abed0a5033fb1bcbf28676381526229 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 28 Feb 2016 10:47:57 -0500 +Subject: [PATCH] Add b'' prefixes for Python 3 + +--- + igor/struct.py | 18 +++++++++--------- + igor/util.py | 4 ++-- + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/igor/struct.py b/igor/struct.py +index a50ede5296..ec7f20ce12 100644 +--- a/igor/struct.py ++++ b/igor/struct.py +@@ -395,11 +395,11 @@ class Structure (_struct.Struct): + The structures automatically calculate the flattened data format: + + >>> run.format +- '@Ihhhhhh' ++ b'@Ihhhhhh' + >>> run.size # 4 + 2*3*2 + 16 + >>> experiment.format +- '@HIhhhhhhIhhhhhh' ++ b'@HIhhhhhhIhhhhhh' + >>> experiment.size # 2 + 2 + 2*(4 + 2*3*2) + 36 + +@@ -448,15 +448,15 @@ class Structure (_struct.Struct): + + >>> experiment.pack_into(buffer=b, data=d) + >>> b.tostring()[:17] +- '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10' ++ b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10' + >>> b.tostring()[17:] +- '\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !' ++ b'\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !' + >>> run0 = d['runs'].pop(0) + >>> b = experiment.pack(data=d) + >>> b[:17] +- '\x00\x01\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f ' ++ b'\x00\x01\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f ' + >>> b[17:] +- '!\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ++ b'!\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + + If you set ``count=0``, the field is ignored. + +@@ -464,7 +464,7 @@ class Structure (_struct.Struct): + ... version, Field('f', 'ignored', count=0, array=True), runs], + ... byte_order='>') + >>> experiment2.format +- '>HIhhhhhhIhhhhhh' ++ b'>HIhhhhhhIhhhhhh' + >>> d = experiment2.unpack(b) + >>> pprint(d) + {'ignored': array([], dtype=float64), +@@ -690,9 +690,9 @@ class DynamicStructure (Structure): + + >>> d['data'] = [1,2,3,4] + >>> dynamic_length_vector.pack(d) +- '\x00\x00\x00\x04\x00\x01\x00\x02\x00\x03\x00\x04' ++ b'\x00\x00\x00\x04\x00\x01\x00\x02\x00\x03\x00\x04' + >>> dynamic_data_vector.pack(d) +- '\x00\x00\x00\x04\x00\x01\x00\x02\x00\x03\x00\x04' ++ b'\x00\x00\x00\x04\x00\x01\x00\x02\x00\x03\x00\x04' + + The implementation is a good deal more complicated than the one + for ``Structure``, because we must make multiple calls to +diff --git a/igor/util.py b/igor/util.py +index ecc783a684..0b34977d2e 100644 +--- a/igor/util.py ++++ b/igor/util.py +@@ -115,9 +115,9 @@ def _bytes(obj, encoding='utf-8'): + """Convert bytes or strings into bytes + + >>> _bytes(b'123') +- '123' ++ b'123' + >>> _bytes('123') +- '123' ++ b'123' + """ + if _sys.version_info >= (3,): + if isinstance(obj, bytes): +-- +2.5.0 + diff --git a/0004-Add-b-prefixes-everywhere-in-test-output.patch b/0004-Add-b-prefixes-everywhere-in-test-output.patch new file mode 100644 index 0000000..906128b --- /dev/null +++ b/0004-Add-b-prefixes-everywhere-in-test-output.patch @@ -0,0 +1,1239 @@ +From d9999386e32dbe8d14fc8353de9584055f2de8c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 28 Feb 2016 12:18:22 -0500 +Subject: [PATCH] Add b'' prefixes everywhere in test output + +--- + test/test.py | 524 +++++++++++++++++++++++++++++------------------------------ + 1 file changed, 262 insertions(+), 262 deletions(-) + +diff --git a/test/test.py b/test/test.py +index c470972e88..c8ef54f9c1 100644 +--- a/test/test.py ++++ b/test/test.py +@@ -10,14 +10,14 @@ r"""Test the igor module by loading sample files. + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 166}, +- 'note': '', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([ 5., 4., 3., 2., 1.]), + 'wave_header': {'aModified': 0, +- 'bname': 'double', ++ 'bname': b'double', + 'botFullScale': 0.0, + 'creationDate': 3001587842, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -25,7 +25,7 @@ r"""Test the igor module by loading sample files. + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001587842, + 'next': 0, + 'npnts': 5, +@@ -33,13 +33,13 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 4, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + + >>> dumpibw('mac-textWave.ibw') # doctest: +REPORT_UDIFF +@@ -54,35 +54,35 @@ r"""Test the igor module by loading sample files. + 'optionsSize2': 0, + 'sIndicesSize': 20, + 'wfmSize': 338}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': '', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b'', + 'labels': [[], [], [], []], +- 'note': '', ++ 'note': b'', + 'sIndices': array([ 4, 7, 8, 14, 18]), +- 'wData': array(['Mary', 'had', 'a', 'little', 'lamb'], ++ 'wData': array([b'Mary', b'had', b'a', b'little', b'lamb'], + dtype='|S6'), + 'wave_header': {'aModified': 0, +- 'bname': 'text0', ++ 'bname': b'text0', + 'botFullScale': 0.0, + 'creationDate': 3001571199, + 'dFolder': 69554896, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 22, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001571215, + 'nDim': array([5, 0, 0, 0]), + 'next': 0, +@@ -94,12 +94,12 @@ r"""Test the igor module by loading sample files. + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 0, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -111,14 +111,14 @@ r"""Test the igor module by loading sample files. + 'noteSize': 15, + 'pictSize': 0, + 'wfmSize': 146}, +- 'note': 'This is a test.', ++ 'note': b'This is a test.', + 'padding': array([], dtype=float64), + 'wData': array([ 5., 4., 3., 2., 1.], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'version2', ++ 'bname': b'version2', + 'botFullScale': 0.0, + 'creationDate': 3001251979, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -126,7 +126,7 @@ r"""Test the igor module by loading sample files. + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001573594, + 'next': 0, + 'npnts': 5, +@@ -134,13 +134,13 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + + >>> dumpibw('mac-version3Dependent.ibw') # doctest: +REPORT_UDIFF +@@ -150,15 +150,15 @@ r"""Test the igor module by loading sample files. + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 126}, +- 'formula': ' K0', +- 'note': '', ++ 'formula': b' K0', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([], dtype=float32), + 'wave_header': {'aModified': 3, +- 'bname': 'version3Dependent', ++ 'bname': b'version3Dependent', + 'botFullScale': 0.0, + 'creationDate': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 23, + 'fileName': 0, +@@ -166,7 +166,7 @@ r"""Test the igor module by loading sample files. + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001672861, + 'next': 0, + 'npnts': 10, +@@ -174,13 +174,13 @@ r"""Test the igor module by loading sample files. + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 1, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + + >>> dumpibw('mac-version5.ibw') # doctest: +REPORT_UDIFF +@@ -195,34 +195,34 @@ r"""Test the igor module by loading sample files. + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 340}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': '', +- 'labels': [['', 'Column0'], [], [], []], +- 'note': 'This is a test.', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b'', ++ 'labels': [[b'', b'Column0'], [], [], []], ++ 'note': b'This is a test.', + 'sIndices': array([], dtype=float64), + 'wData': array([ 5., 4., 3., 2., 1.], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'version5', ++ 'bname': b'version5', + 'botFullScale': 0.0, + 'creationDate': 3001252180, + 'dFolder': 69554896, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 27, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([69554136, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 69554292, + 'formula': 0, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001573601, + 'nDim': array([5, 0, 0, 0]), + 'next': 69555212, +@@ -234,12 +234,12 @@ r"""Test the igor module by loading sample files. + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -257,34 +257,34 @@ r"""Test the igor module by loading sample files. + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 320}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': '', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b'', + 'labels': [[], [], [], []], +- 'note': '', ++ 'note': b'', + 'sIndices': array([], dtype=float64), + 'wData': array([], dtype=float32), + 'wave_header': {'aModified': 3, +- 'bname': 'zeroWave', ++ 'bname': b'zeroWave', + 'botFullScale': 0.0, + 'creationDate': 3001573964, + 'dFolder': 69554896, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 29, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001573964, + 'nDim': array([0, 0, 0, 0]), + 'next': 0, +@@ -296,12 +296,12 @@ r"""Test the igor module by loading sample files. + 'swModified': 1, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -313,14 +313,14 @@ r"""Test the igor module by loading sample files. + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 166}, +- 'note': '', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([ 5., 4., 3., 2., 1.]), + 'wave_header': {'aModified': 0, +- 'bname': 'double', ++ 'bname': b'double', + 'botFullScale': 0.0, + 'creationDate': 3001587842, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -328,7 +328,7 @@ r"""Test the igor module by loading sample files. + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001587842, + 'next': 0, + 'npnts': 5, +@@ -336,13 +336,13 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 4, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + + >>> dumpibw('win-textWave.ibw') # doctest: +REPORT_UDIFF +@@ -357,35 +357,35 @@ r"""Test the igor module by loading sample files. + 'optionsSize2': 0, + 'sIndicesSize': 20, + 'wfmSize': 338}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': '', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b'', + 'labels': [[], [], [], []], +- 'note': '', ++ 'note': b'', + 'sIndices': array([ 4, 7, 8, 14, 18]), +- 'wData': array(['Mary', 'had', 'a', 'little', 'lamb'], ++ 'wData': array([b'Mary', b'had', b'a', b'little', b'lamb'], + dtype='|S6'), + 'wave_header': {'aModified': 0, +- 'bname': 'text0', ++ 'bname': b'text0', + 'botFullScale': 0.0, + 'creationDate': 3001571199, + 'dFolder': 8108612, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 32, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 7814472, + 'formula': 0, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001571215, + 'nDim': array([5, 0, 0, 0]), + 'next': 0, +@@ -397,12 +397,12 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 0, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -414,14 +414,14 @@ r"""Test the igor module by loading sample files. + 'noteSize': 15, + 'pictSize': 0, + 'wfmSize': 146}, +- 'note': 'This is a test.', ++ 'note': b'This is a test.', + 'padding': array([], dtype=float64), + 'wData': array([ 5., 4., 3., 2., 1.], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'version2', ++ 'bname': b'version2', + 'botFullScale': 0.0, + 'creationDate': 3001251979, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -429,7 +429,7 @@ r"""Test the igor module by loading sample files. + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001573594, + 'next': 0, + 'npnts': 5, +@@ -437,13 +437,13 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + + >>> dumpibw('win-version5.ibw') # doctest: +REPORT_UDIFF +@@ -458,34 +458,34 @@ r"""Test the igor module by loading sample files. + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 340}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': '', +- 'labels': [['', 'Column0'], [], [], []], +- 'note': 'This is a test.', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b'', ++ 'labels': [[b'', b'Column0'], [], [], []], ++ 'note': b'This is a test.', + 'sIndices': array([], dtype=float64), + 'wData': array([ 5., 4., 3., 2., 1.], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'version5', ++ 'bname': b'version5', + 'botFullScale': 0.0, + 'creationDate': 3001252180, + 'dFolder': 8108612, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 30, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([8138784, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 8131824, + 'formula': 0, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001573601, + 'nDim': array([5, 0, 0, 0]), + 'next': 8125236, +@@ -497,12 +497,12 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -520,34 +520,34 @@ r"""Test the igor module by loading sample files. + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 320}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': '', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b'', + 'labels': [[], [], [], []], +- 'note': '', ++ 'note': b'', + 'sIndices': array([], dtype=float64), + 'wData': array([], dtype=float32), + 'wave_header': {'aModified': 3, +- 'bname': 'zeroWave', ++ 'bname': b'zeroWave', + 'botFullScale': 0.0, + 'creationDate': 3001573964, + 'dFolder': 8108612, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 31, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 8125252, + 'formula': 0, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 3001573964, + 'nDim': array([0, 0, 0, 0]), + 'next': 8133140, +@@ -559,12 +559,12 @@ r"""Test the igor module by loading sample files. + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -660,14 +660,14 @@ record 30: + 'numUserVars': 0}}, + 'version': 1} + record 31: +-'\x95 Polar Graphs Demo, v3.01\n\n' ++b'\x95 Polar Graphs Demo, v3.01\n\n' + record 32: + {'version': 2, + 'wave': {'bin_header': {'checksum': -25004, + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 638}, +- 'note': '', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([ 0.30000001, 0.5448544 , 0.77480197, 0.97584349, 1.13573945, + 1.24475539, 1.2962544 , 1.28710103, 1.21785283, 1.09272552, +@@ -696,10 +696,10 @@ record 32: + -0.6871013 , -0.69625437, -0.64475471, -0.53574032, -0.37584305, + -0.17479956, 0.05514668, 0.30000135], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'radiusData', ++ 'bname': b'radiusData', + 'botFullScale': 0.0, + 'creationDate': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -707,7 +707,7 @@ record 32: + 'fsValid': 0, + 'hsA': 0.04908738521234052, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2845545774, + 'next': 0, + 'npnts': 128, +@@ -715,13 +715,13 @@ record 32: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + record 33: + {'version': 2, +@@ -729,7 +729,7 @@ record 33: + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 638}, +- 'note': '', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([ 0. , 0.0494739 , 0.0989478 , 0.1484217 , 0.1978956 , + 0.24736951, 0.29684341, 0.34631732, 0.3957912 , 0.44526511, +@@ -758,10 +758,10 @@ record 33: + 5.93686819, 5.98634195, 6.03581619, 6.08528948, 6.13476372, + 6.18423796, 6.23371172, 6.28318548], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'angleData', ++ 'bname': b'angleData', + 'botFullScale': 0.0, + 'creationDate': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -769,7 +769,7 @@ record 33: + 'fsValid': 0, + 'hsA': 0.04908738521234052, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2845470039, + 'next': 0, + 'npnts': 128, +@@ -777,13 +777,13 @@ record 33: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + record 34: + {'version': 5, +@@ -797,11 +797,11 @@ record 34: + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 832}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': ' PolarRadiusFunction(radiusData,1,0) * cos(PolarAngleFunction(angleData,3,1,2))', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b' PolarRadiusFunction(radiusData,1,0) * cos(PolarAngleFunction(angleData,3,1,2))', + 'labels': [[], [], [], []], +- 'note': '', ++ 'note': b'', + 'sIndices': array([], dtype=float64), + 'wData': array([ 1.83690956e-17, 2.69450769e-02, 7.65399113e-02, + 1.44305170e-01, 2.23293692e-01, 3.04783821e-01, +@@ -847,26 +847,26 @@ record 34: + 1.05330117e-01, 5.55786416e-02, 1.72677450e-02, + -2.72719120e-03, 5.24539061e-08], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'W_plrX5', ++ 'bname': b'W_plrX5', + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 24, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 0, + 'formula': 8054500, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2985072242, + 'nDim': array([128, 0, 0, 0]), + 'next': 8054516, +@@ -878,12 +878,12 @@ record 34: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -900,11 +900,11 @@ record 35: + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 832}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': ' PolarRadiusFunction(radiusData,1,0) * sin(PolarAngleFunction(angleData,3,1,2))', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b' PolarRadiusFunction(radiusData,1,0) * sin(PolarAngleFunction(angleData,3,1,2))', + 'labels': [[], [], [], []], +- 'note': 'shadowX=W_plrX5,appendRadius=radiusData,appendAngleData=angleData,angleDataUnits=2', ++ 'note': b'shadowX=W_plrX5,appendRadius=radiusData,appendAngleData=angleData,angleDataUnits=2', + 'sIndices': array([], dtype=float64), + 'wData': array([ 0.30000001, 0.54418772, 0.77101213, 0.96511477, 1.1135726 , + 1.20686483, 1.23956215, 1.21068466, 1.12370288, 0.98618096, +@@ -933,26 +933,26 @@ record 35: + -0.64630753, -0.66580337, -0.62512833, -0.52528399, -0.37171093, + -0.17394456, 0.0550792 , 0.30000135], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'W_plrY5', ++ 'bname': b'W_plrY5', + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 26, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 0, + 'formula': 8054532, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2985072242, + 'nDim': array([128, 0, 0, 0]), + 'next': 8084972, +@@ -964,12 +964,12 @@ record 35: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, + 'waveNoteH': 7996608, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, +- 'whpad1': array(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -980,7 +980,7 @@ record 36: + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 382}, +- 'note': '', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([ 0.2617994 , 0.27842158, 0.29504377, 0.31166595, 0.32828814, + 0.34491032, 0.36153251, 0.3781547 , 0.39477688, 0.41139907, +@@ -996,10 +996,10 @@ record 36: + 1.17601943, 1.19264174, 1.2092638 , 1.22588611, 1.24250817, + 1.25913048, 1.27575254, 1.29237485, 1.30899692], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'angleQ1', ++ 'bname': b'angleQ1', + 'botFullScale': 0.0, + 'creationDate': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -1007,7 +1007,7 @@ record 36: + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2845473705, + 'next': 0, + 'npnts': 64, +@@ -1015,13 +1015,13 @@ record 36: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + record 37: + {'version': 2, +@@ -1029,7 +1029,7 @@ record 37: + 'noteSize': 0, + 'pictSize': 0, + 'wfmSize': 382}, +- 'note': '', ++ 'note': b'', + 'padding': array([], dtype=float64), + 'wData': array([ -8.34064484, -7.66960144, -6.62294245, -6.82878971, + -8.6383152 , -11.20019722, -13.83398628, -15.95139503, +@@ -1048,10 +1048,10 @@ record 37: + -9.08601665, -10.00928402, -8.87677383, -6.88120317, + -5.61007977, -5.6351161 , -6.41880989, -6.8738699 ], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'radiusQ1', ++ 'bname': b'radiusQ1', + 'botFullScale': 0.0, + 'creationDate': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, +@@ -1059,7 +1059,7 @@ record 37: + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2845473634, + 'next': 0, + 'npnts': 64, +@@ -1067,13 +1067,13 @@ record 37: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, +- 'wUnused': array(['', ''], ++ 'wUnused': array([b'', b''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, +- 'xUnits': array(['', '', '', ''], ++ 'xUnits': array([b'', b'', b'', b''], + dtype='|S1')}}} + record 38: + {'version': 5, +@@ -1087,11 +1087,11 @@ record 38: + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 576}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': ' PolarRadiusFunction(radiusQ1,1,-40) * cos(PolarAngleFunction(angleQ1,2,2,2))', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b' PolarRadiusFunction(radiusQ1,1,-40) * cos(PolarAngleFunction(angleQ1,2,2,2))', + 'labels': [[], [], [], []], +- 'note': '', ++ 'note': b'', + 'sIndices': array([], dtype=float64), + 'wData': array([ 30.58058929, 31.08536911, 31.93481636, 31.57315445, + 29.68683434, 27.10366058, 24.47453499, 22.3495121 , +@@ -1110,26 +1110,26 @@ record 38: + 11.41363049, 10.60795975, 10.52314186, 10.67826462, + 10.5454855 , 9.99268055, 9.22939587, 8.5736742 ], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'W_plrX6', ++ 'bname': b'W_plrX6', + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 30, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 0, + 'formula': 8052116, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2985072242, + 'nDim': array([64, 0, 0, 0]), + 'next': 8324392, +@@ -1141,12 +1141,12 @@ record 38: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + '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(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, +@@ -1163,11 +1163,11 @@ record 39: + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'wfmSize': 576}, +- 'data_units': '', +- 'dimension_units': '', +- 'formula': ' PolarRadiusFunction(radiusQ1,1,-40) * sin(PolarAngleFunction(angleQ1,2,2,2))', ++ 'data_units': b'', ++ 'dimension_units': b'', ++ 'formula': b' PolarRadiusFunction(radiusQ1,1,-40) * sin(PolarAngleFunction(angleQ1,2,2,2))', + 'labels': [[], [], [], []], +- 'note': 'shadowX=W_plrX6,appendRadius=radiusQ1,appendAngleData=angleQ1,angleDataUnits=2', ++ 'note': b'shadowX=W_plrX6,appendRadius=radiusQ1,appendAngleData=angleQ1,angleDataUnits=2', + 'sIndices': array([], dtype=float64), + 'wData': array([ 8.19404411, 8.88563347, 9.70543861, 10.17177773, + 10.11173058, 9.73756695, 9.25513077, 8.8788929 , +@@ -1186,26 +1186,26 @@ record 39: + 28.72983551, 28.05199242, 29.29024887, 31.3501091 , + 32.7331543 , 32.87995529, 32.28799438, 31.99738503], dtype=float32), + 'wave_header': {'aModified': 0, +- 'bname': 'W_plrY6', ++ 'bname': b'W_plrY6', + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, +- 'dataUnits': array(['', '', '', ''], ++ 'dataUnits': array([b'', b'', b'', b''], + dtype='|S1'), + 'depID': 32, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), +- 'dimUnits': array([['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', ''], +- ['', '', '', '']], ++ 'dimUnits': array([[b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b''], ++ [b'', b'', b'', b'']], + dtype='|S1'), + 'fileName': 0, + 'formula': 7995612, + 'fsValid': 0, +- 'kindBits': '\x00', ++ 'kindBits': b'\x00', + 'modDate': 2985072242, + 'nDim': array([64, 0, 0, 0]), + 'next': 0, +@@ -1217,20 +1217,20 @@ record 39: + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, +- 'useBits': '\x00', ++ 'useBits': b'\x00', + 'wModified': 0, + 'waveNoteH': 7998208, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, +- 'whpad1': array(['', '', '', '', '', ''], ++ 'whpad1': array([b'', b'', b'', b'', b'', b''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0}}} + record 40: +-'Packages' ++b'Packages' + record 41: +-'WMDataBase' ++b'WMDataBase' + record 42: + {'variables': {'sysVars': {'K0': 0.0, + 'K1': 0.0, +@@ -1253,21 +1253,21 @@ record 42: + 'K7': 0.0, + 'K8': 0.0, + 'K9': 0.0}, +- 'userStrs': {'u_dataBase': ';PolarGraph0:,...,useCircles=2,maxArcLine=6;', +- 'u_dbBadStringChars': ',;=:', +- 'u_dbCurrBag': 'PolarGraph1', +- 'u_dbCurrContents': ',appendRadius=radiusQ1,...,useCircles=2,maxArcLine=6;', +- 'u_dbReplaceBadChars': '\xa9\xae\x99\x9f', +- 'u_str': '2'}, ++ 'userStrs': {b'u_dataBase': b';PolarGraph0:,...,useCircles=2,maxArcLine=6;', ++ b'u_dbBadStringChars': b',;=:', ++ b'u_dbCurrBag': b'PolarGraph1', ++ b'u_dbCurrContents': b',appendRadius=radiusQ1,...,useCircles=2,maxArcLine=6;', ++ b'u_dbReplaceBadChars': b'\xa9\xae\x99\x9f', ++ b'u_str': b'2'}, + 'userVars': {}, + 'var_header': {'numSysVars': 21, + 'numUserStrs': 6, + 'numUserVars': 0}}, + 'version': 1} + record 43: +-'' ++b'' + record 44: +-'PolarGraphs' ++b'PolarGraphs' + record 45: + {'variables': {'sysVars': {'K0': 0.0, + 'K1': 0.0, +@@ -1290,75 +1290,75 @@ record 45: + 'K7': 0.0, + 'K8': 0.0, + 'K9': 0.0}, +- 'userStrs': {'u_colorList': 'black;blue;green;cyan;red;magenta;yellow;white;special', +- 'u_debugStr': 'Turn Debugging On', +- 'u_polAngleAxesWherePop': 'Off;Radius Start;Radius End;Radius Start and End;All Major Radii;At Listed Radii', +- 'u_polAngleUnitsPop': 'deg;rad', +- 'u_polLineStylePop': 'solid;dash 1;dash 2;dash 3;dash 4;dash 5;dash 6;dash 7;dash 8;dash 9;dash 10;dash 11;dash 12;dash 13;dash 14;dash 15;dash 16;dash 17;', +- 'u_polOffOn': 'Off;On', +- 'u_polRadAxesWherePop': ' Off; Angle Start; Angle Middle; Angle End; Angle Start and End; 0; 90; 180; -90; 0, 90; 90, 180; -180, -90; -90, 0; 0, 180; 90, -90; 0, 90, 180, -90; All Major Angles; At Listed Angles', +- 'u_polRotPop': ' -90; 0; +90; +180', +- 'u_popup': '', +- 'u_prompt': ''}, +- 'userVars': {'V_bottom': 232.0, +- 'V_left': 1.0, +- 'V_max': 2.4158518093414401, +- 'V_min': -2.1848498883412, +- 'V_right': 232.0, +- 'V_top': 1.0, +- 'u_UniqWaveNdx': 8.0, +- 'u_UniqWinNdx': 3.0, +- 'u_angle0': 0.0, +- 'u_angleRange': 6.2831853071795862, +- 'u_debug': 0.0, +- 'u_majorDelta': 0.0, +- 'u_numPlaces': 0.0, +- 'u_polAngle0': 0.26179938779914941, +- 'u_polAngleRange': 1.0471975511965976, +- 'u_polInnerRadius': -20.0, +- 'u_polMajorAngleInc': 0.26179938779914941, +- 'u_polMajorRadiusInc': 10.0, +- 'u_polMinorAngleTicks': 3.0, +- 'u_polMinorRadiusTicks': 1.0, +- 'u_polOuterRadius': 0.0, +- 'u_segsPerMinorArc': 3.0, +- 'u_tickDelta': 0.0, +- 'u_var': 0.0, +- 'u_x1': 11.450159535018935, +- 'u_x2': 12.079591517721363, +- 'u_y1': 42.732577139459856, +- 'u_y2': 45.081649278814126}, ++ 'userStrs': {b'u_colorList': b'black;blue;green;cyan;red;magenta;yellow;white;special', ++ b'u_debugStr': b'Turn Debugging On', ++ b'u_polAngleAxesWherePop': b'Off;Radius Start;Radius End;Radius Start and End;All Major Radii;At Listed Radii', ++ b'u_polAngleUnitsPop': b'deg;rad', ++ b'u_polLineStylePop': b'solid;dash 1;dash 2;dash 3;dash 4;dash 5;dash 6;dash 7;dash 8;dash 9;dash 10;dash 11;dash 12;dash 13;dash 14;dash 15;dash 16;dash 17;', ++ b'u_polOffOn': b'Off;On', ++ b'u_polRadAxesWherePop': b' Off; Angle Start; Angle Middle; Angle End; Angle Start and End; 0; 90; 180; -90; 0, 90; 90, 180; -180, -90; -90, 0; 0, 180; 90, -90; 0, 90, 180, -90; All Major Angles; At Listed Angles', ++ b'u_polRotPop': b' -90; 0; +90; +180', ++ b'u_popup': b'', ++ b'u_prompt': b''}, ++ 'userVars': {b'V_bottom': 232.0, ++ b'V_left': 1.0, ++ b'V_max': 2.4158518093414401, ++ b'V_min': -2.1848498883412, ++ b'V_right': 232.0, ++ b'V_top': 1.0, ++ b'u_UniqWaveNdx': 8.0, ++ b'u_UniqWinNdx': 3.0, ++ b'u_angle0': 0.0, ++ b'u_angleRange': 6.2831853071795862, ++ b'u_debug': 0.0, ++ b'u_majorDelta': 0.0, ++ b'u_numPlaces': 0.0, ++ b'u_polAngle0': 0.26179938779914941, ++ b'u_polAngleRange': 1.0471975511965976, ++ b'u_polInnerRadius': -20.0, ++ b'u_polMajorAngleInc': 0.26179938779914941, ++ b'u_polMajorRadiusInc': 10.0, ++ b'u_polMinorAngleTicks': 3.0, ++ b'u_polMinorRadiusTicks': 1.0, ++ b'u_polOuterRadius': 0.0, ++ b'u_segsPerMinorArc': 3.0, ++ b'u_tickDelta': 0.0, ++ b'u_var': 0.0, ++ b'u_x1': 11.450159535018935, ++ b'u_x2': 12.079591517721363, ++ b'u_y1': 42.732577139459856, ++ b'u_y2': 45.081649278814126}, + 'var_header': {'numSysVars': 21, + 'numUserStrs': 10, + 'numUserVars': 28}}, + 'version': 1} + record 46: +-'' ++b'' + record 47: +-'' ++b'' + record 48: +-'| Platform=Windows95, IGORVersion=3.130\n\n\n\nMoveWindow/P 5.25,40.25,504.75,335\n...hook=PolarWindowHook\nEndMacro\n' ++b'| Platform=Windows95, IGORVersion=3.130\n\n\n\nMoveWindow/P 5.25,40.25,504.75,335\n...hook=PolarWindowHook\nEndMacro\n' + record 49: +-'' ++b'' + record 50: +-'#include version >= 3.0\n' ++b'#include version >= 3.0\n' + + filesystem keys: ['root'] + + walking filesystem: +-walk callback on ([], root, {'K0': 0.0,...}) +-walk callback on (['root'], K0, 0.0) +-walk callback on (['root'], K1, 0.0) +-walk callback on (['root'], K10, 0.0) ++walk callback on ([], b'root', {...}) ++walk callback on ([b'root'], b'K0', 0.0) ++walk callback on ([b'root'], b'K1', 0.0) ++walk callback on ([b'root'], b'K10', 0.0) + ... +-walk callback on (['root'], K9, 0.0) +-walk callback on (['root'], Packages, {'PolarGraphs': ...}) +-walk callback on (['root', 'Packages'], PolarGraphs, {...}) +-walk callback on (['root', 'Packages', 'PolarGraphs'], V_bottom, 232.0) ++walk callback on ([b'root'], b'K9', 0.0) ++walk callback on ([b'root'], b'Packages', {...}) ++walk callback on ([b'root', b'Packages'], b'PolarGraphs', {...}) ++walk callback on ([b'root', b'Packages', b'PolarGraphs'], b'V_bottom', 232.0) + ... +-walk callback on (['root', 'Packages'], WMDataBase, {...}) ++walk callback on ([b'root', b'Packages'], b'WMDataBase', {...}) + ... +-walk callback on (['root'], radiusQ1, ) ++walk callback on ([b'root'], b'radiusQ1', ...) + """ + + import os.path +-- +2.5.0 + diff --git a/0005-Remove-u-prefix-and-L-suffix-which-do-not-appear-und.patch b/0005-Remove-u-prefix-and-L-suffix-which-do-not-appear-und.patch new file mode 100644 index 0000000..f70962c --- /dev/null +++ b/0005-Remove-u-prefix-and-L-suffix-which-do-not-appear-und.patch @@ -0,0 +1,43 @@ +From ba8f001ed9104de44229aa9306dfe5b2454ca730 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 28 Feb 2016 12:19:38 -0500 +Subject: [PATCH] Remove u'' prefix and L suffix which do not appear under + Python 3 + +--- + igor/struct.py | 2 +- + test/test-igorpy.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/igor/struct.py b/igor/struct.py +index ec7f20ce12..54c57eb652 100644 +--- a/igor/struct.py ++++ b/igor/struct.py +@@ -429,7 +429,7 @@ class Structure (_struct.Struct): + 'time': 303240213}], + 'version': 1} + >>> [hex(x) for x in d['runs'][0]['data'].flat] +- ['0x607L', '0x809L', '0xa0bL', '0xc0dL', '0xe0fL', '0x1011L'] ++ ['0x607', '0x809', '0xa0b', '0xc0d', '0xe0f', '0x1011'] + + You can also read out from strings: + +diff --git a/test/test-igorpy.py b/test/test-igorpy.py +index a015b33ea0..30ce074c88 100644 +--- a/test/test-igorpy.py ++++ b/test/test-igorpy.py +@@ -75,9 +75,9 @@ Waves: + ... + 0.00077303, 0.00038651, 0. ]), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64)] + >>> d.W_plrX5.data_units +-(u'', '', '', '') ++('', '', '', '') + >>> d.W_plrX5.axis_units +-(u'', '', '', '') ++('', '', '', '') + >>> d.W_plrX5.data # doctest: +ELLIPSIS + array([ 1.83690956e-17, 2.69450769e-02, 7.65399113e-02, + 1.44305170e-01, 2.23293692e-01, 3.04783821e-01, +-- +2.5.0 + diff --git a/python-igor.spec b/python-igor.spec new file mode 100644 index 0000000..22a3328 --- /dev/null +++ b/python-igor.spec @@ -0,0 +1,133 @@ +%global gitcommit 2c2a79d85508c8988b6d4ecfd4d0f55cff35ef11 +%global gitdate 20150408 +%global shortcommit %(c=%{gitcommit}; echo ${c:0:7}) + +Name: python-igor +Version: 0.2 +Release: 4.%{gitdate}git%{shortcommit}%{?dist} +Summary: Parser for Igor Binary Waves (.ibw) and Packed Experiment (.pxp) files + +# igor-0.2/igor/igorpy.py is PD, the restis LGPLv3+ +License: LGPLv3+ and Public Domain + +URL: http://blog.tremily.us/posts/igor/ +Source0: https://github.com/wking/igor/archive/%{gitcommit}.tar.gz#/igor-%{shortcommit}.tar.gz + +# Python 2 compatible patches: https://github.com/wking/igor/pull/1 +Patch001: 0001-Do-not-print-dictionaries-in-test-output.patch +# Python 3 only patches +Patch002: 0002-OSError-is-used-under-Python-3.patch +Patch003: 0003-Add-b-prefixes-for-Python-3.patch +Patch004: 0004-Add-b-prefixes-everywhere-in-test-output.patch +Patch005: 0005-Remove-u-prefix-and-L-suffix-which-do-not-appear-und.patch + +BuildArch: noarch +BuildRequires: /usr/bin/rename +BuildRequires: python2-devel +BuildRequires: numpy +BuildRequires: python-matplotlib +BuildRequires: python-nose + +BuildRequires: python3-devel +BuildRequires: python3-numpy +BuildRequires: python3-matplotlib +BuildRequires: python3-nose + +%description +Python parsers for Igor Binary Waves (.ibw) and Packed Experiment +(.pxp) files written by WaveMetrics’ IGOR Pro software. + +Note that this package is unrelated to igor (Automated distribution +life-cycle testing). + +%package -n python2-igor +Summary: %{summary} +Requires: numpy +Requires: python-matplotlib +%{?python_provide:%python_provide python2-igor} + +%description -n python2-igor +Python parsers for Igor Binary Waves (.ibw) and Packed Experiment +(.pxp) files written by WaveMetrics’ IGOR Pro software. + +Note that this package is unrelated to igor (Automated distribution +life-cycle testing). + +%package -n python3-igor +Summary: %{summary} +Requires: python3-numpy +Requires: python3-matplotlib +%{?python_provide:%python_provide python3-igor} + +%description -n python3-igor +Python parsers for Igor Binary Waves (.ibw) and Packed Experiment +(.pxp) files written by WaveMetrics’ IGOR Pro software. + +Note that this package is unrelated to igor (Automated distribution +life-cycle testing). + +%prep +%autosetup -n igor-%{gitcommit} -N +%patch1 -p1 + +mkdir _python3 +cp -av bin igor test README *.* _python3/ +pushd _python3 +# Apply tests to adapt formatting to Python 3 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +popd + +%build +%py2_build +pushd _python3 +%py3_build +popd + +%install +%py2_install +pushd _python3 +%py3_install +popd + +rename '.py' '' %{buildroot}%{_bindir}/* + +%check +nosetests-%{python2_version} --with-doctest --doctest-tests igor test +pushd _python3 +nosetests-%{python3_version} --with-doctest --doctest-tests igor test +popd + +%global _docdir_fmt %{name} + +# make sure that we got the python version right in the header +head -n1 %{buildroot}%{_bindir}/igorbinarywave | grep %{__python2} -q +head -n1 %{buildroot}%{_bindir}/igorpackedexperiment | grep %{__python2} -q + +%files -n python2-igor +%{python2_sitelib}/* +%license COPYING.LESSER +%doc README +# Use python2 versions for now, python3 version has had much less testing. +# At some point in the future, we should switch to python3. +%{_bindir}/igorbinarywave +%{_bindir}/igorpackedexperiment + +%files -n python3-igor +%{python3_sitelib}/* +%license COPYING.LESSER +%doc README + +%changelog +* Mon Feb 29 2016 Zbigniew Jędrzejewski-Szmek - 0.2-4.20150408git2c2a79d +- Update License and add link to upstream pull request + +* Sun Feb 28 2016 Zbigniew Jędrzejewski-Szmek - 0.2-3.20150408git2c2a79d +- Update to latest git snapshot +- Add nose to BR, fix Provides +- Patch tests to pass under Python 3 + +* Fri Feb 19 2016 Zbigniew Jędrzejewski-Szmek - 0.2-1 +- Initial packaging diff --git a/sources b/sources index e69de29..6aa0e27 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +34030e23326b6b49b8822b489e08b315 igor-2c2a79d.tar.gz