Especially with references, I find myself in a situation, where I want to save a node, but maybe it has been saved before, in that case I would just want to update the node.
This is doable with the current API, and I use the following construct:
pipeline_ref = cript.Reference(
group=proj.group,
title="In silico active learning for small molecule properties",
doi="10.1039/D2ME00137C",
authors=[
"Schneider, Ludwig",
"Schwarting, Marcus",
"Mysona, Joshua",
"Liang, Heyi",
"Han, Ming",
"Rauscher, Phillip M",
"Ting, Jeffrey M",
"Venkatram, Shruti",
"Ross, Richard B",
"Schmidt, KJ.",
"Blazik, Ben",
"Foster, Ian",
"de Pablo, Juan",
],
journal="Molecular Systems Design & Engineering",
year=2022,
publisher="Royal Society of Chemistry",
)
try:
search_node = api.get(cript.Reference, {"doi": pipeline_ref.doi})
except cript.exceptions.APIGetError:
api.save(pipeline_ref)
else:
pipeline_ref.url = search_node.url
api.refresh(pipeline_ref)
But maybe it is worth it, to integrate this into the API, that you can do it in a single function call.
Maybe even with the auto save option we talked about.
Working with the SDK API on
develop
.Especially with references, I find myself in a situation, where I want to save a node, but maybe it has been saved before, in that case I would just want to update the node. This is doable with the current API, and I use the following construct:
But maybe it is worth it, to integrate this into the API, that you can do it in a single function call. Maybe even with the auto save option we talked about.