reda.testing package

Testing utilities

reda.testing.test(target=None, show=False, onlydoctests=False, abort=False, verbose=True)[source]

Run docstring examples and additional tests.

Parameters:
targetfunction or string, optional

Function or method to test. By default everything is tested.

showboolean, optional

Show matplotlib windows during test run. They will be closed automatically.

onlydoctestsboolean, optional

Run test files in ../tests as well.

abortboolean, optional

Return correct exit code, e.g. abort documentation build when a test fails.

Subpackages

Submodules

reda.testing.containers module

Dummy data containers for testing purposes.

reda.testing.containers.get_simple_ert_container_nor()[source]
reda.testing.containers.get_simple_ert_container_norrec()[source]

reda.testing.fzj_readbin module

reda.testing.fzj_readbin.test_find_swapped_measurement_indices()[source]

reda.testing.test_container_ert module

Container tests for the ERT container

# Missing test cases

  • Add data with and without electrode positions

  • Add data with and without timesteps (i.e., import multiple data for one time step, or for multiple ones)

  • How to proceed if electrode positions were already imported, but a newly added dataset does not provide electrode coordinates? -> throw an error if there are any electrode numbers to accounted for yet -> make sure the documentation knows how to add electrode numbers

  • test the verbose switch. Is this the same as debugging?

  • How to test the journal?

  • Check the initialization with a dataframe (or better: try to initialize with something else and check for the exception)

reda.testing.test_container_ert.test_bad_init()[source]
reda.testing.test_container_ert.test_init()[source]

test initializing an empty ERT container

reda.testing.test_container_ert.test_init_with_data()[source]

test initializing an ERT container and provide good data

reda.testing.test_container_ert.test_merge_norrec_1()[source]
reda.testing.test_container_ert.test_merge_norrec_2()[source]

reda.testing.test_container_seit module

reda.testing.test_container_seit.load_data_into_container(datadir)[source]
reda.testing.test_container_seit.prepare_4d_data()[source]

Unzip included 4D data into a temp directory.

Returns:
tempdirstring

Temporary directory

reda.testing.test_container_seit.test_check_4d_data()[source]
reda.testing.test_container_seit.test_histogram_plotting()[source]
reda.testing.test_container_seit.test_load_4d_data()[source]

reda.testing.test_crtomo_import module

Test reda.importers.crtomo functionality

reda.testing.test_crtomo_import.test_load_complex_data()[source]
reda.testing.test_crtomo_import.test_load_resistance_data()[source]

reda.testing.test_electrode_manager module

reda.testing.test_electrode_manager.test_add_positions()[source]
reda.testing.test_electrode_manager.test_bad_input()[source]
reda.testing.test_electrode_manager.test_callable_class()[source]
reda.testing.test_electrode_manager.test_conform_to_regular_x_spacing()[source]
reda.testing.test_electrode_manager.test_conform_to_regular_x_spacing_exception()[source]
reda.testing.test_electrode_manager.test_duplicates()[source]
reda.testing.test_electrode_manager.test_electrode_numbers()[source]
reda.testing.test_electrode_manager.test_fixed_assignments()[source]
reda.testing.test_electrode_manager.test_get_electrode_numbers_for_positions()[source]
reda.testing.test_electrode_manager.test_get_electrode_position()[source]
reda.testing.test_electrode_manager.test_merging()[source]
reda.testing.test_electrode_manager.test_merging2()[source]
reda.testing.test_electrode_manager.test_number_assignment()[source]
reda.testing.test_electrode_manager.test_reflect_on_x()[source]
reda.testing.test_electrode_manager.test_replace_coordinates_with_fixed_regular_grid_x()[source]
reda.testing.test_electrode_manager.test_replace_one_coordinate()[source]
reda.testing.test_electrode_manager.test_shift_positions_by_xyz()[source]
reda.testing.test_electrode_manager.test_simple_ordering_2d()[source]
reda.testing.test_electrode_manager.test_simple_ordering_3d()[source]
reda.testing.test_electrode_manager.test_sorters()[source]
reda.testing.test_electrode_manager.test_user_supplied_sorter()[source]