plothist 1.3.2__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plothist-1.3.2 → plothist-1.5.0}/.github/dependabot.yaml +1 -1
- {plothist-1.3.2 → plothist-1.5.0}/.github/workflows/cd.yaml +1 -1
- {plothist-1.3.2 → plothist-1.5.0}/.github/workflows/ci.yaml +12 -3
- plothist-1.5.0/.github/workflows/coverage.yaml +32 -0
- {plothist-1.3.2 → plothist-1.5.0}/.gitignore +8 -0
- plothist-1.5.0/.pre-commit-config.yaml +78 -0
- plothist-1.5.0/.readthedocs.yaml +16 -0
- {plothist-1.3.2 → plothist-1.5.0}/LICENSE +1 -1
- {plothist-1.3.2 → plothist-1.5.0}/PKG-INFO +20 -12
- {plothist-1.3.2 → plothist-1.5.0}/README.rst +18 -7
- plothist-1.5.0/codecov.yml +6 -0
- plothist-1.5.0/docs/CONTRIBUTING.rst +79 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/advanced/model_examples.rst +22 -22
- {plothist-1.3.2 → plothist-1.5.0}/docs/advanced/other_advanced.rst +9 -9
- {plothist-1.3.2 → plothist-1.5.0}/docs/basics/1d_func.rst +6 -6
- {plothist-1.3.2 → plothist-1.5.0}/docs/basics/1d_hist.rst +34 -34
- {plothist-1.3.2 → plothist-1.5.0}/docs/basics/2d_hist.rst +13 -13
- {plothist-1.3.2 → plothist-1.5.0}/docs/conf.py +20 -21
- plothist-1.3.2/docs/usage/font_installation.rst → plothist-1.5.0/docs/documentation/troubleshooting.rst +9 -50
- plothist-1.5.0/docs/img/1d_comparison_advanced.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_asymmetry.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_difference.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_efficiency.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_only_efficiency.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_pull.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_ratio.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_relative_difference.png +0 -0
- plothist-1.5.0/docs/img/1d_comparison_split_ratio.png +0 -0
- plothist-1.5.0/docs/img/1d_elt1.png +0 -0
- plothist-1.5.0/docs/img/1d_elt1_stacked.png +0 -0
- plothist-1.5.0/docs/img/1d_elt2.png +0 -0
- plothist-1.5.0/docs/img/1d_hist_simple.png +0 -0
- plothist-1.5.0/docs/img/1d_int_category.png +0 -0
- plothist-1.5.0/docs/img/1d_profile.png +0 -0
- plothist-1.5.0/docs/img/1d_side_by_side.png +0 -0
- plothist-1.5.0/docs/img/1d_side_by_side_with_numbers.png +0 -0
- plothist-1.5.0/docs/img/1d_str_category.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_correlations_0.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_correlations_1.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_correlations_2.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_simple.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_simple_discrete_colormap.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_uneven.png +0 -0
- plothist-1.5.0/docs/img/2d_hist_with_projections.png +0 -0
- plothist-1.5.0/docs/img/add_text_example.png +0 -0
- plothist-1.5.0/docs/img/asymmetry_comparison_advanced.png +0 -0
- plothist-1.5.0/docs/img/color_palette_hists.png +0 -0
- plothist-1.5.0/docs/img/fct_1d.png +0 -0
- plothist-1.5.0/docs/img/fct_1d_stacked.png +0 -0
- plothist-1.5.0/docs/img/matplotlib_example.png +0 -0
- plothist-1.5.0/docs/img/model_all_comparisons.png +0 -0
- plothist-1.5.0/docs/img/model_all_comparisons_no_model_unc.png +0 -0
- plothist-1.5.0/docs/img/model_examples_flatten2D.png +0 -0
- plothist-1.5.0/docs/img/model_examples_pull.png +0 -0
- plothist-1.5.0/docs/img/model_examples_pull_no_model_unc.png +0 -0
- plothist-1.5.0/docs/img/model_examples_stacked.png +0 -0
- plothist-1.5.0/docs/img/model_examples_stacked_unstacked.png +0 -0
- plothist-1.5.0/docs/img/model_examples_unstacked.png +0 -0
- plothist-1.5.0/docs/img/model_with_stacked_and_unstacked_function_components.png +0 -0
- plothist-1.5.0/docs/img/model_with_stacked_and_unstacked_histograms_components.png +0 -0
- plothist-1.5.0/docs/img/plothist_example.png +0 -0
- plothist-1.5.0/docs/img/ratio_data_vs_model_with_stacked_and_unstacked_function_components.png +0 -0
- plothist-1.5.0/docs/img/usage_YlGnBu_r_palette.png +0 -0
- plothist-1.5.0/docs/img/usage_coolwarm_palette.png +0 -0
- plothist-1.5.0/docs/img/usage_cubehelix.png +0 -0
- plothist-1.5.0/docs/img/usage_style_cycle.png +0 -0
- plothist-1.5.0/docs/img/usage_viridis_palette.png +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/index.rst +2 -2
- {plothist-1.3.2 → plothist-1.5.0}/docs/usage/installation.rst +2 -6
- {plothist-1.3.2 → plothist-1.5.0}/docs/usage/plot_fitting_results.rst +1 -1
- {plothist-1.3.2 → plothist-1.5.0}/docs/usage/style.rst +8 -8
- {plothist-1.3.2 → plothist-1.5.0}/docs/usage/utilities.rst +3 -3
- plothist-1.5.0/noxfile.py +97 -0
- plothist-1.5.0/pyproject.toml +89 -0
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/__init__.py +66 -74
- plothist-1.5.0/src/plothist/_version.py +21 -0
- plothist-1.5.0/src/plothist/_version.pyi +2 -0
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/comparison.py +115 -106
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_asymmetry.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_difference.py +5 -5
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_efficiency.py +3 -3
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_only_efficiency.py +2 -1
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_pull.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_ratio.py +2 -2
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_relative_difference.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_comparison_split_ratio.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_elt1.py +4 -3
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_elt1_stacked.py +11 -10
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_elt2.py +3 -2
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_hist_simple.py +3 -2
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_int_category.py +2 -1
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_profile.py +2 -1
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_side_by_side.py +2 -1
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/1d_str_category.py +2 -1
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/2d_hist/2d_hist_correlations.py +27 -10
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/2d_hist/2d_hist_simple.py +2 -3
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/2d_hist/2d_hist_simple_discrete_colormap.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/2d_hist/2d_hist_uneven.py +1 -2
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/2d_hist/2d_hist_with_projections.py +2 -2
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/advanced/1d_comparison_advanced.py +6 -6
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/advanced/1d_side_by_side_with_numbers.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/advanced/asymmetry_comparison_advanced.py +12 -8
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/advanced/model_examples_flatten2D.py +12 -42
- plothist-1.3.2/docs/examples/1d_func/1d_fct.py → plothist-1.5.0/src/plothist/examples/func_1d/fct_1d.py +5 -4
- plothist-1.3.2/docs/examples/1d_func/1d_fct_stacked.py → plothist-1.5.0/src/plothist/examples/func_1d/fct_1d_stacked.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_all_comparisons.py +10 -13
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_all_comparisons_no_model_unc.py +12 -14
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_examples_pull.py +4 -8
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_examples_pull_no_model_unc.py +6 -10
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_examples_stacked.py +4 -4
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_examples_stacked_unstacked.py +3 -7
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_examples_unstacked.py +4 -8
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_with_stacked_and_unstacked_function_components.py +2 -10
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/model_with_stacked_and_unstacked_histograms_components.py +6 -5
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/ratio_data_vs_model_with_stacked_and_unstacked_function_components.py +3 -3
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/utility/add_text_example.py +7 -14
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/utility/color_palette_hists.py +7 -6
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/utility/color_palette_squares.py +13 -9
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/utility/matplotlib_vs_plothist_style.py +9 -3
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/histogramming.py +77 -48
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/plothist_style.py +61 -62
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/plotters.py +280 -233
- plothist-1.5.0/src/plothist/test_helpers.py +43 -0
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/variable_registry.py +62 -43
- plothist-1.5.0/tests/test_boost_histogram_version.py +16 -0
- plothist-1.5.0/tests/test_comparison.py +37 -0
- plothist-1.3.2/tests/test_asymmetry.py → plothist-1.5.0/tests/test_comparison_asymmetry.py +31 -10
- plothist-1.3.2/tests/test_difference.py → plothist-1.5.0/tests/test_comparison_difference.py +21 -18
- plothist-1.3.2/tests/test_efficiency.py → plothist-1.5.0/tests/test_comparison_efficiency.py +59 -24
- plothist-1.3.2/tests/test_pull.py → plothist-1.5.0/tests/test_comparison_pull.py +21 -18
- plothist-1.3.2/tests/test_ratio.py → plothist-1.5.0/tests/test_comparison_ratio.py +49 -32
- plothist-1.5.0/tests/test_examples_1d_hist.py +39 -0
- plothist-1.5.0/tests/test_examples_2d_hist.py +66 -0
- plothist-1.5.0/tests/test_examples_advanced.py +39 -0
- plothist-1.5.0/tests/test_examples_data_model.py +39 -0
- plothist-1.5.0/tests/test_examples_func_1d.py +39 -0
- plothist-1.5.0/tests/test_examples_utility.py +99 -0
- plothist-1.5.0/tests/test_fonts.py +23 -0
- plothist-1.5.0/tests/test_get_data.py +33 -0
- plothist-1.5.0/tests/test_histogramming.py +267 -0
- plothist-1.5.0/tests/test_plothist_style.py +130 -0
- plothist-1.5.0/tests/test_plotters.py +289 -0
- plothist-1.5.0/tests/test_test_helpers.py +15 -0
- {plothist-1.3.2 → plothist-1.5.0}/tests/test_variable_registry.py +112 -51
- plothist-1.5.0/uv.lock +1988 -0
- plothist-1.3.2/.pre-commit-config.yaml +0 -39
- plothist-1.3.2/.readthedocs.yaml +0 -20
- plothist-1.3.2/docs/CONTRIBUTING.rst +0 -47
- plothist-1.3.2/docs/img/1d_comparison_asymmetry.svg +0 -1682
- plothist-1.3.2/docs/img/1d_comparison_difference.svg +0 -2090
- plothist-1.3.2/docs/img/1d_comparison_efficiency.svg +0 -2230
- plothist-1.3.2/docs/img/1d_comparison_only_efficiency.svg +0 -1340
- plothist-1.3.2/docs/img/1d_comparison_pull.svg +0 -1718
- plothist-1.3.2/docs/img/1d_comparison_ratio.svg +0 -1598
- plothist-1.3.2/docs/img/1d_comparison_relative_difference.svg +0 -1713
- plothist-1.3.2/docs/img/1d_comparison_split_ratio.svg +0 -2119
- plothist-1.3.2/docs/img/1d_elt1.svg +0 -1119
- plothist-1.3.2/docs/img/1d_elt1_stacked.svg +0 -1454
- plothist-1.3.2/docs/img/1d_elt2.svg +0 -1107
- plothist-1.3.2/docs/img/1d_fct.svg +0 -862
- plothist-1.3.2/docs/img/1d_fct_stacked.svg +0 -4786
- plothist-1.3.2/docs/img/1d_hist_simple.svg +0 -1468
- plothist-1.3.2/docs/img/1d_int_category.svg +0 -773
- plothist-1.3.2/docs/img/1d_profile.svg +0 -953
- plothist-1.3.2/docs/img/1d_side_by_side.svg +0 -835
- plothist-1.3.2/docs/img/1d_side_by_side_with_numbers.svg +0 -1085
- plothist-1.3.2/docs/img/1d_str_category.svg +0 -799
- plothist-1.3.2/docs/img/2d_hist_correlations_0.svg +0 -16339
- plothist-1.3.2/docs/img/2d_hist_correlations_1.svg +0 -16320
- plothist-1.3.2/docs/img/2d_hist_correlations_2.svg +0 -16243
- plothist-1.3.2/docs/img/2d_hist_simple.svg +0 -1892
- plothist-1.3.2/docs/img/2d_hist_simple_discrete_colormap.svg +0 -16295
- plothist-1.3.2/docs/img/2d_hist_uneven.svg +0 -1514
- plothist-1.3.2/docs/img/add_text_example.svg +0 -1929
- plothist-1.3.2/docs/img/asymmetry_comparison_advanced.svg +0 -3104
- plothist-1.3.2/docs/img/matplotlib_example.svg +0 -1249
- plothist-1.3.2/docs/img/model_all_comparisons.svg +0 -6047
- plothist-1.3.2/docs/img/model_all_comparisons_no_model_unc.svg +0 -5627
- plothist-1.3.2/docs/img/model_examples_flatten2D.svg +0 -2229
- plothist-1.3.2/docs/img/model_examples_pull.svg +0 -3210
- plothist-1.3.2/docs/img/model_examples_pull_no_model_unc.svg +0 -3291
- plothist-1.3.2/docs/img/model_examples_stacked_unstacked.svg +0 -3432
- plothist-1.3.2/docs/img/model_examples_unstacked.svg +0 -3373
- plothist-1.3.2/docs/img/model_with_stacked_and_unstacked_function_components.svg +0 -5458
- plothist-1.3.2/docs/img/model_with_stacked_and_unstacked_histograms_components.svg +0 -2674
- plothist-1.3.2/docs/img/plothist_example.svg +0 -1569
- plothist-1.3.2/docs/img/ratio_data_vs_model_with_stacked_and_unstacked_function_components.svg +0 -6174
- plothist-1.3.2/docs/img/usage_YlGnBu_r_palette.svg +0 -92
- plothist-1.3.2/docs/img/usage_colorpalette_examples.svg +0 -9070
- plothist-1.3.2/docs/img/usage_coolwarm_palette.svg +0 -92
- plothist-1.3.2/docs/img/usage_cubehelix.svg +0 -92
- plothist-1.3.2/docs/img/usage_style_cycle.svg +0 -595
- plothist-1.3.2/docs/img/usage_viridis_palette.svg +0 -92
- plothist-1.3.2/docs/requirements.txt +0 -6
- plothist-1.3.2/noxfile.py +0 -24
- plothist-1.3.2/pyproject.toml +0 -53
- plothist-1.3.2/src/plothist/dummy_data.csv +0 -100001
- plothist-1.3.2/src/plothist/get_dummy_data.py +0 -17
- plothist-1.3.2/src/plothist/scripts/__init__.py +0 -2
- plothist-1.3.2/src/plothist/scripts/install_latin_modern_fonts.py +0 -145
- plothist-1.3.2/src/plothist/scripts/make_examples.py +0 -210
- plothist-1.3.2/tests/test_histogramming.py +0 -125
- plothist-1.3.2/tests/test_install_fonts.py +0 -28
- plothist-1.3.2/tests/test_make_examples.py +0 -9
- plothist-1.3.2/uv.lock +0 -1328
- {plothist-1.3.2 → plothist-1.5.0}/.github/ISSUE_TEMPLATE/user-story.md +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/.github/release.yaml +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/.github/workflows/pr.yaml +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/AUTHORS.md +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/CITATION.cff +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/basics/variable_registry.rst +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/documentation/documentation.rst +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/documentation/statistics.rst +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/img/1d_comparison_advanced.svg +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/img/2d_hist_with_projections.svg +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/img/model_examples_stacked.svg +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/img/pyhf_example.svg +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/docs/img/savefig_comparisons.gif +0 -0
- {plothist-1.3.2 → plothist-1.5.0}/src/plothist/default_style.mplstyle +0 -0
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/1d_hist/README.rst +0 -0
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/2d_hist/README.rst +0 -0
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/README.rst +0 -0
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/advanced/README.rst +0 -0
- {plothist-1.3.2/docs/examples/1d_func → plothist-1.5.0/src/plothist/examples/func_1d}/README.rst +0 -0
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/model_ex/README.rst +0 -0
- {plothist-1.3.2/docs → plothist-1.5.0/src/plothist}/examples/utility/README.rst +0 -0
|
@@ -19,13 +19,14 @@ jobs:
|
|
|
19
19
|
- uses: actions/checkout@v4
|
|
20
20
|
|
|
21
21
|
- name: Install uv and set the python version
|
|
22
|
-
uses: astral-sh/setup-uv@
|
|
22
|
+
uses: astral-sh/setup-uv@v6
|
|
23
23
|
with:
|
|
24
24
|
version: "0.6.8"
|
|
25
25
|
python-version: ${{ matrix.python-version }}
|
|
26
26
|
|
|
27
27
|
- name: Install the project
|
|
28
|
-
run:
|
|
28
|
+
run: |
|
|
29
|
+
uv sync --group dev --group test
|
|
29
30
|
|
|
30
31
|
- name: Run pre-commit
|
|
31
32
|
run: |
|
|
@@ -33,4 +34,12 @@ jobs:
|
|
|
33
34
|
|
|
34
35
|
- name: Test with pytest
|
|
35
36
|
run: |
|
|
36
|
-
uv run python -m pytest
|
|
37
|
+
uv run python -m pytest -r sa --mpl --mpl-results-path=pytest_results -n auto
|
|
38
|
+
|
|
39
|
+
- name: Upload pytest test results
|
|
40
|
+
uses: actions/upload-artifact@v4
|
|
41
|
+
if: failure()
|
|
42
|
+
with:
|
|
43
|
+
name: pytest_results-${{ matrix.python-version }}
|
|
44
|
+
retention-days: 3
|
|
45
|
+
path: pytest_results
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Run tests and upload coverage
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: Run tests and collect coverage
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 2
|
|
17
|
+
|
|
18
|
+
- name: Install uv and set the python version
|
|
19
|
+
uses: astral-sh/setup-uv@v6
|
|
20
|
+
with:
|
|
21
|
+
version: "0.6.8"
|
|
22
|
+
|
|
23
|
+
- name: Install the project and the test dependencies
|
|
24
|
+
run: uv sync --group test
|
|
25
|
+
|
|
26
|
+
- name: Run tests
|
|
27
|
+
run: uv run pytest --cov=plothist --cov-report=xml
|
|
28
|
+
|
|
29
|
+
- name: Upload results to Codecov
|
|
30
|
+
uses: codecov/codecov-action@v5
|
|
31
|
+
with:
|
|
32
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -4,8 +4,12 @@ variable_registry.yaml
|
|
|
4
4
|
_build/
|
|
5
5
|
test/
|
|
6
6
|
metadata.yaml
|
|
7
|
+
registry.yaml
|
|
8
|
+
test.yaml
|
|
7
9
|
temp_img/
|
|
8
10
|
.venv
|
|
11
|
+
.nox/
|
|
12
|
+
.coverage
|
|
9
13
|
|
|
10
14
|
# Ignore local readthedocs build
|
|
11
15
|
html/
|
|
@@ -14,3 +18,7 @@ docs/examples/*/*.svg
|
|
|
14
18
|
example_gallery/
|
|
15
19
|
.svg_metadata.yaml
|
|
16
20
|
tests/*.yaml
|
|
21
|
+
pytest_results/
|
|
22
|
+
|
|
23
|
+
# Version file
|
|
24
|
+
_version.py
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
ci:
|
|
2
|
+
autoupdate_commit_msg: "chore: update pre-commit hooks"
|
|
3
|
+
autofix_commit_msg: "style: pre-commit fixes"
|
|
4
|
+
autoupdate_schedule: monthly
|
|
5
|
+
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/adamchainz/blacken-docs
|
|
8
|
+
rev: "1.19.1"
|
|
9
|
+
hooks:
|
|
10
|
+
- id: blacken-docs
|
|
11
|
+
args: ["--line-length", "120"]
|
|
12
|
+
additional_dependencies:
|
|
13
|
+
- black==24.2.0
|
|
14
|
+
|
|
15
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
16
|
+
rev: v5.0.0
|
|
17
|
+
hooks:
|
|
18
|
+
- id: check-added-large-files
|
|
19
|
+
- id: check-case-conflict
|
|
20
|
+
- id: check-merge-conflict
|
|
21
|
+
- id: check-symlinks
|
|
22
|
+
- id: check-toml
|
|
23
|
+
- id: check-yaml
|
|
24
|
+
- id: debug-statements
|
|
25
|
+
- id: end-of-file-fixer
|
|
26
|
+
- id: mixed-line-ending
|
|
27
|
+
- id: trailing-whitespace
|
|
28
|
+
exclude: '.*\.svg$'
|
|
29
|
+
- id: name-tests-test
|
|
30
|
+
args: ["--pytest-test-first"]
|
|
31
|
+
|
|
32
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
33
|
+
rev: v0.12.2
|
|
34
|
+
hooks:
|
|
35
|
+
- id: ruff
|
|
36
|
+
args: ["--fix", "--show-fixes"]
|
|
37
|
+
- id: ruff-format
|
|
38
|
+
|
|
39
|
+
- repo: https://github.com/codespell-project/codespell
|
|
40
|
+
rev: v2.4.1
|
|
41
|
+
hooks:
|
|
42
|
+
- id: codespell
|
|
43
|
+
additional_dependencies:
|
|
44
|
+
- tomli
|
|
45
|
+
|
|
46
|
+
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
47
|
+
rev: 0.33.2
|
|
48
|
+
hooks:
|
|
49
|
+
- id: check-github-workflows
|
|
50
|
+
args: ["--verbose"]
|
|
51
|
+
|
|
52
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
53
|
+
rev: v1.16.1
|
|
54
|
+
hooks:
|
|
55
|
+
- id: mypy
|
|
56
|
+
files: src
|
|
57
|
+
additional_dependencies:
|
|
58
|
+
- types-requests
|
|
59
|
+
- types-pyyaml
|
|
60
|
+
|
|
61
|
+
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
62
|
+
rev: v1.10.0
|
|
63
|
+
hooks:
|
|
64
|
+
- id: rst-backticks
|
|
65
|
+
- id: rst-directive-colons
|
|
66
|
+
- id: rst-inline-touching-normal
|
|
67
|
+
|
|
68
|
+
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
69
|
+
rev: 0.33.2
|
|
70
|
+
hooks:
|
|
71
|
+
- id: check-readthedocs
|
|
72
|
+
- id: check-dependabot
|
|
73
|
+
- id: check-github-workflows
|
|
74
|
+
|
|
75
|
+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
|
|
76
|
+
rev: 2025.06.23
|
|
77
|
+
hooks:
|
|
78
|
+
- id: validate-pyproject
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Read the Docs configuration file for Sphinx projects
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
build:
|
|
8
|
+
os: "ubuntu-22.04"
|
|
9
|
+
tools:
|
|
10
|
+
python: "3.12"
|
|
11
|
+
commands:
|
|
12
|
+
- asdf plugin add uv
|
|
13
|
+
- asdf install uv latest
|
|
14
|
+
- asdf global uv latest
|
|
15
|
+
- uv sync --group docs
|
|
16
|
+
- .venv/bin/sphinx-build -n -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
BSD 3-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2023-
|
|
3
|
+
Copyright (c) 2023-2025, Cyrille Praz, Tristan Fillinger
|
|
4
4
|
|
|
5
5
|
Redistribution and use in source and binary forms, with or without
|
|
6
6
|
modification, are permitted provided that the following conditions are met:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plothist
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: Plot histograms in a scalable way and a beautiful style.
|
|
5
5
|
Project-URL: Homepage, https://github.com/cyrraz/plothist
|
|
6
6
|
Project-URL: Documentation, https://plothist.readthedocs.io/
|
|
@@ -19,13 +19,10 @@ Requires-Python: >=3.9
|
|
|
19
19
|
Requires-Dist: boost-histogram>=1.4.0
|
|
20
20
|
Requires-Dist: matplotlib>=3.0
|
|
21
21
|
Requires-Dist: numpy>=1.14.5
|
|
22
|
+
Requires-Dist: plothist-utils>=0.0.1
|
|
22
23
|
Requires-Dist: pyyaml>=5.3.1
|
|
23
24
|
Requires-Dist: requests>=2.25.0
|
|
24
25
|
Requires-Dist: scipy>=1.6.0
|
|
25
|
-
Provides-Extra: dev
|
|
26
|
-
Requires-Dist: pre-commit>=4.1.0; extra == 'dev'
|
|
27
|
-
Provides-Extra: test
|
|
28
|
-
Requires-Dist: pytest>=8.3.5; extra == 'test'
|
|
29
26
|
Description-Content-Type: text/x-rst
|
|
30
27
|
|
|
31
28
|
|
|
@@ -49,8 +46,11 @@ plothist
|
|
|
49
46
|
:width: 320
|
|
50
47
|
|
|
51
48
|
|
|
52
|
-
|GitHub Project| |PyPI version| |Docs from main| |Discussion| |DOI| |
|
|
49
|
+
|GitHub Project| |PyPI version| |Docs from main| |Discussion| |DOI| |Linter|
|
|
53
50
|
|
|
51
|
+
|GitHub Actions Status: CI| |GitHub Actions Status: CD| |pre-commit.ci Status| |Code Coverage|
|
|
52
|
+
|
|
53
|
+
This package is a wrapper around `matplotlib <https://matplotlib.org/>`_.
|
|
54
54
|
|
|
55
55
|
**Advantages of the package**: scalability, style and user-friendly way of managing variables and a stunning `example gallery <https://plothist.readthedocs.io/en/latest/example_gallery/>`_.
|
|
56
56
|
|
|
@@ -73,13 +73,21 @@ plothist
|
|
|
73
73
|
|
|
74
74
|
.. |GitHub Project| image:: https://img.shields.io/badge/GitHub--blue?style=social&logo=GitHub
|
|
75
75
|
:target: https://github.com/cyrraz/plothist
|
|
76
|
-
.. |PyPI version| image:: https://badge.fury.io/py/plothist.svg
|
|
76
|
+
.. |PyPI version| image:: https://badge.fury.io/py/plothist.svg?style=flat-square
|
|
77
77
|
:target: https://badge.fury.io/py/plothist
|
|
78
|
-
.. |Docs from main| image:: https://img.shields.io/badge/docs-main-blue.svg
|
|
78
|
+
.. |Docs from main| image:: https://img.shields.io/badge/docs-main-blue.svg?style=platic
|
|
79
79
|
:target: https://plothist.readthedocs.io/en/main/
|
|
80
|
-
.. |Discussion| image:: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
|
|
80
|
+
.. |Discussion| image:: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github?style=flat-square
|
|
81
81
|
:target: https://github.com/cyrraz/plothist/discussions
|
|
82
|
-
.. |DOI| image:: https://zenodo.org/badge/647069945.svg
|
|
82
|
+
.. |DOI| image:: https://zenodo.org/badge/647069945.svg?style=flat-square
|
|
83
83
|
:target: https://zenodo.org/doi/10.5281/zenodo.10995667
|
|
84
|
-
.. |
|
|
85
|
-
:target: https://github.com/
|
|
84
|
+
.. |Linter| image:: https://img.shields.io/badge/Linter-Ruff-brightgreen?style=platic
|
|
85
|
+
:target: https://github.com/charliermarsh/ruff
|
|
86
|
+
.. |GitHub Actions Status: CI| image:: https://github.com/cyrraz/plothist/actions/workflows/ci.yaml/badge.svg?style=flat-square
|
|
87
|
+
:target: https://github.com/cyrraz/plothist/actions/workflows/ci.yaml?query=branch%3Amain
|
|
88
|
+
.. |GitHub Actions Status: CD| image:: https://github.com/cyrraz/plothist/actions/workflows/cd.yaml/badge.svg?style=flat-square
|
|
89
|
+
:target: https://github.com/cyrraz/plothist/actions/workflows/cd.yaml?query=branch%3Amain
|
|
90
|
+
.. |pre-commit.ci Status| image:: https://results.pre-commit.ci/badge/github/cyrraz/plothist/main.svg?style=flat-square
|
|
91
|
+
:target: https://results.pre-commit.ci/latest/github/cyrraz/plothist/main
|
|
92
|
+
.. |Code Coverage| image:: https://codecov.io/gh/cyrraz/plothist/branch/main/graph/badge.svg?style=flat-square
|
|
93
|
+
:target: https://codecov.io/gh/cyrraz/plothist
|
|
@@ -19,8 +19,11 @@ plothist
|
|
|
19
19
|
:width: 320
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|GitHub Project| |PyPI version| |Docs from main| |Discussion| |DOI| |
|
|
22
|
+
|GitHub Project| |PyPI version| |Docs from main| |Discussion| |DOI| |Linter|
|
|
23
23
|
|
|
24
|
+
|GitHub Actions Status: CI| |GitHub Actions Status: CD| |pre-commit.ci Status| |Code Coverage|
|
|
25
|
+
|
|
26
|
+
This package is a wrapper around `matplotlib <https://matplotlib.org/>`_.
|
|
24
27
|
|
|
25
28
|
**Advantages of the package**: scalability, style and user-friendly way of managing variables and a stunning `example gallery <https://plothist.readthedocs.io/en/latest/example_gallery/>`_.
|
|
26
29
|
|
|
@@ -43,13 +46,21 @@ plothist
|
|
|
43
46
|
|
|
44
47
|
.. |GitHub Project| image:: https://img.shields.io/badge/GitHub--blue?style=social&logo=GitHub
|
|
45
48
|
:target: https://github.com/cyrraz/plothist
|
|
46
|
-
.. |PyPI version| image:: https://badge.fury.io/py/plothist.svg
|
|
49
|
+
.. |PyPI version| image:: https://badge.fury.io/py/plothist.svg?style=flat-square
|
|
47
50
|
:target: https://badge.fury.io/py/plothist
|
|
48
|
-
.. |Docs from main| image:: https://img.shields.io/badge/docs-main-blue.svg
|
|
51
|
+
.. |Docs from main| image:: https://img.shields.io/badge/docs-main-blue.svg?style=platic
|
|
49
52
|
:target: https://plothist.readthedocs.io/en/main/
|
|
50
|
-
.. |Discussion| image:: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
|
|
53
|
+
.. |Discussion| image:: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github?style=flat-square
|
|
51
54
|
:target: https://github.com/cyrraz/plothist/discussions
|
|
52
|
-
.. |DOI| image:: https://zenodo.org/badge/647069945.svg
|
|
55
|
+
.. |DOI| image:: https://zenodo.org/badge/647069945.svg?style=flat-square
|
|
53
56
|
:target: https://zenodo.org/doi/10.5281/zenodo.10995667
|
|
54
|
-
.. |
|
|
55
|
-
:target: https://github.com/
|
|
57
|
+
.. |Linter| image:: https://img.shields.io/badge/Linter-Ruff-brightgreen?style=platic
|
|
58
|
+
:target: https://github.com/charliermarsh/ruff
|
|
59
|
+
.. |GitHub Actions Status: CI| image:: https://github.com/cyrraz/plothist/actions/workflows/ci.yaml/badge.svg?style=flat-square
|
|
60
|
+
:target: https://github.com/cyrraz/plothist/actions/workflows/ci.yaml?query=branch%3Amain
|
|
61
|
+
.. |GitHub Actions Status: CD| image:: https://github.com/cyrraz/plothist/actions/workflows/cd.yaml/badge.svg?style=flat-square
|
|
62
|
+
:target: https://github.com/cyrraz/plothist/actions/workflows/cd.yaml?query=branch%3Amain
|
|
63
|
+
.. |pre-commit.ci Status| image:: https://results.pre-commit.ci/badge/github/cyrraz/plothist/main.svg?style=flat-square
|
|
64
|
+
:target: https://results.pre-commit.ci/latest/github/cyrraz/plothist/main
|
|
65
|
+
.. |Code Coverage| image:: https://codecov.io/gh/cyrraz/plothist/branch/main/graph/badge.svg?style=flat-square
|
|
66
|
+
:target: https://codecov.io/gh/cyrraz/plothist
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.. _contributing:
|
|
2
|
+
|
|
3
|
+
============
|
|
4
|
+
Contributing
|
|
5
|
+
============
|
|
6
|
+
|
|
7
|
+
Welcome to the ``plothist`` project! We appreciate your interest in contributing to our codebase. This document outlines the steps to get started with development, including setting up your environment and running tests.
|
|
8
|
+
If you have any questions or need assistance, feel free to reach out to the maintainers.
|
|
9
|
+
We welcome contributions of all kinds, including bug fixes, new features, and documentation improvements.
|
|
10
|
+
|
|
11
|
+
Building from source
|
|
12
|
+
====================
|
|
13
|
+
|
|
14
|
+
Follow the instructions in :ref:`install-dev-version` to install the development version of ``plothist``.
|
|
15
|
+
|
|
16
|
+
Setting up a development environment
|
|
17
|
+
====================================
|
|
18
|
+
|
|
19
|
+
Nox
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
The fastest way to start with development is to use ``nox``.
|
|
23
|
+
|
|
24
|
+
``Nox`` is an automation tool that helps manage and run development tasks such as testing and linting.
|
|
25
|
+
It is especially useful for ensuring your code works across different Python versions and adheres to the project's quality standards.
|
|
26
|
+
``Nox`` handles everything for you, including setting up a temporary virtual environment for each run.
|
|
27
|
+
|
|
28
|
+
To set up ``nox``:
|
|
29
|
+
|
|
30
|
+
1. If you don't have it already, install ``pipx`` by following the instructions on their `website <https://pipx.pypa.io/stable/>`_.
|
|
31
|
+
2. Install ``nox`` using ``pipx``:
|
|
32
|
+
|
|
33
|
+
.. code-block:: console
|
|
34
|
+
|
|
35
|
+
pipx install nox
|
|
36
|
+
|
|
37
|
+
To use ``nox``, simply run:
|
|
38
|
+
|
|
39
|
+
.. code-block:: console
|
|
40
|
+
|
|
41
|
+
nox
|
|
42
|
+
|
|
43
|
+
This will lint and test the project using multiple Python versions.
|
|
44
|
+
|
|
45
|
+
You can also run specific nox sessions:
|
|
46
|
+
|
|
47
|
+
.. code-block:: console
|
|
48
|
+
|
|
49
|
+
# List all the defined sessions
|
|
50
|
+
nox -l
|
|
51
|
+
# Run the linter only
|
|
52
|
+
nox -s lint
|
|
53
|
+
# Run the tests only
|
|
54
|
+
nox -s tests
|
|
55
|
+
# Build the documentation and serve it locally (display the documentation in a web browser with live-reloading)
|
|
56
|
+
nox -s docs
|
|
57
|
+
# Build the documentation without serving it
|
|
58
|
+
nox -s docs --non-interactive
|
|
59
|
+
# Check for broken links in the documentation
|
|
60
|
+
nox -s docs -- -b linkcheck
|
|
61
|
+
# Run the tests with coverage (takes a while)
|
|
62
|
+
nox -s coverage
|
|
63
|
+
# Generate the example figures. Needed if you update any of the example scripts.
|
|
64
|
+
nox -s generate_examples_figures -- tests/test_examples_*.py
|
|
65
|
+
|
|
66
|
+
Linters and Formatters
|
|
67
|
+
----------------------
|
|
68
|
+
|
|
69
|
+
``plothist`` uses `pre-commit <https://pre-commit.com/>`_ to manage linters and formatters.
|
|
70
|
+
|
|
71
|
+
The tools are listed in ``.pre-commit-config.yaml``. Key among them is ``Ruff`` is used for linting and formatting, with its configuration in ``pyproject.toml``.
|
|
72
|
+
|
|
73
|
+
Use ``nox -s lint`` to run the linters and formatters.
|
|
74
|
+
|
|
75
|
+
To install the pre-commit hooks, run the following command (assuming you have installed ``plothist`` via ``uv`` following the instructions in :ref:`install-dev-version`):
|
|
76
|
+
|
|
77
|
+
.. code-block:: console
|
|
78
|
+
|
|
79
|
+
uv run pre-commit install
|
|
@@ -8,7 +8,7 @@ The examples below make use of a numpy ndarray ``df`` containing dummy data (you
|
|
|
8
8
|
|
|
9
9
|
.. code-block:: python
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from plothist_utils import get_dummy_data
|
|
12
12
|
|
|
13
13
|
df = get_dummy_data()
|
|
14
14
|
|
|
@@ -31,7 +31,7 @@ We also show an example of how to scale the model to the data. We take advantage
|
|
|
31
31
|
from plothist import make_hist, get_color_palette
|
|
32
32
|
|
|
33
33
|
key = "variable_1"
|
|
34
|
-
range =
|
|
34
|
+
range = (-9, 12)
|
|
35
35
|
category = "category"
|
|
36
36
|
|
|
37
37
|
# Define some masks to separate the dataset in signal (1 category), background (3 categories) and data (1 category)
|
|
@@ -88,11 +88,11 @@ Histograms
|
|
|
88
88
|
|
|
89
89
|
Here is an example with a model made of 3 stacked and 1 unstacked histograms. The calculated sum is the sum of all 4 histograms.
|
|
90
90
|
|
|
91
|
-
.. literalinclude::
|
|
91
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_with_stacked_and_unstacked_histograms_components.py
|
|
92
92
|
:language: python
|
|
93
93
|
:start-after: ###
|
|
94
94
|
|
|
95
|
-
.. image:: ../img/model_with_stacked_and_unstacked_histograms_components.
|
|
95
|
+
.. image:: ../img/model_with_stacked_and_unstacked_histograms_components.png
|
|
96
96
|
:alt: Plot of a model with stacked and unstacked histograms components
|
|
97
97
|
:width: 500
|
|
98
98
|
|
|
@@ -104,11 +104,11 @@ Functions
|
|
|
104
104
|
|
|
105
105
|
Here is an example with a model made of 2 stacked and 1 unstacked functions:
|
|
106
106
|
|
|
107
|
-
.. literalinclude::
|
|
107
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_with_stacked_and_unstacked_function_components.py
|
|
108
108
|
:language: python
|
|
109
109
|
:start-after: ###
|
|
110
110
|
|
|
111
|
-
.. image:: ../img/model_with_stacked_and_unstacked_function_components.
|
|
111
|
+
.. image:: ../img/model_with_stacked_and_unstacked_function_components.png
|
|
112
112
|
:alt: Plot of a model with stacked and unstacked function components
|
|
113
113
|
:width: 500
|
|
114
114
|
|
|
@@ -128,11 +128,11 @@ Stacked histograms
|
|
|
128
128
|
|
|
129
129
|
A comparison between data and a model composed of 3 stacked histograms. A signal histogram is also plotted, but it doesn't belong to the model, so it is not taken into account in the comparison.
|
|
130
130
|
|
|
131
|
-
.. literalinclude::
|
|
131
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_examples_stacked.py
|
|
132
132
|
:language: python
|
|
133
133
|
:start-after: ###
|
|
134
134
|
|
|
135
|
-
.. image:: ../img/model_examples_stacked.
|
|
135
|
+
.. image:: ../img/model_examples_stacked.png
|
|
136
136
|
:alt: Data/model comparison, stacked plot
|
|
137
137
|
:width: 500
|
|
138
138
|
|
|
@@ -148,11 +148,11 @@ Unstacked histograms
|
|
|
148
148
|
|
|
149
149
|
The same comparison as above, but we represent the model with unstacked histograms:
|
|
150
150
|
|
|
151
|
-
.. literalinclude::
|
|
151
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_examples_unstacked.py
|
|
152
152
|
:language: python
|
|
153
153
|
:start-after: ###
|
|
154
154
|
|
|
155
|
-
.. image:: ../img/model_examples_unstacked.
|
|
155
|
+
.. image:: ../img/model_examples_unstacked.png
|
|
156
156
|
:alt: Data/model comparison, stacked plot
|
|
157
157
|
:width: 500
|
|
158
158
|
|
|
@@ -162,11 +162,11 @@ Stacked and unstacked histograms
|
|
|
162
162
|
|
|
163
163
|
Stacked and unstacked histograms can be combined. The sum of the model components is always the sum of all the components, stacked and unstacked. Below is the same comparison as above, but the model is now composed of 2 stacked and 1 unstacked histograms:
|
|
164
164
|
|
|
165
|
-
.. literalinclude::
|
|
165
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_examples_stacked_unstacked.py
|
|
166
166
|
:language: python
|
|
167
167
|
:start-after: ###
|
|
168
168
|
|
|
169
|
-
.. image:: ../img/model_examples_stacked_unstacked.
|
|
169
|
+
.. image:: ../img/model_examples_stacked_unstacked.png
|
|
170
170
|
:alt: Data/model comparison, stacked and unstacked plot with histograms
|
|
171
171
|
:width: 500
|
|
172
172
|
|
|
@@ -176,11 +176,11 @@ Models made of functions
|
|
|
176
176
|
|
|
177
177
|
The function :func:`plot_data_model_comparison() <plothist.plotters.plot_data_model_comparison>` can also be used to compare data and a model made of functions. The model below is composed of 2 stacked and 1 unstacked functions. All the functions contribute to the model. The sum of the model components is the sum of all the components, stacked and unstacked:
|
|
178
178
|
|
|
179
|
-
.. literalinclude::
|
|
179
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/ratio_data_vs_model_with_stacked_and_unstacked_function_components.py
|
|
180
180
|
:language: python
|
|
181
181
|
:start-after: ###
|
|
182
182
|
|
|
183
|
-
.. image:: ../img/ratio_data_vs_model_with_stacked_and_unstacked_function_components.
|
|
183
|
+
.. image:: ../img/ratio_data_vs_model_with_stacked_and_unstacked_function_components.png
|
|
184
184
|
:alt: Data/Model comparison, model with stacked and unstacked function components
|
|
185
185
|
:width: 500
|
|
186
186
|
|
|
@@ -193,22 +193,22 @@ Model uncertainty
|
|
|
193
193
|
|
|
194
194
|
As said earlier, the comparison function can take any comparison method available in :func:`plot_comparison() <plothist.plotters.plot_comparison>`. To use pulls instead of the ratio to compare the histograms:
|
|
195
195
|
|
|
196
|
-
.. literalinclude::
|
|
196
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_examples_pull.py
|
|
197
197
|
:language: python
|
|
198
198
|
:start-after: ###
|
|
199
199
|
|
|
200
|
-
.. image:: ../img/model_examples_pull.
|
|
200
|
+
.. image:: ../img/model_examples_pull.png
|
|
201
201
|
:alt: Data/model comparison with pull, stacked plot
|
|
202
202
|
:width: 500
|
|
203
203
|
|
|
204
204
|
|
|
205
205
|
Now, if you do not want to show nor take into account the model uncertainties, setting ``model_uncertainty`` to ``False`` removes them and updates the definition of the pulls:
|
|
206
206
|
|
|
207
|
-
.. literalinclude::
|
|
207
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_examples_pull_no_model_unc.py
|
|
208
208
|
:language: python
|
|
209
209
|
:start-after: ###
|
|
210
210
|
|
|
211
|
-
.. image:: ../img/model_examples_pull_no_model_unc.
|
|
211
|
+
.. image:: ../img/model_examples_pull_no_model_unc.png
|
|
212
212
|
:alt: Data/model comparison with pull, no model stat. unc., stacked plot
|
|
213
213
|
:width: 500
|
|
214
214
|
|
|
@@ -228,11 +228,11 @@ All the different comparisons
|
|
|
228
228
|
|
|
229
229
|
Below is shown how to make a plot with all the possible comparisons between data and model. The idea is to use :func:`plot_data_model_comparison() <plothist.plotters.plot_data_model_comparison>` to make the plot with the ratio comparison, and then use :func:`plot_comparison() <plothist.plotters.plot_comparison>` to add the other comparisons. The :func:`plot_comparison() <plothist.plotters.plot_comparison>` function can take a ``fig`` and ``ax`` argument to add the comparison to an existing figure. The :func:`plot_data_model_comparison() <plothist.plotters.plot_data_model_comparison>` function returns the figure and axes used to make the plot, so we can use them to add the other comparisons.
|
|
230
230
|
|
|
231
|
-
.. literalinclude::
|
|
231
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_all_comparisons.py
|
|
232
232
|
:language: python
|
|
233
233
|
:start-after: ###
|
|
234
234
|
|
|
235
|
-
.. image:: ../img/model_all_comparisons.
|
|
235
|
+
.. image:: ../img/model_all_comparisons.png
|
|
236
236
|
:alt: Data/model comparison with all comparisons, stacked plot
|
|
237
237
|
:width: 500
|
|
238
238
|
|
|
@@ -243,10 +243,10 @@ No model uncertainties
|
|
|
243
243
|
|
|
244
244
|
Same example as above, but we remove the statistical uncertainties of the model by adding ``model_uncertainty=False`` in :func:`plot_data_model_comparison() <plothist.plotters.plot_data_model_comparison>` and pass a model histogram without uncertainties to :func:`plot_comparison() <plothist.plotters.plot_comparison>`:
|
|
245
245
|
|
|
246
|
-
.. literalinclude::
|
|
246
|
+
.. literalinclude:: ../../src/plothist/examples/model_ex/model_all_comparisons_no_model_unc.py
|
|
247
247
|
:language: python
|
|
248
248
|
:start-after: ###
|
|
249
249
|
|
|
250
|
-
.. image:: ../img/model_all_comparisons_no_model_unc.
|
|
250
|
+
.. image:: ../img/model_all_comparisons_no_model_unc.png
|
|
251
251
|
:alt: Data/model comparison with all comparisons, no model uncertainties, stacked plot
|
|
252
252
|
:width: 500
|
|
@@ -10,7 +10,7 @@ The examples use of a numpy ndarray ``df`` containing dummy data (you may also u
|
|
|
10
10
|
|
|
11
11
|
.. code-block:: python
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from plothist_utils import get_dummy_data
|
|
14
14
|
|
|
15
15
|
df = get_dummy_data()
|
|
16
16
|
|
|
@@ -19,11 +19,11 @@ Advanced example comparing two histograms
|
|
|
19
19
|
|
|
20
20
|
In this example, we will compare two tuples of histograms and use pull and ratio comparisons. First, we make the histograms and scale them. Then, we plot the histograms and the comparison plots on different axes:
|
|
21
21
|
|
|
22
|
-
.. image:: ../img/1d_comparison_advanced.
|
|
22
|
+
.. image:: ../img/1d_comparison_advanced.png
|
|
23
23
|
:alt: Advanced hist comparison
|
|
24
24
|
:width: 500
|
|
25
25
|
|
|
26
|
-
.. literalinclude::
|
|
26
|
+
.. literalinclude:: ../../src/plothist/examples/advanced/1d_comparison_advanced.py
|
|
27
27
|
:language: python
|
|
28
28
|
:start-after: ###
|
|
29
29
|
|
|
@@ -34,11 +34,11 @@ Advanced example using asymmetry comparison
|
|
|
34
34
|
|
|
35
35
|
This example shows how to plot an asymmetry plot between two histograms and two functions. Information on how to convert a function from an external fitting package to an object that can be used by ``plothist`` can be found in :ref:`plot-fit-result-label`.
|
|
36
36
|
|
|
37
|
-
.. image:: ../img/asymmetry_comparison_advanced.
|
|
37
|
+
.. image:: ../img/asymmetry_comparison_advanced.png
|
|
38
38
|
:alt: Advanced asymmetry comparison
|
|
39
39
|
:width: 500
|
|
40
40
|
|
|
41
|
-
.. literalinclude::
|
|
41
|
+
.. literalinclude:: ../../src/plothist/examples/advanced/asymmetry_comparison_advanced.py
|
|
42
42
|
:language: python
|
|
43
43
|
:start-after: ###
|
|
44
44
|
|
|
@@ -47,11 +47,11 @@ Flatten 2D variable
|
|
|
47
47
|
|
|
48
48
|
Compare data and stacked histogram for a flatten 2D variable:
|
|
49
49
|
|
|
50
|
-
.. image:: ../img/model_examples_flatten2D.
|
|
50
|
+
.. image:: ../img/model_examples_flatten2D.png
|
|
51
51
|
:alt: Data/model comparison, flatten variable
|
|
52
52
|
:width: 500
|
|
53
53
|
|
|
54
|
-
.. literalinclude::
|
|
54
|
+
.. literalinclude:: ../../src/plothist/examples/advanced/model_examples_flatten2D.py
|
|
55
55
|
:language: python
|
|
56
56
|
:start-after: ###
|
|
57
57
|
|
|
@@ -61,10 +61,10 @@ Multiple histograms, side by side, with numbers on top
|
|
|
61
61
|
|
|
62
62
|
This example shows how to plot multiple 1D histograms side by side, with numbers on top of each bars. The code is similar to the one used in the :ref:`basics-1d_hist_side_by_side-label` section.
|
|
63
63
|
|
|
64
|
-
.. image:: ../img/1d_side_by_side_with_numbers.
|
|
64
|
+
.. image:: ../img/1d_side_by_side_with_numbers.png
|
|
65
65
|
:alt: Multiple histograms side by side
|
|
66
66
|
:width: 500
|
|
67
67
|
|
|
68
|
-
.. literalinclude::
|
|
68
|
+
.. literalinclude:: ../../src/plothist/examples/advanced/1d_side_by_side_with_numbers.py
|
|
69
69
|
:language: python
|
|
70
70
|
:start-after: ###
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.. _basics-
|
|
1
|
+
.. _basics-func_1d-label:
|
|
2
2
|
|
|
3
3
|
==============
|
|
4
4
|
Plot functions
|
|
@@ -8,7 +8,7 @@ The examples below make use of a numpy ndarray ``df`` containing dummy data (you
|
|
|
8
8
|
|
|
9
9
|
.. code-block:: python
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from plothist_utils import get_dummy_data
|
|
12
12
|
|
|
13
13
|
df = get_dummy_data()
|
|
14
14
|
|
|
@@ -25,21 +25,21 @@ Simple function
|
|
|
25
25
|
|
|
26
26
|
Plothist supports plotting of functions using the :func:`plot_function() <plothist.plotters.plot_function>` function:
|
|
27
27
|
|
|
28
|
-
.. literalinclude::
|
|
28
|
+
.. literalinclude:: ../../src/plothist/examples/func_1d/fct_1d.py
|
|
29
29
|
:language: python
|
|
30
30
|
:start-after: ###
|
|
31
31
|
|
|
32
|
-
.. image:: ../img/
|
|
32
|
+
.. image:: ../img/fct_1d.png
|
|
33
33
|
:alt: Simple function
|
|
34
34
|
:width: 500
|
|
35
35
|
|
|
36
36
|
In particular, you can stack functions using the ``stacked=True`` argument:
|
|
37
37
|
|
|
38
|
-
.. literalinclude::
|
|
38
|
+
.. literalinclude:: ../../src/plothist/examples/func_1d/fct_1d_stacked.py
|
|
39
39
|
:language: python
|
|
40
40
|
:start-after: ###
|
|
41
41
|
|
|
42
|
-
.. image:: ../img/
|
|
42
|
+
.. image:: ../img/fct_1d_stacked.png
|
|
43
43
|
:alt: Simple stacked function
|
|
44
44
|
:width: 500
|
|
45
45
|
|