Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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-pylib
Commits
ab379939
Commit
ab379939
authored
1 year ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
DOC: clarified that the compare_entities function does not work for abstract properties
parent
945e08a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!107
ENH: add entity getters and cached functions
,
!103
Improving the compare_entities functions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/apiutils.py
+6
-2
6 additions, 2 deletions
src/caosdb/apiutils.py
with
6 additions
and
2 deletions
src/caosdb/apiutils.py
+
6
−
2
View file @
ab379939
...
...
@@ -195,7 +195,8 @@ def getCommitIn(folder):
return
t
.
readline
().
strip
()
def
compare_entities
(
old_entity
:
Entity
,
new_entity
:
Entity
,
compare_referenced_records
:
bool
=
False
):
def
compare_entities
(
old_entity
:
Entity
,
new_entity
:
Entity
,
compare_referenced_records
:
bool
=
False
):
"""
Compare two entites.
Return a tuple of dictionaries, the first index belongs to additional information for old
...
...
@@ -207,7 +208,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_
- Each property lists either an additional property or a property with a changed:
- datatype
- importance or
- value
(not implemented yet)
- value
In case of changed information the value listed under the respective key shows the
value that is stored in the respective entity.
...
...
@@ -217,6 +218,9 @@ def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_
`compare_referenced_records = False` to prevent infinite recursion in case
of circular references).
NOTE: This function does not work for abstract properties! I.e. it is not possible
to directly compare two entities that are of class db.Property.
Parameters
----------
old_entity, new_entity : Entity
...
...
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