|
import datasets |
|
from datasets import DatasetInfo, DownloadManager |
|
|
|
from NASA_OSDR import NasaOsdr |
|
|
|
|
|
def test_inherit_generator_base_builder_works(): |
|
class Child(datasets.GeneratorBasedBuilder): |
|
BUILDER_CONFIGS = [ |
|
datasets.BuilderConfig( |
|
name="some dataset", |
|
version=datasets.Version("1.0.0"), |
|
description="some description", |
|
) |
|
] |
|
|
|
DEFAULT_CONFIG_NAME = "some dataset" |
|
|
|
def _info(self) -> DatasetInfo: |
|
return datasets.DatasetInfo( |
|
description="""dadada """, |
|
features=None, |
|
supervised_keys=None, |
|
homepage="dada", |
|
license="dada", |
|
citation="dsada", |
|
) |
|
|
|
child = Child() |
|
|
|
assert child |
|
|
|
|
|
def test_generate_examples(): |
|
dataset = NasaOsdr() |
|
train_data = dataset._generate_examples(assays_file='data/assays.csv', samples_file='data/samples.csv') |
|
idx, sample = next(iter(train_data)) |
|
print(idx, sample.keys()) |
|
|
|
|
|
def test_load_dataset(): |
|
from datasets import load_dataset |
|
dataset = load_dataset("nasa_osdr.py") |
|
print(len(dataset["train"])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|