Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JSabadin committed Jan 10, 2025
1 parent a57eae4 commit 490a890
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.10']
max-parallel: 1

runs-on: ${{ matrix.os }}

steps:
Expand Down
37 changes: 19 additions & 18 deletions tests/test_data/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,11 @@ def generator():
)


def test_clone_dataset(tempdir: Path, bucket_storage: BucketStorage):
dataset1_name = "test_clone"
dataset1 = LuxonisDataset(
dataset1_name,
def test_clone_dataset(
bucket_storage: BucketStorage, dataset_name: str, tempdir: Path
):
dataset = LuxonisDataset(
dataset_name,
bucket_storage=bucket_storage,
delete_existing=True,
delete_remote=True,
Expand All @@ -510,25 +511,25 @@ def generator1():
},
}

dataset1.add(generator1())
dataset1.make_splits({"train": 0.6, "val": 0.4})
dataset.add(generator1())
dataset.make_splits({"train": 0.6, "val": 0.4})

cloned_dataset1 = dataset1.clone(
new_dataset_name=dataset1_name + "_cloned"
)
cloned_dataset = dataset.clone(new_dataset_name=dataset_name + "_cloned")

assert cloned_dataset1.get_splits() == dataset1.get_splits()
assert cloned_dataset1.get_classes() == dataset1.get_classes()
assert cloned_dataset1.get_task_names() == dataset1.get_task_names()
assert cloned_dataset1.get_skeletons() == dataset1.get_skeletons()
assert cloned_dataset.get_splits() == dataset.get_splits()
assert cloned_dataset.get_classes() == dataset.get_classes()
assert cloned_dataset.get_task_names() == dataset.get_task_names()
assert cloned_dataset.get_skeletons() == dataset.get_skeletons()

df_cloned = cloned_dataset1._load_df_offline()
df_original = dataset1._load_df_offline()
df_cloned = cloned_dataset._load_df_offline()
df_original = dataset._load_df_offline()
assert df_cloned.equals(df_original)


def test_merge_datasets(tempdir: Path, bucket_storage: BucketStorage):
dataset1_name = "test_merge_1"
def test_merge_datasets(
bucket_storage: BucketStorage, dataset_name: str, tempdir: Path
):
dataset1_name = dataset_name + "_1"
dataset1 = LuxonisDataset(
dataset1_name,
bucket_storage=bucket_storage,
Expand All @@ -550,7 +551,7 @@ def generator1():
dataset1.add(generator1())
dataset1.make_splits({"train": 0.6, "val": 0.4})

dataset2_name = "test_merge_2"
dataset2_name = dataset_name + "_2"
dataset2 = LuxonisDataset(
dataset2_name,
bucket_storage=bucket_storage,
Expand Down

0 comments on commit 490a890

Please sign in to comment.