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

fix

parent c374b9ec
No related branches found
No related tags found
No related merge requests found
Pipeline #10408 failed
......@@ -41,13 +41,19 @@ class ExampleH5CFood(H5CFood):
return ExperimentCFood.get_re()[:-len(readme_pattern)] + r".*\.hdf5"
def create_identifiables(self):
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):
if key == "attr_data_root":
return "single_attribute", value, dtype
if key == "ship_imo":
ship = db.Record()
ship.add_parent("Ship")
ship.add_property("IMO Number", value)
self.identifiables.append(ship)
return "Ship", ship, "Ship"
return key, value, dtype
......@@ -130,8 +130,6 @@ class H5CFood(AbstractFileCFood):
def collect_information(self):
self.h5file = h5py.File(fileguide.access(self.crawled_path), 'r')
self.structure = self.create_structure(self.h5file,
self.special_treatment)
@staticmethod
def get_re():
......@@ -151,6 +149,8 @@ class H5CFood(AbstractFileCFood):
This method will call is_identifiable(h5path, h5object) and create_identifiable(h5path,
h5object) on each HDF5 object to decide and actually create the identifiables.
"""
self.structure = self.create_structure(self.h5file,
self.special_treatment)
# manually create the identifiable root element: self.identifiable_root
def update_identifiables(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment