more use(less,ful) comments

This commit is contained in:
2026-02-10 14:46:57 +01:00
parent c49aa23aea
commit 5aa7527cca
3 changed files with 9 additions and 4 deletions

View File

@@ -83,10 +83,10 @@ class Entrypoint:
def __init__(self, sample_data):
try:
self.extra = sample_data["metadata_decoded"]["extra_fields"]
self.linked_items = sample_data["items_links"]
self.batch_elabid = self.extra["Substrate batch"]["value"]
self.linked_experiments = sample_data["related_experiments_links"]
self.linked_experiments_elabid = [ i["entityid"] for i in self.linked_experiments ]
self.linked_items = sample_data["items_links"] # dict
self.batch_elabid = self.extra["Substrate batch"]["value"] # elabid
self.linked_experiments = sample_data["related_experiments_links"] # dict
self.linked_experiments_elabid = [ i["entityid"] for i in self.linked_experiments ] # list of elabid
except KeyError as k:
# Some keys are not required and can be called through the .get() method - which is permissive and allows null values;
# Other keys are required so if they can't be called (invalid or null) raise error and stop execution of the program: