You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if omero-marshal could ease the burden of normalising owners, groups and possibly even details too, to reduce the size of the python dict / json object that is needed.
This would need an encode() to be able to take a list of IObjects and return either a tuple of 3 dicts: (obj, owners, groups) or a single dict that included all three.
My current simplistic approach in ome/openmicroscopy#4708 for normalising encoded dicts doesn't handle nested objects:
def normalize_objects(objects):
experimenters = {}
groups = {}
objs = []
for o in objects:
exp = o['omero:details']['owner']
experimenters[exp['@id']] = exp
o['omero:details']['owner'] = {'@id': exp['@id']}
grp = o['omero:details']['group']
groups[grp['@id']] = grp
o['omero:details']['group'] = {'@id': grp['@id']}
objs.append(o)
experimenters = experimenters.values()
groups = groups.values()
return objs, {'experimenters': experimenters, 'experimenterGroups': groups}
The text was updated successfully, but these errors were encountered:
It would be great if omero-marshal could ease the burden of normalising owners, groups and possibly even details too, to reduce the size of the python dict / json object that is needed.
This would need an
encode()
to be able to take a list of IObjects and return either a tuple of 3 dicts:(obj, owners, groups)
or a single dict that included all three.My current simplistic approach in ome/openmicroscopy#4708 for normalising encoded dicts doesn't handle nested objects:
The text was updated successfully, but these errors were encountered: