itwinai.tests

dummy_components

class itwinai.tests.dummy_components.FakeGetter(data_uri: str, name: str | None = None)[source]

Bases: BaseComponent

execute()[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeGetterExec(data_uri: str, name: str | None = None)[source]

Bases: FakeGetter

result: str = 'dataset'
execute()[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeSplitter(train_prop: float, name: str | None = None)[source]

Bases: BaseComponent

execute()[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeSplitterExec(train_prop: float, name: str | None = None)[source]

Bases: FakeSplitter

result: tuple = ('train_dataset', 'val_dataset', 'test_dataset')
execute(dataset)[source]

Execute some operations.

class itwinai.tests.dummy_components.FakePreproc(max_items: int, name: str | None = None)[source]

Bases: BaseComponent

execute()[source]

Execute some operations.

class itwinai.tests.dummy_components.FakePreprocExec(max_items: int, name: str | None = None)[source]

Bases: FakePreproc

execute(train_dataset, val_dataset, test_dataset)[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeTrainer(lr: float, batch_size: int, name: str | None = None)[source]

Bases: BaseComponent

execute()[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeTrainerExec(lr: float, batch_size: int, name: str | None = None)[source]

Bases: FakeTrainer

model: str = 'trained_model'
execute(train_dataset, val_dataset, test_dataset)[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeSaver(save_path: str, name: str | None = None)[source]

Bases: BaseComponent

execute()[source]

Execute some operations.

class itwinai.tests.dummy_components.FakeSaverExec(save_path: str, name: str | None = None)[source]

Bases: FakeSaver

execute(artifact)[source]

Execute some operations.

exceptions

Custom exceptions raised during sanity checks for itwinai.

exception itwinai.tests.exceptions.SanityCheckError[source]

Bases: Exception

Base exception for all sanity check errors.

sanity_check

itwinai.tests.sanity_check.run_sanity_check(modules: List[str])[source]

Run sanity checks by trying to import modules.

Parameters:

modules (List[str]) – list of modules

Raises:

SanityCheckError – when some module cannot be imported.

itwinai.tests.sanity_check.sanity_check_slim()[source]

Run sanity check on the installation of core modules of itwinai (neither itwinai.torch, nor itwinai.tensorflow).

itwinai.tests.sanity_check.sanity_check_torch()[source]

Run sanity check on the installation of itwinai for a torch environment.

itwinai.tests.sanity_check.sanity_check_tensorflow()[source]

Run sanity check on the installation of itwinai for a tensorflow environment.

itwinai.tests.sanity_check.sanity_check_all()[source]

Run all sanity checks.