ewoksxas.converters.tests.test_larch#

Tests for the Larch group converters.

Functions

test_1d_x_and_1d_y()

Test that matching 1D x and y produce a single group.

test_1d_x_and_2d_y_shared_axis()

Test that a 1D x is shared across all rows of a 2D y.

test_2d_x_and_2d_y_paired()

Test that matching 2D x and y are paired row by row.

test_energy_ev_not_converted()

Test that energy values already in eV are left unchanged.

test_energy_kev_converted_to_ev()

Test that energy values in keV are detected and converted to eV.

test_energy_kev_descending_converted_to_ev()

Test that a descending energy array in keV is correctly detected.

test_energy_length_1_no_warning()

Test that an energy array of length 1 doesn't raise a warning/error.

test_get_attribute_values_multiple_attributes()

Test extracting several attributes from multiple groups at once.

test_get_attribute_values_single_attribute()

Test extracting one attribute from multiple groups.

test_get_attribute_values_single_group()

Test extracting attributes from a list with just one group.

test_get_attribute_values_string_attribute()

Test that a bare string is accepted as the attributes argument.

test_invalid_mode_raises()

Test that an unknown mode raises ValueError.

test_kwargs_forwarded_to_groups()

Test that extra kwargs are forwarded to every group.

test_mode_energy_attribute_names()

Test that mode 'energy' writes energy and mu attributes.

test_mode_r_attribute_names()

Test that mode 'r' writes r and chir attributes.

test_non_array_x_raises()

Test that a non-NumPy x raises TypeError.

test_non_array_y_raises()

Test that a non-NumPy y raises TypeError.

test_shape_mismatch_1d_1d_raises()

Test that mismatched 1D shapes raise ValueError.

test_shape_mismatch_1d_2d_raises()

Test that a 1D x incompatible with the 2D y columns raises ValueError.

test_shape_mismatch_2d_2d_raises()

Test that mismatched 2D shapes raise ValueError.