Skip to content
Snippets Groups Projects
Verified Commit e475d013 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Documentation, formatting, typos, error messages.

parent f733fbf7
Branches
Tags
2 merge requests!160STY: styling,!156Test for unmergeable entities
Pipeline #47688 passed
......@@ -761,8 +761,8 @@ class Crawler(object):
# 1. Is it in the cache of already checked Records?
if self.treated_records_lookup.get_any(record, identifiable) is not None:
treated_record = self.treated_records_lookup.get_any(record, identifiable)
# Since the identifiables are the same, treated_record and record actually describe
# the same obejct.
# Since the identifiables are the same, treated_record and record actually
# describe the same object.
# We merge record into treated_record in order to prevent loss of information
self._merge_identified(treated_record, record, try_to_merge_later, all_records)
referencing_entities = self.create_reference_mapping(all_records)
......
......@@ -221,23 +221,24 @@ startswith: bool, optional
for prop in registered_identifiable.properties:
if prop.name.lower() != "is_referenced_by":
continue
for givenrt in prop.value:
for looking_for_rt in prop.value:
found = False
if givenrt == "*":
if looking_for_rt == "*":
for val in referencing_entities.values():
if len(val) > 0:
found = True
refs.extend(val)
else:
rt_and_children = get_children_of_rt(givenrt)
rt_and_children = get_children_of_rt(looking_for_rt)
for rtname in rt_and_children:
if (rtname in referencing_entities):
refs.extend(referencing_entities[rtname])
found = True
if not found:
raise NotImplementedError(
f"An identifying property:\n"
f"\nIdentifying PROPERTY\n{prop.name}"
f"Could not find referencing entities of type(s): {prop.value}\n"
f"for registered identifiable:\n{registered_identifiable}\n"
f"There were {len(referencing_entities)} referencing entities to choose from."
)
return refs
......@@ -260,8 +261,8 @@ startswith: bool, optional
def get_identifiable(self, record: db.Record, referencing_entities=None):
"""
retrieve the registered identifiable and fill the property values to create an
identifiable
Retrieve the registered identifiable and fill the property values to create an
identifiable.
Args:
record: the record for which the Identifiable shall be created.
......
......@@ -4,7 +4,10 @@
see INSTALL.md
## Run Unit Tests
Run `pytest unittests`.
1. Install additional dependencies:
- h5py
2. Run `pytest unittests`.
## Documentation ##
We use sphinx to create the documentation. Docstrings in the code should comply
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment