plothist 1.3.2__tar.gz → 1.4.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.
Files changed (164) hide show
  1. {plothist-1.3.2 → plothist-1.4.0}/.github/dependabot.yaml +1 -1
  2. {plothist-1.3.2 → plothist-1.4.0}/.github/workflows/ci.yaml +1 -1
  3. plothist-1.4.0/.github/workflows/coverage.yaml +32 -0
  4. {plothist-1.3.2 → plothist-1.4.0}/.gitignore +5 -0
  5. plothist-1.4.0/.pre-commit-config.yaml +78 -0
  6. plothist-1.4.0/.readthedocs.yaml +16 -0
  7. {plothist-1.3.2 → plothist-1.4.0}/LICENSE +1 -1
  8. {plothist-1.3.2 → plothist-1.4.0}/PKG-INFO +20 -12
  9. {plothist-1.3.2 → plothist-1.4.0}/README.rst +18 -7
  10. plothist-1.4.0/codecov.yml +6 -0
  11. plothist-1.4.0/docs/CONTRIBUTING.rst +77 -0
  12. {plothist-1.3.2 → plothist-1.4.0}/docs/advanced/model_examples.rst +1 -1
  13. {plothist-1.3.2 → plothist-1.4.0}/docs/advanced/other_advanced.rst +1 -1
  14. {plothist-1.3.2 → plothist-1.4.0}/docs/basics/1d_func.rst +1 -1
  15. {plothist-1.3.2 → plothist-1.4.0}/docs/basics/1d_hist.rst +2 -2
  16. {plothist-1.3.2 → plothist-1.4.0}/docs/basics/2d_hist.rst +1 -1
  17. {plothist-1.3.2 → plothist-1.4.0}/docs/conf.py +11 -14
  18. plothist-1.3.2/docs/usage/font_installation.rst → plothist-1.4.0/docs/documentation/troubleshooting.rst +9 -50
  19. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_func/1d_fct.py +3 -2
  20. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_func/1d_fct_stacked.py +2 -2
  21. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_asymmetry.py +2 -2
  22. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_difference.py +3 -3
  23. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_efficiency.py +1 -1
  24. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_only_efficiency.py +2 -1
  25. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_pull.py +2 -2
  26. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_ratio.py +2 -2
  27. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_relative_difference.py +2 -2
  28. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_comparison_split_ratio.py +2 -2
  29. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_elt1.py +4 -3
  30. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_elt1_stacked.py +4 -3
  31. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_elt2.py +3 -2
  32. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_hist_simple.py +3 -2
  33. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_int_category.py +2 -1
  34. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_profile.py +2 -1
  35. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_side_by_side.py +2 -1
  36. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/1d_str_category.py +2 -1
  37. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/2d_hist/2d_hist_correlations.py +5 -4
  38. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/2d_hist/2d_hist_simple.py +1 -2
  39. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/2d_hist/2d_hist_simple_discrete_colormap.py +3 -3
  40. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/2d_hist/2d_hist_uneven.py +1 -2
  41. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/2d_hist/2d_hist_with_projections.py +1 -1
  42. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/advanced/1d_comparison_advanced.py +5 -5
  43. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/advanced/1d_side_by_side_with_numbers.py +3 -2
  44. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/advanced/asymmetry_comparison_advanced.py +5 -5
  45. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/advanced/model_examples_flatten2D.py +4 -4
  46. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_all_comparisons.py +5 -6
  47. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_all_comparisons_no_model_unc.py +7 -7
  48. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_examples_pull.py +2 -2
  49. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_examples_pull_no_model_unc.py +3 -3
  50. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_examples_stacked.py +3 -3
  51. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_examples_stacked_unstacked.py +2 -2
  52. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_examples_unstacked.py +3 -3
  53. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_with_stacked_and_unstacked_function_components.py +2 -3
  54. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/model_with_stacked_and_unstacked_histograms_components.py +3 -3
  55. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/ratio_data_vs_model_with_stacked_and_unstacked_function_components.py +2 -2
  56. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/utility/add_text_example.py +5 -12
  57. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/utility/color_palette_hists.py +3 -2
  58. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/utility/color_palette_squares.py +4 -6
  59. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/utility/matplotlib_vs_plothist_style.py +1 -2
  60. {plothist-1.3.2 → plothist-1.4.0}/docs/index.rst +1 -1
  61. {plothist-1.3.2 → plothist-1.4.0}/docs/usage/installation.rst +2 -6
  62. plothist-1.4.0/noxfile.py +82 -0
  63. {plothist-1.3.2 → plothist-1.4.0}/pyproject.toml +40 -4
  64. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/__init__.py +66 -74
  65. plothist-1.4.0/src/plothist/_version.py +21 -0
  66. plothist-1.4.0/src/plothist/_version.pyi +2 -0
  67. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/comparison.py +4 -1
  68. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/histogramming.py +20 -12
  69. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/plothist_style.py +9 -7
  70. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/plotters.py +89 -55
  71. plothist-1.4.0/src/plothist/scripts/__init__.py +3 -0
  72. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/scripts/make_examples.py +27 -28
  73. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/variable_registry.py +17 -14
  74. {plothist-1.3.2 → plothist-1.4.0}/tests/test_asymmetry.py +5 -2
  75. {plothist-1.3.2 → plothist-1.4.0}/tests/test_difference.py +4 -1
  76. {plothist-1.3.2 → plothist-1.4.0}/tests/test_efficiency.py +4 -1
  77. plothist-1.4.0/tests/test_fonts.py +23 -0
  78. plothist-1.4.0/tests/test_get_data.py +33 -0
  79. {plothist-1.3.2 → plothist-1.4.0}/tests/test_histogramming.py +4 -3
  80. {plothist-1.3.2 → plothist-1.4.0}/tests/test_make_examples.py +2 -0
  81. {plothist-1.3.2 → plothist-1.4.0}/tests/test_pull.py +4 -1
  82. {plothist-1.3.2 → plothist-1.4.0}/tests/test_ratio.py +4 -1
  83. {plothist-1.3.2 → plothist-1.4.0}/tests/test_variable_registry.py +10 -6
  84. {plothist-1.3.2 → plothist-1.4.0}/uv.lock +581 -75
  85. plothist-1.3.2/.pre-commit-config.yaml +0 -39
  86. plothist-1.3.2/.readthedocs.yaml +0 -20
  87. plothist-1.3.2/docs/CONTRIBUTING.rst +0 -47
  88. plothist-1.3.2/docs/requirements.txt +0 -6
  89. plothist-1.3.2/noxfile.py +0 -24
  90. plothist-1.3.2/src/plothist/dummy_data.csv +0 -100001
  91. plothist-1.3.2/src/plothist/get_dummy_data.py +0 -17
  92. plothist-1.3.2/src/plothist/scripts/__init__.py +0 -2
  93. plothist-1.3.2/src/plothist/scripts/install_latin_modern_fonts.py +0 -145
  94. plothist-1.3.2/tests/test_install_fonts.py +0 -28
  95. {plothist-1.3.2 → plothist-1.4.0}/.github/ISSUE_TEMPLATE/user-story.md +0 -0
  96. {plothist-1.3.2 → plothist-1.4.0}/.github/release.yaml +0 -0
  97. {plothist-1.3.2 → plothist-1.4.0}/.github/workflows/cd.yaml +0 -0
  98. {plothist-1.3.2 → plothist-1.4.0}/.github/workflows/pr.yaml +0 -0
  99. {plothist-1.3.2 → plothist-1.4.0}/AUTHORS.md +0 -0
  100. {plothist-1.3.2 → plothist-1.4.0}/CITATION.cff +0 -0
  101. {plothist-1.3.2 → plothist-1.4.0}/docs/basics/variable_registry.rst +0 -0
  102. {plothist-1.3.2 → plothist-1.4.0}/docs/documentation/documentation.rst +0 -0
  103. {plothist-1.3.2 → plothist-1.4.0}/docs/documentation/statistics.rst +0 -0
  104. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_func/README.rst +0 -0
  105. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/1d_hist/README.rst +0 -0
  106. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/2d_hist/README.rst +0 -0
  107. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/README.rst +0 -0
  108. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/advanced/README.rst +0 -0
  109. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/model_ex/README.rst +0 -0
  110. {plothist-1.3.2 → plothist-1.4.0}/docs/examples/utility/README.rst +0 -0
  111. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_advanced.svg +0 -0
  112. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_asymmetry.svg +0 -0
  113. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_difference.svg +0 -0
  114. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_efficiency.svg +0 -0
  115. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_only_efficiency.svg +0 -0
  116. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_pull.svg +0 -0
  117. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_ratio.svg +0 -0
  118. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_relative_difference.svg +0 -0
  119. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_comparison_split_ratio.svg +0 -0
  120. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_elt1.svg +0 -0
  121. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_elt1_stacked.svg +0 -0
  122. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_elt2.svg +0 -0
  123. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_fct.svg +0 -0
  124. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_fct_stacked.svg +0 -0
  125. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_hist_simple.svg +0 -0
  126. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_int_category.svg +0 -0
  127. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_profile.svg +0 -0
  128. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_side_by_side.svg +0 -0
  129. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_side_by_side_with_numbers.svg +0 -0
  130. {plothist-1.3.2 → plothist-1.4.0}/docs/img/1d_str_category.svg +0 -0
  131. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_correlations_0.svg +0 -0
  132. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_correlations_1.svg +0 -0
  133. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_correlations_2.svg +0 -0
  134. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_simple.svg +0 -0
  135. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_simple_discrete_colormap.svg +0 -0
  136. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_uneven.svg +0 -0
  137. {plothist-1.3.2 → plothist-1.4.0}/docs/img/2d_hist_with_projections.svg +0 -0
  138. {plothist-1.3.2 → plothist-1.4.0}/docs/img/add_text_example.svg +0 -0
  139. {plothist-1.3.2 → plothist-1.4.0}/docs/img/asymmetry_comparison_advanced.svg +0 -0
  140. {plothist-1.3.2 → plothist-1.4.0}/docs/img/matplotlib_example.svg +0 -0
  141. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_all_comparisons.svg +0 -0
  142. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_all_comparisons_no_model_unc.svg +0 -0
  143. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_examples_flatten2D.svg +0 -0
  144. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_examples_pull.svg +0 -0
  145. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_examples_pull_no_model_unc.svg +0 -0
  146. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_examples_stacked.svg +0 -0
  147. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_examples_stacked_unstacked.svg +0 -0
  148. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_examples_unstacked.svg +0 -0
  149. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_with_stacked_and_unstacked_function_components.svg +0 -0
  150. {plothist-1.3.2 → plothist-1.4.0}/docs/img/model_with_stacked_and_unstacked_histograms_components.svg +0 -0
  151. {plothist-1.3.2 → plothist-1.4.0}/docs/img/plothist_example.svg +0 -0
  152. {plothist-1.3.2 → plothist-1.4.0}/docs/img/pyhf_example.svg +0 -0
  153. {plothist-1.3.2 → plothist-1.4.0}/docs/img/ratio_data_vs_model_with_stacked_and_unstacked_function_components.svg +0 -0
  154. {plothist-1.3.2 → plothist-1.4.0}/docs/img/savefig_comparisons.gif +0 -0
  155. {plothist-1.3.2 → plothist-1.4.0}/docs/img/usage_YlGnBu_r_palette.svg +0 -0
  156. {plothist-1.3.2 → plothist-1.4.0}/docs/img/usage_colorpalette_examples.svg +0 -0
  157. {plothist-1.3.2 → plothist-1.4.0}/docs/img/usage_coolwarm_palette.svg +0 -0
  158. {plothist-1.3.2 → plothist-1.4.0}/docs/img/usage_cubehelix.svg +0 -0
  159. {plothist-1.3.2 → plothist-1.4.0}/docs/img/usage_style_cycle.svg +0 -0
  160. {plothist-1.3.2 → plothist-1.4.0}/docs/img/usage_viridis_palette.svg +0 -0
  161. {plothist-1.3.2 → plothist-1.4.0}/docs/usage/plot_fitting_results.rst +0 -0
  162. {plothist-1.3.2 → plothist-1.4.0}/docs/usage/style.rst +0 -0
  163. {plothist-1.3.2 → plothist-1.4.0}/docs/usage/utilities.rst +0 -0
  164. {plothist-1.3.2 → plothist-1.4.0}/src/plothist/default_style.mplstyle +0 -0
@@ -4,7 +4,7 @@ updates:
4
4
  - package-ecosystem: "github-actions"
5
5
  directory: "/"
6
6
  schedule:
7
- interval: "weekly"
7
+ interval: "monthly"
8
8
  groups:
9
9
  actions:
10
10
  patterns:
@@ -25,7 +25,7 @@ jobs:
25
25
  python-version: ${{ matrix.python-version }}
26
26
 
27
27
  - name: Install the project
28
- run: uv sync --all-extras --dev
28
+ run: uv sync --group dev --group test
29
29
 
30
30
  - name: Run pre-commit
31
31
  run: |
@@ -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@v5
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,6 +4,8 @@ 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
9
11
 
@@ -14,3 +16,6 @@ docs/examples/*/*.svg
14
16
  example_gallery/
15
17
  .svg_metadata.yaml
16
18
  tests/*.yaml
19
+
20
+ # Version file
21
+ _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.11.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.31.3
48
+ hooks:
49
+ - id: check-github-workflows
50
+ args: ["--verbose"]
51
+
52
+ - repo: https://github.com/pre-commit/mirrors-mypy
53
+ rev: v1.15.0
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.32.1
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.02.24
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-2024, Cyrille Praz, Tristan Fillinger
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.2
3
+ Version: 1.4.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| |Code style: black|
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
- .. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
85
- :target: https://github.com/psf/black
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| |Code style: black|
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
- .. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
55
- :target: https://github.com/psf/black
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,6 @@
1
+ comment: false
2
+
3
+ github_checks: false
4
+
5
+ ignore:
6
+ - "src/plothist/scripts"
@@ -0,0 +1,77 @@
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
+
64
+ Linters and Formatters
65
+ ----------------------
66
+
67
+ ``plothist`` uses `pre-commit <https://pre-commit.com/>`_ to manage linters and formatters.
68
+
69
+ 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``.
70
+
71
+ Use ``nox -s lint`` to run the linters and formatters.
72
+
73
+ 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`):
74
+
75
+ .. code-block:: console
76
+
77
+ 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 plothist import get_dummy_data
11
+ from plothist_utils import get_dummy_data
12
12
 
13
13
  df = get_dummy_data()
14
14
 
@@ -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 plothist import get_dummy_data
13
+ from plothist_utils import get_dummy_data
14
14
 
15
15
  df = get_dummy_data()
16
16
 
@@ -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 plothist import get_dummy_data
11
+ from plothist_utils import get_dummy_data
12
12
 
13
13
  df = get_dummy_data()
14
14
 
@@ -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 plothist import get_dummy_data
11
+ from plothist_utils import get_dummy_data
12
12
 
13
13
  df = get_dummy_data()
14
14
 
@@ -249,7 +249,7 @@ Integer category
249
249
 
250
250
  .. note::
251
251
  When we create the histograms in this example, we use the argument ``storage=bh.storage.Weight()``.
252
- This is because the functions in ``plothist`` assume histograms with a storage that supports weighted data, where the variance of each bin is tracked (more details `here <https://boost-histogram.readthedocs.io/en/latest/user-guide/storage.html#weight>`_ and `there <https://boost-histogram.readthedocs.io/en/latest/api/boost_histogram.html#boost_histogram._internal.hist.Histogram.variances>`_).
252
+ This is because the functions in ``plothist`` assume histograms with a storage that supports weighted data, where the variance of each bin is tracked (more details `here <https://boost-histogram.readthedocs.io/en/latest/user-guide/storage.html#weight>`_ and `there <https://boost-histogram.readthedocs.io/en/latest/api/boost_histogram.html#boost_histogram.histogram.Histogram.variances>`_).
253
253
  When creating histograms with regular or variable axes with the function :func:`make_hist() <plothist.histogramming.make_hist>`, as in most of the previous examples, the storage is automatically set to ``bh.storage.Weight()``, so the user does not have to worry about it.
254
254
 
255
255
 
@@ -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 plothist import get_dummy_data
11
+ from plothist_utils import get_dummy_data
12
12
 
13
13
  df = get_dummy_data()
14
14
 
@@ -1,4 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ import sys
2
+
3
+ import plothist
4
+
2
5
  #
3
6
  # Configuration file for the Sphinx documentation builder.
4
7
  #
@@ -12,24 +15,17 @@
12
15
  # add these directories to sys.path here. If the directory is relative to the
13
16
  # documentation root, use os.path.abspath to make it absolute, like shown here.
14
17
  #
15
- import sys
16
-
17
-
18
18
  # -- Project information -----------------------------------------------------
19
19
 
20
- import subprocess
21
-
22
- subprocess.check_call(["flit", "install", "-s"], cwd="../")
23
-
24
20
  project = "plothist"
25
- copyright = "2023-2024, Cyrille Praz, Tristan Fillinger"
21
+ copyright = "2023-2025, Cyrille Praz, Tristan Fillinger"
26
22
  author = "Cyrille Praz, Tristan Fillinger"
27
23
 
24
+ parts = plothist.__version__.split(".")
28
25
  # The short X.Y version
29
- version = "1.3.2"
26
+ version = ".".join(parts[:2])
30
27
  # The full version, including alpha/beta/rc tags
31
- release = "1.3.2"
32
-
28
+ release = ".".join(parts)
33
29
 
34
30
  # -- General configuration ---------------------------------------------------
35
31
 
@@ -47,6 +43,7 @@ extensions = [
47
43
  "sphinx.ext.viewcode",
48
44
  "sphinx_gallery.gen_gallery",
49
45
  "sphinx.ext.intersphinx",
46
+ "sphinx_copybutton",
50
47
  ]
51
48
 
52
49
  # Add any paths that contain templates here, relative to this directory.
@@ -179,7 +176,7 @@ def reset_mpl(gallery_conf, fname):
179
176
  from sphinx_gallery.scrapers import matplotlib_scraper
180
177
 
181
178
 
182
- class matplotlib_svg_scraper(object):
179
+ class matplotlib_svg_scraper:
183
180
  def __repr__(self):
184
181
  return self.__class__.__name__
185
182
 
@@ -213,6 +210,6 @@ sphinx_gallery_conf = {
213
210
 
214
211
  # configuration for intersphinx: refer to the Python standard library.
215
212
  intersphinx_mapping = {
216
- "python": ("https://docs.python.org/{.major}".format(sys.version_info), None),
213
+ "python": (f"https://docs.python.org/{sys.version_info.major}", None),
217
214
  "matplotlib": ("https://matplotlib.org/", None),
218
215
  }
@@ -1,27 +1,20 @@
1
+
2
+
3
+ ===============
4
+ Troubleshooting
5
+ ===============
6
+
1
7
  .. _usage-fonts-label:
2
8
 
3
- =================
4
9
  Font installation
5
10
  =================
6
11
 
7
- Standard installation
8
- =====================
9
-
10
12
  Latin Modern fonts are used by default (Latin Modern Math, Latin Modern Roman, Latin Modern Sans).
11
13
 
12
- On Linux/Ubuntu/MacOS, after installing ``plothist``, you can install the fonts by running on your terminal:
13
-
14
- .. code-block:: bash
15
-
16
- install_latin_modern_fonts
17
-
18
- Try to restart your python session and run ``import plothist`` again. If no warning is raised, the fonts are installed correctly and you can skip the rest of this section.
14
+ The fonts are stored in the |plothist_utils|_, which is a dependency of ``plothist``. The fonts are automatically registered within ``matplotlib`` whenever ``plothist`` is imported in a script.
19
15
 
20
- Troubleshooting
21
- ===============
22
-
23
- Fail to download the fonts
24
- --------------------------
16
+ .. |plothist_utils| replace:: ``plothist_utils`` package
17
+ .. _plothist_utils: https://github.com/0ctagon/plothist_utils
25
18
 
26
19
  If a font is not correctly installed, you can try to install it manually. You can download the fonts from the following links:
27
20
 
@@ -65,37 +58,3 @@ The last step is to delete the cache of matplotlib by running in a python consol
65
58
  cache_files = PosixPath(matplotlib.get_cachedir()).glob("fontlist-v???.json")
66
59
  for cache_file in cache_files:
67
60
  subprocess.run(["rm", "-v", cache_file])
68
-
69
-
70
- Command not found
71
- -----------------
72
-
73
- If the command doesn't exist, you can run the script manually. First you need to get the folder where ``plothist`` is installed. You can do this by running in a python console:
74
-
75
- .. code-block:: python
76
-
77
- import plothist
78
-
79
- plothist.__file__
80
-
81
- # > '/path/to/plothist/__init__.py'
82
-
83
- Then you can run the following command in a terminal:
84
-
85
- .. code-block:: bash
86
-
87
- python3 /path/to/plothist/scripts/install_latin_modern_fonts.py
88
-
89
-
90
- Font not used by matplotlib
91
- ---------------------------
92
-
93
- It was observed in some cases that, after running ``install_latin_modern_fonts``, you may need to move the font files ``latinmodern-math.otf``, ``latin-modern-roman/`` and ``latin-modern-sans/`` from ``~/.fonts/`` into another folder. To get an idea of where the fonts are installed on your system, you can run the following commands in a python console:
94
-
95
- .. code-block:: python
96
-
97
- from matplotlib import font_manager
98
-
99
- font_manager.findSystemFonts(fontpaths=None, fontext="ttf")
100
-
101
- Make also sure to delete the cache of matplotlib, otherwise the fonts may not be loaded correctly.
@@ -6,9 +6,10 @@ Plot a 1D function with ``plot_function()``.
6
6
  """
7
7
 
8
8
  ###
9
- from plothist import plot_function
10
- from scipy.stats import norm
11
9
  from matplotlib import pyplot as plt
10
+ from scipy.stats import norm
11
+
12
+ from plothist import plot_function
12
13
 
13
14
 
14
15
  # Define the gaussian function of mean=0.5 and std_dev=3
@@ -14,10 +14,10 @@ def f(x):
14
14
 
15
15
 
16
16
  ###
17
- from plothist import plot_function
18
- from scipy.stats import norm
19
17
  from matplotlib import pyplot as plt
20
18
 
19
+ from plothist import plot_function
20
+
21
21
 
22
22
  # Another function
23
23
  def g(x):
@@ -5,7 +5,7 @@ Asymmetry
5
5
  Compare two 1D histograms using the asymmetry comparison [(h1-h2)/(h1+h2)].
6
6
  """
7
7
 
8
- from plothist import get_dummy_data
8
+ from plothist_utils import get_dummy_data
9
9
 
10
10
  df = get_dummy_data()
11
11
 
@@ -14,7 +14,7 @@ name = "variable_1"
14
14
  x1 = df[name][df["category"] == 2]
15
15
  x2 = df[name][df["category"] == 3]
16
16
 
17
- x_range = (min(min(x1), min(x2)), max(max(x1), max(x2)))
17
+ x_range = (min(*x1, *x2), max(*x1, *x2))
18
18
 
19
19
  from plothist import make_hist
20
20
 
@@ -5,7 +5,7 @@ Difference
5
5
  Compare two 1D histograms using the difference [h1-h2].
6
6
  """
7
7
 
8
- from plothist import get_dummy_data
8
+ from plothist_utils import get_dummy_data
9
9
 
10
10
  df = get_dummy_data()
11
11
 
@@ -14,7 +14,7 @@ name = "variable_1"
14
14
  x1 = df[name][df["category"] == 2]
15
15
  x2 = df[name][df["category"] == 3]
16
16
 
17
- x_range = (min(min(x1), min(x2)), max(max(x1), max(x2)))
17
+ x_range = (min(*x1, *x2), max(*x1, *x2))
18
18
 
19
19
  from plothist import make_hist
20
20
 
@@ -22,7 +22,7 @@ h1 = make_hist(x1, bins=50, range=x_range)
22
22
  h2 = make_hist(x2, bins=50, range=x_range)
23
23
 
24
24
  ###
25
- from plothist import plot_two_hist_comparison, add_text
25
+ from plothist import add_text, plot_two_hist_comparison
26
26
 
27
27
  fig, ax_main, ax_comparison = plot_two_hist_comparison(
28
28
  h1,
@@ -5,7 +5,7 @@ Efficiency
5
5
  Compare the ratio between two histograms h1 and h2 when the entries of h1 are a subset of the entries of h2.
6
6
  """
7
7
 
8
- from plothist import get_dummy_data
8
+ from plothist_utils import get_dummy_data
9
9
 
10
10
  df = get_dummy_data()
11
11
 
@@ -5,7 +5,7 @@ Comparison
5
5
  Plot the comparison between two 1D histograms.
6
6
  """
7
7
 
8
- from plothist import get_dummy_data
8
+ from plothist_utils import get_dummy_data
9
9
 
10
10
  df = get_dummy_data()
11
11
 
@@ -23,6 +23,7 @@ h_total = make_hist(x_total, bins=50, range=x_range)
23
23
 
24
24
  ###
25
25
  import matplotlib.pyplot as plt
26
+
26
27
  from plothist import plot_comparison
27
28
 
28
29
  fig, ax = plt.subplots()