Skip to content
Snippets Groups Projects
Commit 79037a0b authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'dev' into f-json-specification-doc

parents 6b688c52 82db1187
No related branches found
No related tags found
2 merge requests!222Release 0.12.0,!74F json specification doc
Pipeline #62093 failed
......@@ -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 ##
......
......@@ -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
[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
......
......@@ -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:
......
......@@ -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 ---------------------------------------------------
......
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment