more use(less,ful) comments
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user