Skip to content
Snippets Groups Projects

Improving the compare_entities functions

Merged Alexander Schlemmer requested to merge f-check-merge-entities into dev
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
+ 5
3
@@ -207,6 +207,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity,
- Information about properties:
- Each property lists either an additional property or a property with a changed:
- datatype
- unit
- importance or
- value
@@ -287,6 +288,9 @@ def compare_entities(old_entity: Entity, new_entity: Entity,
if len(matching_old) != 1:
raise NotImplementedError(
"Comparison not implemented for multi-properties.")
if len(matching) > 1:
raise NotImplementedError(
"Comparison not implemented for multi-properties.")
if len(matching) == 0:
olddiff["properties"][prop.name] = {}
@@ -342,9 +346,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity,
newdiff["properties"].pop(prop.name)
olddiff["properties"].pop(prop.name)
else:
raise NotImplementedError(
"Comparison not implemented for multi-properties.")
for prop in new_entity.properties:
if len([0 for p in old_entity.properties if p.name == prop.name]) == 0:
Loading