You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the database API needs to support fetch of multiple molecules and values in one go, to minimize database reads and writes
# get mulitple molecules in one database readmolecules=db.get(
keys=(
{"inchi": "one"},
{"inchi": "two"},
),
)
# put multiple molecules in one database writedb.put(
molecules=(
stk.BuildingBlock(...),
stk.BuildingBlock(...),
),
)
# get multple valuesvalues=value_db.get(
molecules=(
stk.BuildingBlock(...),
stk.BuildingBlock(...),
),
)
# put multiple valuesvalue_db.put(
(stk.BuildingBlock(...), {"prop1": 1, "prop2": 21}),
(stk.BuildingBlock(...), {"prop1": 2}),
)
# not sure how to deal with the current API of value_db.put(
stk.BuildingBLock(...),
1,
)
# I might continue to support it, or I could depcrate it in favour of value_db.put((stk.BuildingBlock(...), 1))
ofc the single instance approach will still work, as it does in the stk api normally, however, the result will always be
returned as an iterable
molecule, =db.get({"smiles": "CC"})
However, in order to not break users, initially, if you do
result=db.get({"smiles": "CC"})
you will get a warning, that your return value will turn into an iterable in a future release, to remove the warning you should explicilty set change to
molecule, =db.get(
keys=(
{"smiles": "CC"},
)
)
So
molecule, =db.get({"smiles": "CC"})
will always work, just the return type will change.
The text was updated successfully, but these errors were encountered:
the database API needs to support fetch of multiple molecules and values in one go, to minimize database reads and writes
ofc the single instance approach will still work, as it does in the stk api normally, however, the result will always be
returned as an iterable
However, in order to not break users, initially, if you do
you will get a warning, that your return value will turn into an iterable in a future release, to remove the warning you should explicilty set change to
So
will always work, just the return type will change.
The text was updated successfully, but these errors were encountered: