Skip to content

Commit

Permalink
fixup! BugFix: Empty list as val in RMGObject.as_dict() and .make_obj…
Browse files Browse the repository at this point in the history
…ect()
  • Loading branch information
alongd committed Jan 25, 2019
1 parent 76ef404 commit 0d23a32
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rmgpy/rmgobject.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ cdef class RMGObject(object):
for key, val in output_dict.iteritems():
if isinstance(val, list) and val and isinstance(val[0], RMGObject):
output_dict[key] = [v.as_dict() for v in val]
elif isinstance(val, np.ndarray):
output_dict[key] = val.tolist()
elif not isinstance(val, (int, float, str, dict)) and val:
if isinstance(val, np.ndarray):
output_dict[key] = val.tolist()
else:
# this is an object, call as_dict() again
output_dict[key] = val.as_dict()
# this is an object, call as_dict() again
output_dict[key] = val.as_dict()
return output_dict

cpdef make_object(self, dict data, dict class_dict):
Expand Down

0 comments on commit 0d23a32

Please sign in to comment.