From 8d9e816663c2b94ed803f8edcf5dba89d35a5fe0 Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <alexander@mail-schlemmer.de> Date: Mon, 22 Nov 2021 20:57:02 +0100 Subject: [PATCH] DOC: added docstring for function compare entities --- src/caosdb/apiutils.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py index b3d5df69..2813d91b 100644 --- a/src/caosdb/apiutils.py +++ b/src/caosdb/apiutils.py @@ -561,7 +561,23 @@ def getCommitIn(folder): COMPARED = ["name", "role", "datatype", "description", "importance"] -def compare_entities(old_entity, new_entity): +def compare_entities(old_entity: Entity, new_entity: Entity): + """ + Compare two entites. + + Return a tuple of dictionaries, the first index belongs to additional information for old + entity, the second index belongs to additional information for new entity. + + Additional information means in detail: + - Additional parents (a list under key "parents") + - Information about properties: + - Each property lists either an additional property or a property with a changed: + - ... datatype + - ... importance or + - ... value (not implemented yet) + In case of changed information the value listed under the respective key shows the + value that is stored in the respective entity. + """ olddiff = {"properties": {}, "parents": []} newdiff = {"properties": {}, "parents": []} -- GitLab