adds chained request from layer to pld target
This commit is contained in:
14
src/main.py
14
src/main.py
@@ -84,7 +84,15 @@ def chain_entrypoint_to_layers(sample_object):
|
|||||||
layer_object_list.sort(key=lambda x: x.layer_number)
|
layer_object_list.sort(key=lambda x: x.layer_number)
|
||||||
return layer_object_list
|
return layer_object_list
|
||||||
|
|
||||||
|
def chain_layer_to_target(layer_object):
|
||||||
|
'''
|
||||||
|
Takes a Layer-class object, looks at its .target_elabid attribute and returns a Material-class object containing data on the PLD target used in the deposition of said layer.
|
||||||
|
|
||||||
|
Dependency: call_material_from_elabid.
|
||||||
|
'''
|
||||||
|
target_elabid = layer_object.target_elabid
|
||||||
|
material_object = call_material_from_elabid(target_elabid)
|
||||||
|
return material_object
|
||||||
|
|
||||||
#sample_object = call_entrypoint_from_elabid(elabid)
|
#sample_object = call_entrypoint_from_elabid(elabid)
|
||||||
#from_entrypoint_to_material(sample_object)
|
#from_entrypoint_to_material(sample_object)
|
||||||
@@ -97,13 +105,17 @@ if __name__=="__main__":
|
|||||||
elabid = input("Enter elabid of your starting sample [default= 1111]: ") or 1111
|
elabid = input("Enter elabid of your starting sample [default= 1111]: ") or 1111
|
||||||
data = APIHandler(apikey).get_entry_from_elabid(elabid)
|
data = APIHandler(apikey).get_entry_from_elabid(elabid)
|
||||||
sample = Entrypoint(data)
|
sample = Entrypoint(data)
|
||||||
layers = chain_entrypoint_to_layers(sample)
|
batch = chain_entrypoint_to_batch(sample) # Material-class object
|
||||||
|
layers = chain_entrypoint_to_layers(sample) # list of Layer-class objects
|
||||||
print(f"Sample name:\n{sample.name}\n")
|
print(f"Sample name:\n{sample.name}\n")
|
||||||
|
print(f"Substrate data:\n{batch.get_compound_formula(apikey)}\n")
|
||||||
print(f"Layers data:")
|
print(f"Layers data:")
|
||||||
for layer in layers:
|
for layer in layers:
|
||||||
ld = layer.__dict__
|
ld = layer.__dict__
|
||||||
ld.pop("extra")
|
ld.pop("extra")
|
||||||
|
tgt = chain_layer_to_target(layer)
|
||||||
print(ld)
|
print(ld)
|
||||||
|
print(tgt.get_compound_formula(apikey) + f"\n")
|
||||||
|
|
||||||
# entryType = None
|
# entryType = None
|
||||||
# while entryType not in ["items", "experiments"]:
|
# while entryType not in ["items", "experiments"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user