Skip to content

Commit

Permalink
different tolerance per systme
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed Nov 22, 2024
1 parent a0a9801 commit 5c6126b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python_installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
shell: bash -l {0}
run: |
conda activate test
pytest --pyargs --mpl validphys n3fit
pytest --pyargs --mpl validphys n3fit --mpl-default-tolerance 18
5 changes: 3 additions & 2 deletions conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ set -u
set -v
set -e

#Python tests for the installed validphys package
pytest --pyargs --mpl validphys
# Python tests for the installed validphys package
# Note that the default tolerance in the conda test is higher than the pip test
pytest --pyargs --mpl validphys --mpl-default-tolerance 22

platformstr=`uname`

Expand Down
16 changes: 8 additions & 8 deletions validphys2/src/validphys/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plotpdfs():
pdfs = [PDF]
Q = 10
Expand All @@ -22,7 +22,7 @@ def test_plotpdfs():


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_dataspecschi2():
dsinpts = [
{'dataset': 'NMC_NC_NOTFIXED_P_EM-SIGMARED', 'variant': 'legacy'},
Expand All @@ -42,7 +42,7 @@ def test_dataspecschi2():


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plotfancy():
fig = API.plot_fancy(dataset_input=DATA[2], theoryid=THEORYID, pdfs=[PDF], use_cuts='internal')[
0
Expand All @@ -52,26 +52,26 @@ def test_plotfancy():


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plot_smpdf(single_data_internal_cuts_config):
return next(iter(API.plot_smpdf(**single_data_internal_cuts_config)))


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plot_smpdf_categorical(single_data_categorical_internal_cuts_config):
return next(iter(API.plot_smpdf(**single_data_categorical_internal_cuts_config)))


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plot_obscorrs(single_data_internal_cuts_config):
corrpair = [{"corrpair": (i["dataset"],)} for i in DATA[:2]]
return API.plot_obscorrs(**single_data_internal_cuts_config, corrpair=corrpair)


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plot_xq2():
theoryid = THEORYID
use_cuts = "nocuts"
Expand All @@ -95,7 +95,7 @@ def test_plot_xq2():


@pytest.mark.linux
@pytest.mark.mpl_image_compare(tolerance=TOLERANCE_VALUE)
@pytest.mark.mpl_image_compare()
def test_plot_xq2_custom():
theoryid = THEORYID
use_cuts = "nocuts"
Expand Down

0 comments on commit 5c6126b

Please sign in to comment.