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

Incorrect output on Raspberry Pi #53

Open
piyp791 opened this issue Nov 14, 2023 · 0 comments
Open

Incorrect output on Raspberry Pi #53

piyp791 opened this issue Nov 14, 2023 · 0 comments

Comments

@piyp791
Copy link

piyp791 commented Nov 14, 2023

Hello,
I am trying to run the BytesDAWG implementation on Raspberry Pi 4 (AArch64, 64-bit, Python3.7.17) and the values returned by iteritems() seem to be different from what I get from get() method. This behavior does not happen when I run it on my laptop (x86_64, 64-bit, Python3.7.17).

Here is the sample code I am running:

import dawg
data = []
keys = [u'foo', u'bar', u'foobar', u'fo']
for item in zip(keys, range(4)):
    data.append((item[0], item[1].to_bytes(3, 'little')))

bytes_dawg = dawg.BytesDAWG(data)

results = bytes_dawg.iteritems('fo')
for item in results:
    print('key::', item[0], 'value from get::', bytes_dawg.get(item[0], None), ' value from iteritems', item[1])

It's output on Raspberry PI is :

Output 1

key:: fo value from get:: [b'\x03\x00\x00']  value from iteritems b'\xfc\x0c\x00\x03'
key:: foo value from get:: [b'\x00\x00\x00']  value from iteritems b'\xfc\x00\x00\x03'
key:: foobar value from get:: [b'\x02\x00\x00']  value from iteritems b'\xfc\x08\x00\x03'

While on the X86_64 machine, the output is

Output 2

key:: fo value from get:: [b'\x03\x00\x00']  value from iteritems b'\x03\x00\x00'
key:: foo value from get:: [b'\x00\x00\x00']  value from iteritems b'\x00\x00\x00'
key:: foobar value from get:: [b'\x02\x00\x00']  value from iteritems b'\x02\x00\x00'

From output 1, when I convert the byte representation( returned from iteritems()) back to int, it seems to return incorrect values.
Any ideas on why this might be happening?

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