-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to insert several items at once #173
Comments
@MarieS-WiMLDS can you tell us if we want to do this? (using updated project-wise syntax.) |
Sounds good, and in line with initial expectations. Just note that since the API has changed yesterday, we could write something like: project.put({"a": {"b": "hi"}}) ... to iteratively call |
@tuscland i suggest using class Project:
def put(self, *key_value_pair: tuple[str, objet]): ...
# [...]
project.put(("key", "value"))
project.put(("key, "value"), ("key", "value"), ("key", "value")) (untested snippet) |
Users want to insert a dict because they build it progressively. |
You mean, user will build a huge dict and put this dict in skore at the end of its script ? myproject = {
"key1": "value1",
"key2": "value2",
"key3": "value3",
}
[...]
myproject["key4"] = "value4"
[...]
myproject["key5"] = "value5"
skore_project.put(myproject) If so, its a bit weird in my opinion to not use directly skore_project.put(("key1", "value1"), ("key2", "value2"), ("key3", "value3"))
[...]
skore_project.put(("key4", "value4"))
[...]
skore_project.put(("key5", "value5")) |
It makes sense because then you have only one call to skore, and some people prefer that. The syntax based on tuples is not user friendly. Also, I am not a fan of the |
Okay, after a first iteration (#363) we found that the expected behaviour is unclear in case of errors: if one of the values cannot be saved to the database, what should we do? A more concrete example: project.put({
"df_train": df_train,
"df_test": (lambda: "unsupported value"),
"y_train": (lambda: "unsupported value"),
"y_test": y_test,
}) Here the value of project.put("y_test", (lambda: "unsupported value")) raises a So, in the dict example, should we:
|
options 2 and 3 are absolute no go for me, because they may stop a training or calibration that takes time. |
3 and 4 are the same workflow with a different output: warning versus exception. |
In general, it is important to give users the confidence that using skore will not break their workflow, i.e. we follow Postel's law: be liberal in what you accept, and conservative in what you provide. Should we create an issue to verify this aspect is well implemented overall? Also, it should be documented. |
I'm not sure how one would check this, but feel free |
Something like
which would have the same effect as
This is because it is not uncommon in DS tasks to save several metrics at once, and to keep them all in a big dictionary. This dict syntax would make it frictionless to start using mandr without riddling one's code with
Store.insert
statements.However, I wonder what should happen when inserting a nested dict, e.g.
The text was updated successfully, but these errors were encountered: