pytoda.datasets.tests.test_base_dataset module

Testing basic ways to setup a dataset.

Summary

Classes:

Delegating

NOT implementing methods (and only built-ins from inheritance).

Indexed

As DataFrameDataset but only implementing necessary methods.

TestBaseDatasets

Testing dataset for base methods.

Reference

class Indexed(df)[source]

Bases: Generic[torch.utils.data.dataset.T_co]

As DataFrameDataset but only implementing necessary methods.

get_key(index)[source]

Get key from integer index.

Return type

Hashable

get_index(key)[source]

Get index for first datum mapping to the given key.

Return type

int

class Delegating(data)[source]

Bases: Generic[torch.utils.data.dataset.T_co]

NOT implementing methods (and only built-ins from inheritance).

class TestBaseDatasets(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing dataset for base methods.

length = 11
dims = 5
random_data(length, dims)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

assertListedEqual(listable1, listable2)[source]

Easier comparison between arrays, series and or lists.

test_delegation_dir()[source]
test___len__()[source]

Test __len__.

Return type

None

test___getitem__()[source]

Test __getitem__.

Return type

None

test__getitem__mutating_utils()[source]
test_data_loader()[source]

Test data_loader.

Return type

None

test_all_base_for_indexed_methods_and_copy()[source]