Commit b759e5d2 authored by Lucas Bourneuf's avatar Lucas Bourneuf

bugfix: when value is an integer, consider it an integer

parent 1e920797
......@@ -73,11 +73,13 @@ def visual_config_from_atoms(atoms:dict, base_atoms:dict,
def get_uid_from_atom(atom:str or tuple):
if isinstance(atom, str):
return atom
elif isinstance(atom, int):
return str(atom)
elif isinstance(atom, tuple):
if len(atom) == 2: # a regular atom
if len(atom[1]) == 0:
if len(atom) == 2: # a regular (pred, args)
if len(atom[1]) == 0: # predicate without args
return atom[0]
else: # atom with args
else: # predicate with args
return '{}({})'.format(atom[0], ','.join(map(get_uid_from_atom, atom[1])))
raise ValueError(f"Malformed node uid of type '{type(atom)}' found: {atom}")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment