From e5f8ca283500592850c16e2f977116574f38c911 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Wed, 19 Mar 2025 15:46:23 +0100
Subject: [PATCH 1/3] FIX: multiple registered identifiables

---
 integrationtests/test_bids_folderstructure_cfood.py | 9 ++++-----
 src/bids-cfood/cfood.yml                            | 2 +-
 unittests/test_dataset_description.py               | 4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/integrationtests/test_bids_folderstructure_cfood.py b/integrationtests/test_bids_folderstructure_cfood.py
index a43d7f3..210a7e6 100644
--- a/integrationtests/test_bids_folderstructure_cfood.py
+++ b/integrationtests/test_bids_folderstructure_cfood.py
@@ -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")
diff --git a/src/bids-cfood/cfood.yml b/src/bids-cfood/cfood.yml
index 41b210d..cc72a3d 100644
--- a/src/bids-cfood/cfood.yml
+++ b/src/bids-cfood/cfood.yml
@@ -477,7 +477,7 @@ project_level:
                         parent: "MagnetizationTransferSaturation"
                       - suffix: T1w
                         parent: "T1WeightedImage"
-                        extension: "(nii(\.gz))?"
+                        extension: "(nii(\\.gz)?)"
                       - suffix: T1w
                         parent: "JSONSidecar"
                         extension: "json"
diff --git a/unittests/test_dataset_description.py b/unittests/test_dataset_description.py
index d7e26d2..95c6af6 100644
--- a/unittests/test_dataset_description.py
+++ b/unittests/test_dataset_description.py
@@ -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)
-- 
GitLab


From 91f386f8cb94e426722c78012d325699975a14ba Mon Sep 17 00:00:00 2001
From: Florian Spreckelsen <f.spreckelsen@indiscale.com>
Date: Thu, 20 Mar 2025 13:53:26 +0100
Subject: [PATCH 2/3] DOCS: Update changelog

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ecc1b5d..6b6c1fd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Fixed ###
 
+* Regexp for T1WeightedImage
+
 ### Security ###
 
 ### Documentation ###
-- 
GitLab


From a4e231c70e68eda5cbb30979ca817ad223b4383f Mon Sep 17 00:00:00 2001
From: Florian Spreckelsen <f.spreckelsen@indiscale.com>
Date: Thu, 20 Mar 2025 16:56:08 +0100
Subject: [PATCH 3/3] BUILD: Increase required crawler version

---
 CHANGELOG.md             | 3 +++
 src/bids-cfood/cfood.yml | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6b6c1fd..0d64d88 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,9 @@ 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 ###
diff --git a/src/bids-cfood/cfood.yml b/src/bids-cfood/cfood.yml
index cc72a3d..b2a42e3 100644
--- a/src/bids-cfood/cfood.yml
+++ b/src/bids-cfood/cfood.yml
@@ -1,6 +1,6 @@
 ---
 metadata:
-  crawler-version: 0.3.1
+  crawler-version: 0.11.0
   macros:
   - !defmacro
     name: FuncDataFile
-- 
GitLab