aligns chained requests test with main.py (debug mode)
This commit is contained in:
@@ -174,14 +174,14 @@ if __name__=="__main__":
|
|||||||
eT = eT[0]
|
eT = eT[0]
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Usage: i|item|items|i[ELABID] for items, e|experiment|experiments|e[ELABID] for experiments.")
|
print("Usage: i|item|items|i[ELABID] for items, e|experiment|experiments|e[ELABID] for experiments.")
|
||||||
pass
|
continue
|
||||||
match eT:
|
match eT:
|
||||||
case "items" | "i" | "item":
|
case "items" | "i" | "item":
|
||||||
entryType = "items"
|
entryType = "items"
|
||||||
case "experiments" | "e" | "exp" | "experiment":
|
case "experiments" | "e" | "exp" | "experiment":
|
||||||
entryType = "experiments"
|
entryType = "experiments"
|
||||||
case _:
|
case _:
|
||||||
pass
|
continue
|
||||||
# This will probably be reworked in production
|
# This will probably be reworked in production
|
||||||
try:
|
try:
|
||||||
elabid = elabid
|
elabid = elabid
|
||||||
@@ -198,10 +198,9 @@ if __name__=="__main__":
|
|||||||
item = Entrypoint(data)
|
item = Entrypoint(data)
|
||||||
elif data.get("category_title") in ["PLD Target", "Substrate"]:
|
elif data.get("category_title") in ["PLD Target", "Substrate"]:
|
||||||
item = Material(data)
|
item = Material(data)
|
||||||
print(item.get_compound_formula())
|
print(item.get_compound_formula(apikey))
|
||||||
|
else:
|
||||||
|
raise Exception("The selected item or experiment is not in one of the following categories: [Sample, PLD Target, Substrate, PLD Deposition].")
|
||||||
result = item.__dict__
|
result = item.__dict__
|
||||||
result.pop("extra")
|
result.pop("extra")
|
||||||
print(result)
|
print(result)
|
||||||
# print(json.dumps(chain.sample_data))
|
|
||||||
# print(json.dumps(chain.linked_experiments))
|
|
||||||
# print(chain.batch_elabid)
|
|
||||||
Reference in New Issue
Block a user