Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rouk1 committed Jan 28, 2025
1 parent 65bc57c commit c49751e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions skore/src/skore/persistence/repository/view_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from skore.persistence.abstract_storage import AbstractStorage
from skore.view.view import View
from skore.persistence.storage.abstract_storage import AbstractStorage
from skore.persistence.view.view import View


class ViewRepository:
Expand Down
20 changes: 18 additions & 2 deletions skore/src/skore/persistence/view/view.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
"""Project View models."""

from dataclasses import dataclass
from typing import Literal


@dataclass
class LayoutItem:
"""A layout item.
A view has items they can be an porjetc item or a markdown item
"""

kind: Literal["markdown", "item"]
value: str


# An ordered list of keys to display
Layout = list[str]
Layout = list[LayoutItem]


@dataclass
Expand All @@ -12,7 +25,10 @@ class View:
Examples
--------
>>> View(layout=["a", "b"])
>>> View(layout=[
{"kind": "markdown", "value": "# title"},
{"kind": "item", "value": "item/key"},
])
View(...)
"""

Expand Down

0 comments on commit c49751e

Please sign in to comment.