diff --git a/setup.cfg b/setup.cfg index dd2961d13934c88b13535a0cc1c17b6d7dbd74e3..205fc60074589ac11c745ade435525602af6b434 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,8 +19,8 @@ package_dir = packages = find: python_requires = >=3.7 install_requires = - importlib-resources - caosadvancedtools >= 0.7.0 + importlib-resources + caosadvancedtools >= 0.7.0 linkahead > 0.13.2 yaml-header-tools >= 0.2.1 pyyaml diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 4990aecc025c290bed26e05d73833b756f904b46..e0bddb57a987e38b0e4b782d399bc94cb4a84eae 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -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) diff --git a/src/caoscrawler/identifiable_adapters.py b/src/caoscrawler/identifiable_adapters.py index d94b6fca211fc26c2702b8f9f5ad4bc8993bd920..d661b97a6ef158bf05b66ac79cf0520921abef0a 100644 --- a/src/caoscrawler/identifiable_adapters.py +++ b/src/caoscrawler/identifiable_adapters.py @@ -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. diff --git a/src/doc/README_SETUP.md b/src/doc/README_SETUP.md index 5f5161d0d672ff3ad14db5c5b49f5c65550b06d7..a75193783d861707adf3b3d45311c392e22626f4 100644 --- a/src/doc/README_SETUP.md +++ b/src/doc/README_SETUP.md @@ -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