()
| 4581 | |
| 4582 | |
| 4583 | def test_dataset_estimate_nbytes(): |
| 4584 | ds = Dataset.from_dict({"a": ["0" * 100] * 100}) |
| 4585 | assert 0.9 * ds._estimate_nbytes() < 100 * 100, "must be smaller than full dataset size" |
| 4586 | |
| 4587 | ds = Dataset.from_dict({"a": ["0" * 100] * 100}).select([0]) |
| 4588 | assert 0.9 * ds._estimate_nbytes() < 100 * 100, "must be smaller than one chunk" |
| 4589 | |
| 4590 | ds = Dataset.from_dict({"a": ["0" * 100] * 100}) |
| 4591 | ds = concatenate_datasets([ds] * 100) |
| 4592 | assert 0.9 * ds._estimate_nbytes() < 100 * 100 * 100, "must be smaller than full dataset size" |
| 4593 | assert 1.1 * ds._estimate_nbytes() > 100 * 100 * 100, "must be bigger than full dataset size" |
| 4594 | |
| 4595 | ds = Dataset.from_dict({"a": ["0" * 100] * 100}) |
| 4596 | ds = concatenate_datasets([ds] * 100).select([0]) |
| 4597 | assert 0.9 * ds._estimate_nbytes() < 100 * 100, "must be smaller than one chunk" |
| 4598 | |
| 4599 | |
| 4600 | def test_dataset_to_iterable_dataset(dataset: Dataset): |
nothing calls this directly
no test coverage detected