diff --git a/CHANGELOG.md b/CHANGELOG.md index 00252658b4fe2117100a695f270bc66b752431bd..33fdff70f9af8d1c2174dc0ec297b08762fdeb63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### +### Changed ### + +### Deprecated ### + +### Removed ### + +### Fixed ### +- A RecordType with multiple Parents no longer causes an error during + collection of identifiables + +### Security ### + +### Documentation ### + +## [0.11.0] - 2025-03-05 ## + +### Added ### + - Validation module for checking a list of generated records against a list of json schemas that can be generated from a yaml data model file. - DictElementConverters can now make use of `match_properties` which @@ -46,10 +64,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `True`) are now interpreted as empty strings in `converters.match_name_and_value` instead of being cast to string naïvely -### Deprecated ### - -### Removed ### - ### Fixed ### - `spss_to_datamodel` script works again. @@ -60,9 +74,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 empty cell. This has been fixed by treating None and NA values in `converters.match_name_and_value` (see above). -### Security ### - ### Documentation ### + - Added documentation for ROCrateConverter, ELNFileConverter, and ROCrateEntityConverter ## [0.10.1] - 2024-11-13 ## diff --git a/CITATION.cff b/CITATION.cff index ed859432b26cde913f7283fb8e969a97b7b74f41..8f4e22a4f8b56c8640e7d0a9a5ccae93010b4847 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -17,6 +17,6 @@ authors: given-names: Alexander orcid: https://orcid.org/0000-0003-4124-9649 title: CaosDB - Crawler -version: 0.10.1 +version: 0.11.0 doi: 10.3390/data9020024 -date-released: 2024-11-13 \ No newline at end of file +date-released: 2025-03-05 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index ae138a9ace0dcc6d88bb1f8fb46f77ac094f73a0..f6f95d6de8bdea2d7620eb05d7654cb9600fabb5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = caoscrawler -version = 0.10.2 +version = 0.11.1 author = Alexander Schlemmer author_email = alexander.schlemmer@ds.mpg.de description = A new crawler for LinkAhead diff --git a/src/caoscrawler/identifiable_adapters.py b/src/caoscrawler/identifiable_adapters.py index 6169a99e7bf47daffb53332b7e0b6513730f2561..444b73f5d9a42cf8ec23eec7cb718b1fc183dd30 100644 --- a/src/caoscrawler/identifiable_adapters.py +++ b/src/caoscrawler/identifiable_adapters.py @@ -672,11 +672,15 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter): registered = [] for parent in rt.parents: prt = _retrieve_RecordType(id=parent.id, name=parent.name) - registered.append(self._get_registered_for_rt(prt)) + reg = self._get_registered_for_rt(prt) + if reg is not None: + registered.append(reg) # TODO we might in future want to check whether the registered identifiables are the same if len(registered) > 1: - raise RuntimeError("Multiple registered identifiables found for the RecordType " - f" {rt.name} with the following parents: {rt.parents}") + ri_names = [i.name for i in registered] + raise RuntimeError(f"Multiple registered identifiables found for the RecordType " + f" {rt.name} with the following parents: {rt.parents}\n" + f"Registered identifiables: {', '.join(ri_names)}") elif len(registered) == 1: return registered[0] else: diff --git a/src/doc/conf.py b/src/doc/conf.py index 0b591fba59522b7e9386da5b68e3c70ef0fa7346..2a783dec27a700f9d350a2b46cdd647ff0fccf2f 100644 --- a/src/doc/conf.py +++ b/src/doc/conf.py @@ -33,10 +33,10 @@ copyright = '2024, IndiScale' author = 'Alexander Schlemmer' # The short X.Y version -version = '0.10.2' +version = '0.11.1' # The full version, including alpha/beta/rc tags # release = '0.5.2-rc2' -release = '0.10.2-dev' +release = '0.11.1-dev' # -- General configuration --------------------------------------------------- diff --git a/unittests/test_identifiable_adapters.py b/unittests/test_identifiable_adapters.py index 5108e83c83db16f1b44d836bf22d21d8e871ee8f..1c7733acfe952a2f47eff2853c2b90684c098dbf 100644 --- a/unittests/test_identifiable_adapters.py +++ b/unittests/test_identifiable_adapters.py @@ -54,7 +54,9 @@ def mock_retrieve_RecordType(id, name): "Lab": db.RecordType(name="Lab"), "Analysis": db.RecordType(name="Analysis"), "MetaAnalysis": db.RecordType(name="MetaAnalysis").add_parent("Analysis"), - "Measurement": db.RecordType(name="Measurement").add_parent("Experiment") + # Test that two parents are possible; only one of them + # (Experiment) has an identifiable. + "Measurement": db.RecordType(name="Measurement").add_parent("Experiment").add_parent("A") }[name] @@ -330,8 +332,10 @@ def test_get_registered_identifiable(): with pytest.raises(RuntimeError): registered = ident.get_registered_identifiable(rec) - # Test the case that the record has a parent for which no identifiable is registered - # and there is a registered identifiable for a grand parent + # Test the case that the record has a parent for which no + # identifiable is registered and there is a registered + # identifiable for a grand parent. Note that this also tests the + # case of two grandparents, only one of which has an identifiable. ident = CaosDBIdentifiableAdapter() ident.load_from_yaml_definition(UNITTESTDIR / "example_identifiables.yml") rec = db.Record().add_parent(name="Measurement")