Skip to content

Commit

Permalink
mob next [ci-skip] [ci skip] [skip ci]
Browse files Browse the repository at this point in the history
lastFile:skore/tests/unit/view/test_view_repository.py
  • Loading branch information
augustebaum committed Jan 8, 2025
1 parent 38446cf commit a7d956e
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 29 deletions.
2 changes: 2 additions & 0 deletions skore/src/skore/persistence/item/pickle_item.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from functools import cached_property
from pickle import dumps, loads
from typing import Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from functools import cached_property
from typing import TYPE_CHECKING

from skore.item.item import Item, ItemTypeError
from .item import Item, ItemTypeError

if TYPE_CHECKING:
import sklearn.base
Expand Down
4 changes: 2 additions & 2 deletions skore/src/skore/persistence/repository/item_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
)

if TYPE_CHECKING:
from skore.item.item import Item
from skore.persistence.abstract_storage import AbstractStorage
from skore.persistence.item import Item
from skore.persistence.storage import AbstractStorage


class ItemRepository:
Expand Down
2 changes: 1 addition & 1 deletion skore/src/skore/project/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
ProjectCreationError,
ProjectPermissionError,
)
from skore.persistence.view.view import View
from skore.project.load import load
from skore.project.project import Project, logger
from skore.utils._logger import logger_context
from skore.view.view import View


def _validate_project_name(project_name: str) -> tuple[bool, Optional[Exception]]:
Expand Down
7 changes: 6 additions & 1 deletion skore/src/skore/project/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

from __future__ import annotations

import logging
from typing import TYPE_CHECKING, Any, Optional, Union

from skore.persistence import item_to_object, object_to_item
from skore.persistence.item import item_to_object, object_to_item

if TYPE_CHECKING:
from skore.persistence import (
Expand All @@ -15,6 +16,10 @@
)


logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler()) # Default to no output
logger.setLevel(logging.INFO)

MISSING = object()


Expand Down
4 changes: 2 additions & 2 deletions skore/src/skore/ui/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

from fastapi import APIRouter, HTTPException, Request, status

from skore.item import Item
from skore.persistence.item import Item
from skore.persistence.view.view import Layout, View
from skore.project import Project
from skore.view.view import Layout, View

router = APIRouter(prefix="/project")

Expand Down
2 changes: 1 addition & 1 deletion skore/tests/integration/sklearn/test_cross_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sklearn.multiclass import OneVsOneClassifier
from sklearn.svm import SVC
from skore import CrossValidationReporter
from skore.item.cross_validation_item import CrossValidationItem
from skore.persistence.item.cross_validation_item import CrossValidationItem
from skore.sklearn.cross_validation.cross_validation_helpers import _get_scorers_to_add


Expand Down
4 changes: 2 additions & 2 deletions skore/tests/integration/ui/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from sklearn.linear_model import Lasso
from sklearn.model_selection import KFold
from skore import CrossValidationReporter
from skore.item.media_item import MediaItem
from skore.persistence.item.media_item import MediaItem
from skore.persistence.view.view import View
from skore.ui.app import create_app
from skore.view.view import View


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions skore/tests/unit/item/test_cross_validation_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import plotly.graph_objects
import pytest
from sklearn.model_selection import StratifiedKFold
from skore.item.cross_validation_item import (
from skore.persistence.item import ItemTypeError
from skore.persistence.item.cross_validation_item import (
CrossValidationItem,
ItemTypeError,
_hash_numpy,
)
from skore.sklearn.cross_validation import CrossValidationReporter
Expand Down
3 changes: 2 additions & 1 deletion skore/tests/unit/item/test_item_repository.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from datetime import datetime, timezone

import pytest
from skore.item import ItemRepository, MediaItem
from skore.persistence.item import MediaItem
from skore.persistence.repository import ItemRepository


class TestItemRepository:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_media_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import PIL as pillow
import plotly.graph_objects as go
import pytest
from skore.item import ItemTypeError, MediaItem
from skore.persistence.item import ItemTypeError, MediaItem


class TestMediaItem:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_numpy_array_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy
import pytest
from skore.item import ItemTypeError, NumpyArrayItem
from skore.persistence.item import ItemTypeError, NumpyArrayItem


class TestNumpyArrayItem:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_pandas_dataframe_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from pandas import DataFrame, Index, MultiIndex
from pandas.testing import assert_frame_equal
from skore.item import ItemTypeError, PandasDataFrameItem
from skore.persistence.item import ItemTypeError, PandasDataFrameItem


class TestPandasDataFrameItem:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_pandas_series_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from pandas import Index, MultiIndex, Series
from pandas.testing import assert_series_equal
from skore.item import ItemTypeError, PandasSeriesItem
from skore.persistence.item import ItemTypeError, PandasSeriesItem


class TestPandasSeriesItem:
Expand Down
4 changes: 2 additions & 2 deletions skore/tests/unit/item/test_polars_dataframe_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import pytest
from polars import DataFrame
from polars.testing import assert_frame_equal
from skore.item import ItemTypeError, PolarsDataFrameItem
from skore.item.polars_dataframe_item import PolarsToJSONError
from skore.persistence.item import ItemTypeError, PolarsDataFrameItem
from skore.persistence.item.polars_dataframe_item import PolarsToJSONError


class TestPolarsDataFrameItem:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_polars_series_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from polars import Series
from polars.testing import assert_series_equal
from skore.item import ItemTypeError, PolarsSeriesItem
from skore.persistence.item import ItemTypeError, PolarsSeriesItem


class TestPolarsSeriesItem:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_primitive_item.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from skore.item import ItemTypeError, PrimitiveItem
from skore.persistence.item import ItemTypeError, PrimitiveItem


class TestPrimitiveItem:
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_sklearn_base_estimator_item.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import sklearn.svm
import skops.io
from skore.item import ItemTypeError, SklearnBaseEstimatorItem
from skore.persistence.item import ItemTypeError, SklearnBaseEstimatorItem


class Estimator(sklearn.svm.SVC):
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_skrub_table_report_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from pandas import DataFrame
from skore.item import ItemTypeError, SkrubTableReportItem
from skore.persistence.item import ItemTypeError, SkrubTableReportItem
from skrub import TableReport


Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/persistence/test_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import shutil
from pathlib import Path

from skore.persistence.disk_cache_storage import DiskCacheStorage
from skore.persistence.storage import DiskCacheStorage


def test_disk_storage(tmp_path: Path):
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/persistence/test_memory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from skore.persistence.in_memory_storage import InMemoryStorage
from skore.persistence.storage import InMemoryStorage


def test_in_memory_storage():
Expand Down
2 changes: 1 addition & 1 deletion skore/tests/unit/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
ProjectAlreadyExistsError,
ProjectCreationError,
)
from skore.persistence.view.view import View
from skore.project import (
Project,
create,
load,
)
from skore.project.create import _validate_project_name
from skore.project.load import ProjectLoadError
from skore.view.view import View


def test_put_string_item(in_memory_project):
Expand Down
6 changes: 3 additions & 3 deletions skore/tests/unit/view/test_view_repository.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from skore.persistence.in_memory_storage import InMemoryStorage
from skore.view.view import View
from skore.view.view_repository import ViewRepository
from skore.persistence.repository import ViewRepository
from skore.persistence.storage import InMemoryStorage
from skore.persistence.view.view import View


@pytest.fixture
Expand Down

0 comments on commit a7d956e

Please sign in to comment.