Skip to content
Snippets Groups Projects
Commit dc1643bf authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-fix-crawler' into 'main'

FIX: multiple registered identifiables

See merge request !3
parents 41a9fa2b a4e231c7
No related branches found
No related tags found
1 merge request!3FIX: multiple registered identifiables
......@@ -11,12 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ###
* Required crawler version was invreased to 0.11.0 to allow for
inheritance in identifiables.
### Deprecated ###
### Removed ###
### Fixed ###
* Regexp for T1WeightedImage
### Security ###
### Documentation ###
......
......@@ -74,7 +74,7 @@ def test_folders(clear_database, usemodel):
crawler_definition,
converter_registry
)
crawler.save_debug_data("prov.yml")
#crawler.save_debug_data("prov.yml")
files = [fi for fi in records if isinstance(fi, db.File)]
for fi in files:
fi.file = __file__
......@@ -84,11 +84,10 @@ def test_folders(clear_database, usemodel):
assert len(datasets) == 1
assert len(subjects) == 5
assert len(sessions) == 10
ins, ups = crawler.synchronize(commit_changes=False)
ins, ups = crawler.synchronize(crawled_data=records, commit_changes=True)
funcs = [el for el in ins + ups if el.parents[0].name == "FunctionalImaging"]
anats = [el for el in ins + ups if el.parents[0].name == "AnatomyImaging"]
assert len(funcs) == 30
assert len(anats) == 10
for el in funcs:
assert (len(el.get_property("FunctionalImagingDataFile").value) == 2
or len(el.get_property("FunctionalImagingDataFile").value) == 3)
assert 30 == db.execute_query(
"count FunctionalImaging which references FunctionalImagingDataFile")
---
metadata:
crawler-version: 0.3.1
crawler-version: 0.11.0
macros:
- !defmacro
name: FuncDataFile
......@@ -477,7 +477,7 @@ project_level:
parent: "MagnetizationTransferSaturation"
- suffix: T1w
parent: "T1WeightedImage"
extension: "(nii(\.gz))?"
extension: "(nii(\\.gz)?)"
- suffix: T1w
parent: "JSONSidecar"
extension: "json"
......
......@@ -63,8 +63,8 @@ def test_dataset():
converter_registry,
restricted_path=["json_only", 'dataset_description.json']
)
subd = crawler.debug_tree
subc = crawler.debug_metadata
#subd = crawler.debug_tree
#subc = crawler.debug_metadata
# print(json.dumps(subc, indent=3))
# print(subd)
# print(subc)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment