Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
e322e5fe
Commit
e322e5fe
authored
11 months ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
DOC: added descriptions of possible errors to the docstring of one function
parent
d43d85db
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!178
FIX: #96 Better error output for crawl.py script.
,
!167
Sync Graph
Pipeline
#51491
passed with warnings
11 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caoscrawler/sync_graph.py
+10
-4
10 additions, 4 deletions
src/caoscrawler/sync_graph.py
with
10 additions
and
4 deletions
src/caoscrawler/sync_graph.py
+
10
−
4
View file @
e322e5fe
...
@@ -290,12 +290,14 @@ class SyncGraph():
...
@@ -290,12 +290,14 @@ class SyncGraph():
Equivalent means that ID, path or identifiable are the same.
Equivalent means that ID, path or identifiable are the same.
If a new information was added to the given SyncNode (e.g. the ID), it might be possible
If a new information was added to the given SyncNode (e.g. the ID), it might be possible
then to identify an equivalent node (i.e. one with the same ID in this example).
then to identify an equivalent node (i.e. one with the same ID in this example).
There might be more than one equivalent node
s
in the graph. However, simply the first that
There might be more than one equivalent node in the graph. However, simply the first that
is found is being returned. (When an equivalent node is found
this
, the given node is
is found is being returned. (When an equivalent node is found, the given node is
typically merged, into the one that was found and after the merge the graph is again
typically merged, into the one that was found and after the merge the graph is again
checked for equivalent nodes)
checked for equivalent nodes
.
)
Returns None if no equivalent node is found.
Returns None if no equivalent node is found.
Last review by Alexander Schlemmer on 2024-05-28.
"""
"""
if
entity
.
id
is
not
None
and
entity
.
id
in
self
.
_id_look_up
:
if
entity
.
id
is
not
None
and
entity
.
id
in
self
.
_id_look_up
:
candidate
=
self
.
_id_look_up
[
entity
.
id
]
candidate
=
self
.
_id_look_up
[
entity
.
id
]
...
@@ -323,9 +325,13 @@ class SyncGraph():
...
@@ -323,9 +325,13 @@ class SyncGraph():
def
_set_identifiable_of_node
(
self
,
node
:
SyncNode
,
def
_set_identifiable_of_node
(
self
,
node
:
SyncNode
,
identifiable
:
Optional
[
Identifiable
]
=
None
):
identifiable
:
Optional
[
Identifiable
]
=
None
):
"""
sets the identifiable and checks whether an equivalent node can be found with that new
"""
sets the identifiable and checks whether an equivalent node can be found with that new
information.
information.
If an equivalent node is found,
'
node
'
is merged into that node.
if no identifiable is given, the identifiable is retrieved from the identifiable adapter
if no identifiable is given, the identifiable is retrieved from the identifiable adapter
Raises a ValueError if the equivalent node found does not have an identifiable.
Raises a RuntimeError if there is no equivalent node found and
the (unique) string representation of the identifiable of node is already contained in the identifiable_look_up.
"""
"""
if
identifiable
is
None
:
if
identifiable
is
None
:
self
.
identifiableAdapter
.
all_identifying_properties_exist
(
node
)
self
.
identifiableAdapter
.
all_identifying_properties_exist
(
node
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment