Skip to content

Commit

Permalink
Solving py3 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
josenavas committed Jun 18, 2014
1 parent 6383664 commit 743349a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qiita_db/metadata_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _as_python_types(metadata_map, headers):
values = []
for h in headers:
if isinstance(metadata_map[h][0], np.generic):
values.append(map(np.asscalar, metadata_map[h]))
values.append(list(map(np.asscalar, metadata_map[h])))
else:
values.append(list(metadata_map[h]))
return values
Expand Down Expand Up @@ -180,6 +180,10 @@ def __init__(self, sample_id, md_template):
self._dynamic_table = "%s%d" % (self._table_prefix,
self._md_template.id)

def __hash__(self):
r"""Defines the hash function so samples are hashable"""
return hash(self._id)

def __eq__(self, other):
r"""Self and other are equal based on type and ids"""
if type(self) != type(other):
Expand Down

0 comments on commit 743349a

Please sign in to comment.