Skip to content
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

feat: Modify the user API of skore to respect "what you put is what you get" principle #1052

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/getting_started/plot_tracking_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# We retrieve the history of the ``my_int`` item:

# %%
item_histories = my_project.get_item_versions("my_int")
item_histories = my_project.get_item_versions("my_int") # TO CHANGE /!\

# %%
# We can print the first history (first iteration) of this item:
Expand Down
18 changes: 6 additions & 12 deletions examples/getting_started/plot_working_with_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,19 @@ def my_func(x):
)

# %%
# Moreover, we can also explicitly tell skore the media type of an object, for example
# in HTML:
# Moreover, we can also explicitly tell skore the way we want to display an object, for
# example in HTML:

# %%
from skore.item import MediaItem

my_project.put_item(
my_project.put(
"my_string_3",
MediaItem.factory(
"<p><h1>Title</h1> <b>bold</b>, <i>italic</i>, etc.</p>", media_type="text/html"
),
"<p><h1>Title</h1> <b>bold</b>, <i>italic</i>, etc.</p>",
display_as="html",
)

# %%
# .. note::
# We used :func:`~skore.Project.put_item` instead of :func:`~skore.Project.put`.

# %%
# Note that the media type is only used for the UI, and not in this notebook at hand:
# Note that the `display_as` is only used for the UI, and not in this notebook at hand:

# %%
my_project.get("my_string_3")
Expand Down
2 changes: 1 addition & 1 deletion examples/model_evaluation/plot_cross_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
# %%
# We can also access the plot after we have stored the ``CrossValidationReporter``:
my_project.put("cross_validation_regression", reporter)
cv_item = my_project.get_item("cross_validation_regression")
cv_item = my_project.get_item("cross_validation_regression") # TO CHANGE /!\
cv_item.plots["Scores"]

# %%
Expand Down
63 changes: 0 additions & 63 deletions skore/src/skore/item/__init__.py

This file was deleted.

Loading
Loading