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

Revert "feat: add special datatype for timestamp (#730)" #732

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions docs/reference/experimental/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@
options:
members: ["download_results_by_tag"]
show_root_heading: true
::: kolena._experimental.special_data_type
options:
show_root_heading: true
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from classification.multiclass.constants import DATASET
from classification.multiclass.constants import ID_FIELDS

from kolena.annotation import ScoredClassificationLabel
from kolena.dataset import download_dataset
from kolena.dataset import upload_results
from kolena.workflow.annotation import ScoredClassificationLabel


MODELS = ["resnet50v2", "inceptionv3"]
Expand Down
85 changes: 0 additions & 85 deletions kolena/_experimental/special_data_type.py

This file was deleted.

3 changes: 0 additions & 3 deletions kolena/_utils/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class DataCategory(str, Enum):
METRICS = "METRICS"
ASSET = "ASSET"
ANNOTATION = "ANNOTATION"
SPECIAL = "SPECIAL"

def data_category_to_module_name(self) -> str:
if self == DataCategory.TEST_SAMPLE:
Expand All @@ -98,8 +97,6 @@ def data_category_to_module_name(self) -> str:
return "kolena.asset"
if self == DataCategory.ANNOTATION:
return "kolena.annotation"
if self == DataCategory.SPECIAL:
return "kolena._experimental.data_type.special"
raise ValueError(f"Must specify module name for data category: {self}")


Expand Down
1 change: 0 additions & 1 deletion kolena/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class _AnnotationType(DataType):
TIME_SEGMENT = "TIME_SEGMENT"
TEXT_SEGMENT = "TEXT_SEGMENT"
CUSTOM = "CUSTOM"
TIMESTAMP = "TIMESTAMP"

@staticmethod
def _data_category() -> DataCategory:
Expand Down
11 changes: 3 additions & 8 deletions tests/integration/dataset/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@
import pytest

from kolena._api.v2.dataset import CommitData
from kolena._experimental.special_data_type import Timestamp
from kolena.annotation import BoundingBox
from kolena.annotation import LabeledBoundingBox
from kolena.dataset import download_dataset
from kolena.dataset import list_datasets
from kolena.dataset import upload_dataset
from kolena.dataset.dataset import _fetch_dataset_history
from kolena.dataset.dataset import _load_dataset_metadata
from kolena.errors import InputValidationError
from kolena.errors import NotFoundError
from kolena.workflow.annotation import BoundingBox
from kolena.workflow.annotation import LabeledBoundingBox
from tests.integration.helper import assert_frame_equal
from tests.integration.helper import fake_locator
from tests.integration.helper import upload_extracted_properties
Expand Down Expand Up @@ -84,8 +83,6 @@ def test__upload_dataset() -> None:
LabeledBoundingBox(label="cat", top_left=[i, i], bottom_right=[i + 10, i + 10]),
LabeledBoundingBox(label="dog", top_left=[i + 5, i + 5], bottom_right=[i + 20, i + 20]),
],
time_str=Timestamp(value=f"12/31/2024, 00:00:{'{:02d}'.format(i)}", format="%m/%d/%Y, %H:%M:%S"),
time_num=Timestamp(epoch_time=1735689600 + i),
)
for i in range(20)
]
Expand All @@ -99,12 +96,10 @@ def test__upload_dataset() -> None:
BoundingBox(label=bbox.label, top_left=bbox.top_left, bottom_right=bbox.bottom_right)
for bbox in dp["bboxes"]
],
time_str=dp["time_str"],
time_num=dp["time_num"],
)
for dp in datapoints
]
columns = ["locator", "width", "height", "city", "bboxes", "time_str", "time_num"]
columns = ["locator", "width", "height", "city", "bboxes"]

upload_dataset(name, pd.DataFrame(datapoints[:10], columns=columns), id_fields=["locator"])

Expand Down
83 changes: 0 additions & 83 deletions tests/unit/_experimental/test_special_data_type.py

This file was deleted.