Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int64 error #17

Open
BorisMansencal opened this issue Nov 7, 2023 · 0 comments
Open

int64 error #17

BorisMansencal opened this issue Nov 7, 2023 · 0 comments

Comments

@BorisMansencal
Copy link

The following code does not work:

import numpy as np
from mmappickle import mmapdict

m = mmapdict("/tmp/test.mmdpickle")                                                                                                                                                              
a = np.array(1234, dtype=np.int64)
m['a'] = a

print("type m[a]=", type(m['a']))

I get the following error:

Traceback (most recent call last):
  File "/tmp/dbg.py", line 13, in <module>
    print("type m[a]=", type(m['a']))
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/utils.py", line 53, in lock_wrapper
    return f(self, *a, **kw)
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/dict.py", line 613, in __getitem__
    return pickler.read(data_offset, data_length)[0]
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/utils.py", line 11, in save_file_position_wrapper
    return f(self, *a, **kw)
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/picklers/numpy.py", line 115, in read
    assert False, "Invalid element type: 0x{:02x}".format(ord(shapeelementtype))
AssertionError: Invalid element type: 0x29

tested on Ubuntu 20.04 with python 3.8.10 and numpy 1.23.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant