Skip to content

Error when reading with HarFileObj #40

@jhuovari

Description

@jhuovari

I get a ValueError when trying to read a har-file with a HarFileObj(). I get the same error with all files I have tried. Below example with the test_read.har file in the test folder.

I can however read files perfectly fine with the harpy.HarFileObj.loadFromDisk().

test_har = harpy.HarFileObj("testdata/test_read.har")

 ---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-86-b3f4cc92fd96> in <module>()
----> 1 test_har = harpy.HarFileObj("testdata/test_read.har")

~\AppData\Local\Continuum\anaconda3\lib\site-packages\harpy\har_file.py in __init__(self, filename, *args, **kwargs)
     20 
     21     def __init__(self, *args, filename: str=None, **kwargs):
---> 22         super().__init__(*args, **kwargs)
     23 
     24         self["head_arrs"] = []

ValueError: dictionary update sequence element #0 has length 1; 2 is required
test_har0 = harpy.HarFileObj.loadFromDisk("testdata/test_read.har")
test_har0
{'head_arrs': [{'name': 'CHST',
   'pos_name': 0,
   'pos_data': 12,
   'version': 1,
   'data_type': '1C',
   'storage_type': 'FULL',
   'long_name': 'Simple set of strings                                                 ',
   'file_dims': (5, 12),
   'header_type': 'data',
   'array': array(['F_string    ', 'B_string    ', 'C_string    ', 'D_string    ',
          'E_string    '], dtype='<U12')}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions