def test_blank_str_3(): expected = [ "Dataset", '----------', 'Parameters', '----------', 'Datapoints: 199', 'Predicted domain: frequency', 'Range: from 0.000 to 1.000 PHz', 'Normalized: True', 'Delay value: 100 fs', 'SPP position(s): 0.5 PHz', '----------------------------', 'Metadata extracted from file', '----------------------------', '{}' ] x_ = np.linspace(0, 1, 199) d = Dataset(x_, x_) d.delay = 100 d.positions = 0.5 with setting("precision", 3): string = d.__str__().split("\n") assert string == expected
def test_SPP_position_setter_invalid_single(): ifg = Dataset(np.arange(1, 1000, 1), np.sin(np.arange(1, 1000, 1))) with pytest.raises(ValueError): ifg.positions = -2000
def test_SPP_position_setter_valid_options(pos): ifg = Dataset(np.arange(1, 1000, 1), np.sin(np.arange(1, 1000, 1))) ifg.positions = pos