Datasets:

Languages:
Japanese
License:
File size: 1,330 Bytes
fb189c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os

import datasets as ds
import pytest


@pytest.fixture
def dataset_path() -> str:
    return "CAMERA.py"


def test_load_dataset_without_lp_images(
    dataset_path: str,
    expected_train_num_rows: int = 12395,
    expected_val_num_rows: int = 3098,
    expected_test_num_rows: int = 872,
):
    dataset = ds.load_dataset(path=dataset_path, name="without-lp-images")

    assert dataset["train"].num_rows == expected_train_num_rows  # type: ignore
    assert dataset["validation"].num_rows == expected_val_num_rows  # type: ignore
    assert dataset["test"].num_rows == expected_test_num_rows  # type: ignore


@pytest.mark.skipif(
    bool(os.environ.get("CI", False)),
    reason="Because this test downloads a large data set, we will skip running it on CI.",
)
def test_load_dataset_with_lp_images(
    dataset_path: str,
    expected_train_num_rows: int = 12395,
    expected_val_num_rows: int = 3098,
    expected_test_num_rows: int = 872,
):
    dataset = ds.load_dataset(path=dataset_path, name="with-lp-images")

    assert dataset["train"].num_rows == expected_train_num_rows  # type: ignore
    assert dataset["validation"].num_rows == expected_val_num_rows  # type: ignore
    assert dataset["test"].num_rows == expected_test_num_rows  # type: ignore

    assert "lp_image" in dataset["train"].column_names