From 3af6c067ae441476df383ae59ba74a645d83f8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <henrik@trineo.org> Date: Tue, 20 Jul 2021 16:14:07 +0200 Subject: [PATCH] MAINT: use special treatment for creating RTs in H5CFood --- integrationtests/example_hdf5cfood.py | 1 - src/caosadvancedtools/cfoods/h5.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integrationtests/example_hdf5cfood.py b/integrationtests/example_hdf5cfood.py index f369f852..86d99417 100644 --- a/integrationtests/example_hdf5cfood.py +++ b/integrationtests/example_hdf5cfood.py @@ -44,7 +44,6 @@ class ExampleH5CFood(H5CFood): super().create_identifiables() self.identifiable_root = db.Record() self.identifiable_root.add_property("hdf5File", self.crawled_file) - self.identifiable_root.add_parent("ExampleH5") self.identifiables.append(self.identifiable_root) def special_treatment(self, key, value, dtype): diff --git a/src/caosadvancedtools/cfoods/h5.py b/src/caosadvancedtools/cfoods/h5.py index 22b92589..0264477f 100644 --- a/src/caosadvancedtools/cfoods/h5.py +++ b/src/caosadvancedtools/cfoods/h5.py @@ -259,9 +259,11 @@ class H5CFood(AbstractFileCFood): continue if create_recordTypes and key.lower() not in ['description']: - prop = db.Property(name=key, datatype=dtype) + treated_k, _, treated_dtype = special_treatment( + key, val, dtype) + prop = db.Property(name=treated_k, datatype=treated_dtype) collection.append(prop) - rec.add_property(name=key) + rec.add_property(name=treated_k) else: treated_k, treated_v, treated_dtype = special_treatment( key, val, dtype) -- GitLab