Skip to content

Commit

Permalink
change rtol to atol with smaller values
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahima-Islam committed Feb 17, 2020
1 parent 43285e0 commit b5fab7e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/unit/test_peak_fit_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def test_calculate_effective_parameters_pv():
PeakInfo = namedtuple('PeakInfo', 'center left_bound right_bound tag')


@pytest.mark.parametrize('target_values', [{'Intensity': [0.4, 0.3], 'peak_center': [91, 95], 'FWHM': [7.76, 7.76],
@pytest.mark.parametrize('target_values', [{'Intensity': [0.0, 0.0], 'peak_center': [90, 96], 'FWHM': [0, 0],
'background_A0': [-0.04, 0.42], 'background_A1': [0.007, -0.003]}])
def test_pseudovoigt_HB2B_1060(target_values):
"""This is a test of Pseudovoigt peak fitting for HB2B 1060.
Expand Down Expand Up @@ -765,15 +765,15 @@ def test_pseudovoigt_HB2B_1060(target_values):
assert param_values_rp.size == 3, '3 subruns'
assert len(param_values_rp.dtype.names) == 6, '6 native parameters'

np.testing.assert_allclose(param_values_lp['Intensity'], target_values['Intensity'][0], rtol=1.)
np.testing.assert_allclose(param_values_lp['PeakCentre'], target_values['peak_center'][0], rtol=1.)
np.testing.assert_allclose(param_values_lp['FWHM'], target_values['FWHM'][0], rtol=1.)
np.testing.assert_allclose(param_values_lp['Intensity'], target_values['Intensity'][0], atol=0.01)
np.testing.assert_allclose(param_values_lp['PeakCentre'], target_values['peak_center'][0], atol=0.8)
np.testing.assert_allclose(param_values_lp['FWHM'], target_values['FWHM'][0], atol=1.)
np.testing.assert_allclose(param_values_lp['A0'], target_values['background_A0'][0], rtol=1.)
np.testing.assert_allclose(param_values_lp['A1'], target_values['background_A1'][0], rtol=1.)

np.testing.assert_allclose(param_values_rp['Intensity'], target_values['Intensity'][1], rtol=1.)
np.testing.assert_allclose(param_values_rp['PeakCentre'], target_values['peak_center'][1], rtol=1.)
np.testing.assert_allclose(param_values_rp['FWHM'], target_values['FWHM'][1], rtol=1.)
np.testing.assert_allclose(param_values_rp['Intensity'], target_values['Intensity'][1], atol=0.01)
np.testing.assert_allclose(param_values_rp['PeakCentre'], target_values['peak_center'][1], atol=1)
np.testing.assert_allclose(param_values_rp['FWHM'], target_values['FWHM'][1], atol=1.)
np.testing.assert_allclose(param_values_rp['A0'], target_values['background_A0'][1], rtol=1.)
np.testing.assert_allclose(param_values_rp['A1'], target_values['background_A1'][1], rtol=1.)

Expand Down

0 comments on commit b5fab7e

Please sign in to comment.