some attributes don't default to NoneType anymore
Target.description defaults to "" (empty str) Substrate.thickness defaults to "" (empty str) Substrate.thickness_unit is now hardcoded to "μm" did you know? apparently h5py does NOT like null values
This commit is contained in:
@@ -175,7 +175,8 @@ class Substrate(Material):
|
||||
self.miscut_angle_unit = self.extra["Miscut Angle"]["unit"]
|
||||
self.miscut_direction = self.extra["Miscut Direction"]["value"]
|
||||
# Not present (yet) on eLabFTW for Substrates:
|
||||
self.thickness = None #self.extra["Thickness"]["value"]
|
||||
self.thickness = "" #self.extra["Thickness"]["value"]
|
||||
self.thickness_unit = "μm" #self.extra["Thickness"]["unit"]
|
||||
self.surface_treatment = self.extra["Surface treatment"]["value"]
|
||||
self.manufacturer = self.extra["Supplier"]["value"]
|
||||
self.batch_id = self.extra["Batch ID"]["value"]
|
||||
@@ -194,7 +195,7 @@ class Target(Material):
|
||||
except KeyError as k:
|
||||
raise KeyError(f"The provided dictionary lacks a \"{k}\" key - which is specific for PLD targets. Check the {self.name} target entry on eLabFTW and make sure you used the correct Resource template.")
|
||||
# Non-required attributes:
|
||||
self.description = material_data.get("body") or None
|
||||
self.description = material_data.get("body") or ""
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user