Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbhagatio committed Oct 10, 2024
1 parent b54e1c3 commit d6cf52f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/io/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import aeon
from aeon.schema.schemas import exp02
from aeon.schema.ingestion_schemas import social03

nonmonotonic_path = Path(__file__).parent.parent / "data" / "nonmonotonic"
monotonic_path = Path(__file__).parent.parent / "data" / "monotonic"
Expand All @@ -14,15 +15,15 @@
@mark.api
def test_load_start_only():
data = aeon.load(
nonmonotonic_path, exp02.Patch2.Encoder, start=pd.Timestamp("2022-06-06T13:00:49"), downsample=None
nonmonotonic_path, exp02.Patch2.Encoder, start=pd.Timestamp("2022-06-06T13:00:49")
)
assert len(data) > 0


@mark.api
def test_load_end_only():
data = aeon.load(
nonmonotonic_path, exp02.Patch2.Encoder, end=pd.Timestamp("2022-06-06T13:00:49"), downsample=None
nonmonotonic_path, exp02.Patch2.Encoder, end=pd.Timestamp("2022-06-06T13:00:49")
)
assert len(data) > 0

Expand All @@ -35,22 +36,22 @@ def test_load_filter_nonchunked():

@mark.api
def test_load_monotonic():
data = aeon.load(monotonic_path, exp02.Patch2.Encoder, downsample=None)
data = aeon.load(monotonic_path, exp02.Patch2.Encoder)
assert len(data) > 0
assert data.index.is_monotonic_increasing


@mark.api
def test_load_nonmonotonic():
data = aeon.load(nonmonotonic_path, exp02.Patch2.Encoder, downsample=None)
data = aeon.load(nonmonotonic_path, exp02.Patch2.Encoder)
assert not data.index.is_monotonic_increasing


@mark.api
def test_load_encoder_with_downsampling():
DOWNSAMPLE_PERIOD = 0.02
data = aeon.load(monotonic_path, exp02.Patch2.Encoder, downsample=True)
raw_data = aeon.load(monotonic_path, exp02.Patch2.Encoder, downsample=None)
data = aeon.load(monotonic_path, social03.Patch2.Encoder)
raw_data = aeon.load(monotonic_path, exp02.Patch2.Encoder)

# Check that the length of the downsampled data is less than the raw data
assert len(data) < len(raw_data)
Expand Down

0 comments on commit d6cf52f

Please sign in to comment.