Skip to content

Commit 1482e7c

Browse files
Conchylicultorcopybara-github
authored andcommitted
Update doc
PiperOrigin-RevId: 257068093
1 parent 974ca3c commit 1482e7c

File tree

2 files changed

+352
-173
lines changed

2 files changed

+352
-173
lines changed

docs/api_docs/python/tfds/testing/DatasetBuilderTestCase.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -159,33 +159,43 @@ Defined in [`testing/dataset_builder_testing.py`](https://github.com/tensorflow/
159159
<!-- Placeholder for "Used in" -->
160160

161161
You must set the following class attributes:
162-
DATASET_CLASS: class object of DatasetBuilder you want to test.
163-
164-
You may set the following class attributes: VERSION: `str`. The version used to
165-
run the test. eg: '1.2.*'. Defaults to None (canonical version).
166-
BUILDER_CONFIG_NAMES_TO_TEST: `list[str]`, the list of builder configs that
167-
should be tested. If None, all the BUILDER_CONFIGS from the class will be
168-
tested. DL_EXTRACT_RESULT: `dict[str]`, the returned result of mocked
169-
`download_and_extract` method. The values should be the path of files present in
170-
the `fake_examples` directory, relative to that directory. If not specified,
171-
path to `fake_examples` will always be returned. EXAMPLE_DIR: `str`, the base
172-
directory in in which fake examples are contained. Optional; defaults to
173-
tensorflow_datasets/testing/test_data/fake_examples/<dataset name>.
174-
OVERLAPPING_SPLITS: `list[str]`, splits containing examples from other splits
175-
(e.g. a "example" split containing pictures from other splits).
176-
MOCK_OUT_FORBIDDEN_OS_FUNCTIONS: `bool`, defaults to True. Set to False to
177-
disable checks preventing usage of `os` or builtin functions instead of
178-
recommended `tf.io.gfile` API.
179-
180-
This test case will check for the following: - the dataset builder is correctly
181-
registered, i.e. <a href="../../tfds/load.md"><code>tfds.load(name)</code></a>
182-
works; - the dataset builder can read the fake examples stored in
183-
testing/test_data/fake_examples/${dataset_name}; - the dataset builder can
184-
produce serialized data; - the dataset builder produces a valid Dataset object
185-
from serialized data - in eager mode; - in graph mode. - the produced Dataset
186-
examples have the expected dimensions and types; - the produced Dataset has and
187-
the expected number of examples; - a example is not part of two splits, or one
188-
of these splits is whitelisted in OVERLAPPING_SPLITS.
162+
163+
* DATASET_CLASS: class object of DatasetBuilder you want to test.
164+
165+
You may set the following class attributes:
166+
167+
* VERSION: `str`. The version used to run the test. eg: '1.2.*'. Defaults to
168+
None (canonical version).
169+
* BUILDER_CONFIG_NAMES_TO_TEST: `list[str]`, the list of builder configs that
170+
should be tested. If None, all the BUILDER_CONFIGS from the class will be
171+
tested.
172+
* DL_EXTRACT_RESULT: `dict[str]`, the returned result of mocked
173+
`download_and_extract` method. The values should be the path of files
174+
present in the `fake_examples` directory, relative to that directory. If not
175+
specified, path to `fake_examples` will always be returned.
176+
* EXAMPLE_DIR: `str`, the base directory in in which fake examples are
177+
contained. Optional; defaults to
178+
tensorflow_datasets/testing/test_data/fake_examples/<dataset name>.
179+
* OVERLAPPING_SPLITS: `list[str]`, splits containing examples from other
180+
splits (e.g. a "example" split containing pictures from other splits).
181+
* MOCK_OUT_FORBIDDEN_OS_FUNCTIONS: `bool`, defaults to True. Set to False to
182+
disable checks preventing usage of `os` or builtin functions instead of
183+
recommended `tf.io.gfile` API.
184+
185+
This test case will check for the following:
186+
187+
- the dataset builder is correctly registered, i.e.
188+
<a href="../../tfds/load.md"><code>tfds.load(name)</code></a> works;
189+
- the dataset builder can read the fake examples stored in
190+
testing/test_data/fake_examples/${dataset_name};
191+
- the dataset builder can produce serialized data;
192+
- the dataset builder produces a valid Dataset object from serialized data
193+
- in eager mode;
194+
- in graph mode.
195+
- the produced Dataset examples have the expected dimensions and types;
196+
- the produced Dataset has and the expected number of examples;
197+
- a example is not part of two splits, or one of these splits is whitelisted
198+
in OVERLAPPING_SPLITS.
189199

190200
<h2 id="__init__"><code>__init__</code></h2>
191201

0 commit comments

Comments
 (0)