Skip to content
Snippets Groups Projects
Commit a6541b96 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

Merge branch 'f-semantic-target' of...

Merge branch 'f-semantic-target' of gitlab.indiscale.com:caosdb/src/caosdb-crawler into f-semantic-target
parents c874edf5 d7fc54ad
No related branches found
No related tags found
2 merge requests!178FIX: #96 Better error output for crawl.py script.,!167Sync Graph
Pipeline #51524 passed with warnings
......@@ -131,7 +131,7 @@ class SyncGraph:
# set an ID in _mark_missing if a node is in the uncheck list. Thus, setting the ID once
# prevents future attempts to set the ID of the same node.
# Also, setting an identifiable is only done when needed, i.e. there is no identifiable.
# Note, that when ever one node is changed, we check all dependend nodes (see usage of
# Note, that when ever one node is changed, we check all dependent nodes (see usage of
# `_get_nodes_whose_identity_relies_on`) whether something should be updated. Thus, we cannot
# miss a necessary update.
def __init__(
......@@ -361,10 +361,8 @@ class SyncGraph:
)
node.identifiable = identifiable
equivalent_se = self.get_equivalent(node)
if equivalent_se is not None and equivalent_se is not node:
if equivalent_se is not None:
self._merge_into(node, equivalent_se)
if equivalent_se.identifiable is None:
raise ValueError("Identifiable is missing")
else:
if node.identifiable.get_representation() in self._identifiable_look_up:
raise RuntimeError("Identifiable is already in the look up")
......@@ -541,7 +539,7 @@ class SyncGraph:
- marks target as missing/existing if source was marked that way
- adds an identifiable if now possible (e.g. merging based on ID might allow create an
identifiable when none of the two nodes hand the sufficient properties on its own before)
- check whether dependend nodes can now get and identifiable (the merge might have set the
- check whether dependent nodes can now get and identifiable (the merge might have set the
ID such that dependen nodes can now create an identifiable)
"""
# sanity checks
......@@ -627,7 +625,7 @@ class SyncGraph:
# - mark existing
# - mark missing
# - merge
self._add_identifiables_to_dependend_nodes(target)
self._add_identifiables_to_dependent_nodes(target)
if self.get_equivalent(target) is not None:
self._merge_into(target, self.get_equivalent(target))
......@@ -672,7 +670,7 @@ class SyncGraph:
value=lambda val: se_lookup[id(val)],
)
def _add_identifiables_to_dependend_nodes(self, node):
def _add_identifiables_to_dependent_nodes(self, node):
"""For each dependent node, we check whether this allows to create an identifiable
Last review by Alexander Schlemmer on 2024-05-29.
......@@ -693,7 +691,7 @@ class SyncGraph:
# - mark existing
# - mark missing
# - merge
self._add_identifiables_to_dependend_nodes(node)
self._add_identifiables_to_dependent_nodes(node)
# For each dependent node, we set the ID to None (missing)
# (None is the default second argument of set_id_of_node.)
for other_node in self._get_nodes_whose_identity_relies_on(node):
......@@ -713,4 +711,4 @@ class SyncGraph:
# - mark existing
# - mark missing
# - merge
self._add_identifiables_to_dependend_nodes(node)
self._add_identifiables_to_dependent_nodes(node)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment