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

as_recarray methods improperly convert bytes to str #15

Open
mivade opened this issue Dec 19, 2017 · 0 comments
Open

as_recarray methods improperly convert bytes to str #15

mivade opened this issue Dec 19, 2017 · 0 comments
Labels

Comments

@mivade
Copy link
Contributor

mivade commented Dec 19, 2017

Example from:

def contacts_as_recarray(self):
"""Return the monopolar contacts as a recarry.
This method exists for Ramulator compatibility.
"""
arr = np.recarray((len(self.contacts),), dtype=self._recarray_dtype)
for i, contact in enumerate(self.contacts):
arr[i]['jack_box_num'] = int(contact.port)
arr[i]['contact_name'] = str(contact.label)
# Not using surface area anymore because not used by Ramulator
# arr[i]['surface_area'] = float(contact.area)
arr[i]['description'] = str(contact.description)
return arr

Line 670 turns a byte string into a str something like "b'LA1'" instead of "LA1".

@mivade mivade added the bug label Dec 19, 2017
@mivade mivade changed the title as_recarray methods can wind up with bytes instead of str as_recarray methods can wind up with bytes instead of str Dec 19, 2017
@mivade mivade changed the title as_recarray methods can wind up with bytes instead of str as_recarray methods improperly convert bytes to str Dec 19, 2017
mivade added a commit to pennmem/ram_utils that referenced this issue Dec 19, 2017
zduey pushed a commit to pennmem/ram_utils that referenced this issue Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant