Skip to content

Commit 7312de7

Browse files
fineguyThe TensorFlow Datasets Authors
authored and
The TensorFlow Datasets Authors
committed
Move checksums.tsv to constants.CHECKSUMS_FILENAME
PiperOrigin-RevId: 669319279
1 parent caa4485 commit 7312de7

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

tensorflow_datasets/core/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
DATASET_INFO_FILENAME = 'dataset_info.json'
4545
LICENSE_FILENAME = 'LICENSE'
4646
METADATA_FILENAME = 'metadata.json'
47+
CHECKSUMS_FILENAME = 'checksums.tsv'
4748

4849
# Filepath for mapping between TFDS datasets and PapersWithCode entries.
4950
PWC_FILENAME = 'tfds_to_pwc_links.json'

tensorflow_datasets/core/dataset_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def _checksums_path(cls) -> Optional[epath.Path]:
445445
# * To save the checksums (in DownloadManager)
446446
if not cls.code_path:
447447
return None
448-
new_path = cls.code_path.parent / "checksums.tsv"
448+
new_path = cls.code_path.parent / constants.CHECKSUMS_FILENAME
449449
# Checksums of legacy datasets are located in a separate dir.
450450
legacy_path = utils.tfds_path() / "url_checksums" / f"{cls.name}.txt"
451451
if (

tensorflow_datasets/core/download/checksums_test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717

1818
import hashlib
1919
import pathlib
20+
from tensorflow_datasets.core import constants
2021
from tensorflow_datasets.core import utils
2122
from tensorflow_datasets.core.download import checksums
2223

2324

2425
def test_checksums(tmp_path: pathlib.Path):
25-
path = tmp_path / 'checksums.tsv'
26+
path = tmp_path / constants.CHECKSUMS_FILENAME
2627
url_infos = {
2728
'http://abc.org/data': checksums.UrlInfo(
2829
checksum='abcd',

tensorflow_datasets/scripts/cli/new.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def _create_dummy_data(info: utils.DatasetInfo) -> None:
211211

212212

213213
def _create_checksum(info: utils.DatasetInfo) -> None:
214-
"""Adds the `checksums.tsv` file."""
215-
file_path = info.path / 'checksums.tsv'
214+
"""Adds the checksum file."""
215+
file_path = info.path / constants.CHECKSUMS_FILENAME
216216
content = textwrap.dedent(f"""\
217217
# {info.todo}: If your dataset downloads files, then the checksums
218218
# will be automatically added here when running

0 commit comments

Comments
 (0)