Skip to content
Snippets Groups Projects
Commit 8b2cc626 authored by Himanen, Lauri (himanel1)'s avatar Himanen, Lauri (himanel1)
Browse files

Fixed bugs in type checking, FileService.set_file_id now returns a status for the set file.

parent ee21d45a
No related branches found
No related tags found
No related merge requests found
......@@ -239,8 +239,10 @@ class FileService(object):
path = os.path.join(self.root_folder, path)
if not os.path.isfile(path):
logger.error("Could not set the id for file '{}' as it cannot be found.".format(path))
return None
else:
self.map_id_to_path[file_id] = path
return path
#===============================================================================
......
......@@ -56,7 +56,7 @@ class LocalBackend(object):
# Check that the value is actually of scalar type
value_type = type(value)
if value_type not in [float, int, bool, str, unicode]:
if value_type not in [float, int, bool, str, unicode, np.float64]:
raise TypeError("The value '{}' for metainfo '{}' is not of scalar nature.".format(value, metaName))
# Check that the metainfo should be scalar
......@@ -140,7 +140,7 @@ class LocalBackend(object):
metainfo.
"""
if dtypeStr == "f":
return [float, int]
return [float, int, np.float64]
elif dtypeStr == "i":
return [int]
elif dtypeStr == "b":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment