Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
Danish
Size:
10M - 100M
ArXiv:
DOI:
License:
Kenneth Enevoldsen
commited on
Added test to ensure that main readme contains all datasets
Browse files- src/tests/test_load.py +14 -7
src/tests/test_load.py
CHANGED
|
@@ -2,6 +2,8 @@ from pathlib import Path
|
|
| 2 |
|
| 3 |
from datasets import load_dataset
|
| 4 |
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def test_dataset_loads(repo_path: Path):
|
| 7 |
"""Ensures that the dataset can load as intended"""
|
|
@@ -11,12 +13,17 @@ def test_dataset_loads(repo_path: Path):
|
|
| 11 |
assert isinstance(sample, dict)
|
| 12 |
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
|
|
|
| 2 |
|
| 3 |
from datasets import load_dataset
|
| 4 |
|
| 5 |
+
from tests.readme_parsing import read_frontmatter_and_body
|
| 6 |
+
|
| 7 |
|
| 8 |
def test_dataset_loads(repo_path: Path):
|
| 9 |
"""Ensures that the dataset can load as intended"""
|
|
|
|
| 13 |
assert isinstance(sample, dict)
|
| 14 |
|
| 15 |
|
| 16 |
+
def test_all_datasets_in_yaml(repo_path: Path):
|
| 17 |
+
frontmatter, _ = read_frontmatter_and_body(repo_path / "README.md")
|
| 18 |
+
|
| 19 |
+
ds_names = {
|
| 20 |
+
cfg["config_name"]
|
| 21 |
+
for cfg in frontmatter["configs"]
|
| 22 |
+
if cfg["config_name"] != "default"
|
| 23 |
+
}
|
| 24 |
|
| 25 |
+
data_folder = repo_path / "data"
|
| 26 |
+
datasets = data_folder.glob("*")
|
| 27 |
|
| 28 |
+
for dataset in datasets:
|
| 29 |
+
assert dataset.name in ds_names
|