DaSPi 2.5.0__tar.gz → 2.6.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 (186) hide show
  1. {daspi-2.5.0 → daspi-2.6.0}/PKG-INFO +1 -1
  2. {daspi-2.5.0 → daspi-2.6.0}/daspi/__init__.py +6 -0
  3. {daspi-2.5.0 → daspi-2.6.0}/daspi/anova/model.py +3 -2
  4. {daspi-2.5.0 → daspi-2.6.0}/daspi/constants.py +21 -0
  5. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/chart.py +9 -0
  6. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/plotter.py +371 -0
  7. {daspi-2.5.0 → daspi-2.6.0}/daspi/strings.py +15 -0
  8. {daspi-2.5.0 → daspi-2.6.0}/pyproject.toml +1 -1
  9. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_alignments_basic.png +0 -0
  10. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_all_alignments.png +0 -0
  11. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_angles_basic.png +0 -0
  12. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_callable_formatters.png +0 -0
  13. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_combined_all_features.png +0 -0
  14. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_extreme_angles.png +0 -0
  15. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_formatters_basic.png +0 -0
  16. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_formatters_scientific.png +0 -0
  17. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_multivariate_formatting.png +0 -0
  18. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_orientation_mapping.png +0 -0
  19. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Formatting_Features_Test_percentage_formatter.png +0 -0
  20. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_comparison_with_violin.png +0 -0
  21. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_custom_color.png +0 -0
  22. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_custom_width.png +0 -0
  23. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_joint_chart_mixed_plots.png +0 -0
  24. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_multivariate_chart_facets.png +0 -0
  25. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_resolution_high.png +0 -0
  26. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_horizontal.png +0 -0
  27. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_no_fade.png +0 -0
  28. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_no_fill.png +0 -0
  29. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_simple.png +0 -0
  30. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_with_hue.png +0 -0
  31. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_bar_stacking.png +0 -0
  32. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_pareto_marked.png +0 -0
  33. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_probability_dists-prob.png +0 -0
  34. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_regression_kde.png +0 -0
  35. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/MultivariateChart_full-stripes.png +0 -0
  36. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/MultivariateChart_full.png +0 -0
  37. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_bivariate-univariate-charts_contour-mean-test.png +0 -0
  38. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_bivariate-univariate-charts_mean-test.png +0 -0
  39. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_bivariate-univariate-charts_simple.png +0 -0
  40. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_bivariate-univariate-charts_smoothed.png +0 -0
  41. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_bivariate-univariate-charts_user.png +0 -0
  42. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_goodness_of_fit_charts_basic.png +0 -0
  43. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_goodness_of_fit_charts_refit-epoch-7.png +0 -0
  44. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_pair_comparison_charts_basic.png +0 -0
  45. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_parameter_relevance_charts_basic.png +0 -0
  46. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_process-capabity-analysis-charts_hue.png +0 -0
  47. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_residual_charts_basic.png +0 -0
  48. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_KDE-cumulative_multiple.png +0 -0
  49. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_KDE_multiple.png +0 -0
  50. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_KDE_ridge.png +0 -0
  51. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_beeswarm_multiple.png +0 -0
  52. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_beeswarm_simple.png +0 -0
  53. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_blandaltman_simple.png +0 -0
  54. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_blandaltman_user.png +0 -0
  55. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_box_fill.png +0 -0
  56. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_box_multiple.png +0 -0
  57. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_box_simple.png +0 -0
  58. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_categorical-float-features_simple.png +0 -0
  59. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_errorbar_mean-test.png +0 -0
  60. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_errorbar_sem.png +0 -0
  61. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_errorbar_std-test.png +0 -0
  62. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_errorbar_var-test.png +0 -0
  63. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_fitted-density_cdf-multiple.png +0 -0
  64. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_jitter_multiple.png +0 -0
  65. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_jitter_simple.png +0 -0
  66. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_line_hue.png +0 -0
  67. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_line_hue_size.png +0 -0
  68. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_pareto-threshold_simple.png +0 -0
  69. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_pareto_simple.png +0 -0
  70. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_pareto_transposed.png +0 -0
  71. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_quantiles_multiple.png +0 -0
  72. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_quantiles_simple.png +0 -0
  73. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_full.png +0 -0
  74. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_hue-shape.png +0 -0
  75. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_hue-size.png +0 -0
  76. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_hue.png +0 -0
  77. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_shape.png +0 -0
  78. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_size-shape.png +0 -0
  79. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_size.png +0 -0
  80. daspi-2.6.0/tests/charts/SingleChart_smoothing_ma-ema.png +0 -0
  81. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violin_mono.png +0 -0
  82. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violin_multiple.png +0 -0
  83. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violin_simple.png +0 -0
  84. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_plotter_test.py +151 -0
  85. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_visual_test.py +35 -0
  86. daspi-2.5.0/tests/charts/_debug_kde_bottom_crop.png +0 -0
  87. daspi-2.5.0/tests/charts/_debug_violin_bottom_crop.png +0 -0
  88. daspi-2.5.0/tests/charts/_debug_violin_top_crop.png +0 -0
  89. {daspi-2.5.0 → daspi-2.6.0}/LICENSE +0 -0
  90. {daspi-2.5.0 → daspi-2.6.0}/README.md +0 -0
  91. {daspi-2.5.0 → daspi-2.6.0}/daspi/_typing.py +0 -0
  92. {daspi-2.5.0 → daspi-2.6.0}/daspi/_version.py +0 -0
  93. {daspi-2.5.0 → daspi-2.6.0}/daspi/anova/__init__.py +0 -0
  94. {daspi-2.5.0 → daspi-2.6.0}/daspi/anova/convert.py +0 -0
  95. {daspi-2.5.0 → daspi-2.6.0}/daspi/anova/tables.py +0 -0
  96. {daspi-2.5.0 → daspi-2.6.0}/daspi/config.py +0 -0
  97. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/__init__.py +0 -0
  98. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/ancova.csv +0 -0
  99. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/anova.csv +0 -0
  100. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/anova2.csv +0 -0
  101. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/anova2_unbalanced.csv +0 -0
  102. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/anova3.csv +0 -0
  103. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/anova3_unbalanced.csv +0 -0
  104. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/carpet_full-factorial.csv +0 -0
  105. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/covariate.csv +0 -0
  106. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/drop_card.csv +0 -0
  107. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/eeprom_full-factorial.csv +0 -0
  108. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/eeprom_partial-factorial.csv +0 -0
  109. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/grnr_adjustment.csv +0 -0
  110. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/grnr_layer_thickness.csv +0 -0
  111. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/grnr_spc.csv +0 -0
  112. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/iris.csv +0 -0
  113. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/mpg.csv +0 -0
  114. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/painkillers-dissolution.csv +0 -0
  115. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/partial_factorial.csv +0 -0
  116. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/penguins.csv +0 -0
  117. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/process_capability.mpx +0 -0
  118. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/salt_sticks.csv +0 -0
  119. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/shoe-sole.csv +0 -0
  120. {daspi-2.5.0 → daspi-2.6.0}/daspi/datasets/tips.csv +0 -0
  121. {daspi-2.5.0 → daspi-2.6.0}/daspi/doe/__init__.py +0 -0
  122. {daspi-2.5.0 → daspi-2.6.0}/daspi/doe/build.py +0 -0
  123. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/__init__.py +0 -0
  124. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/appearance.py +0 -0
  125. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/classify.py +0 -0
  126. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/facets.py +0 -0
  127. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/precast.py +0 -0
  128. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/styles/daspi-dark.mplstyle +0 -0
  129. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/styles/daspi.mplstyle +0 -0
  130. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/styles/ggplot2.mplstyle +0 -0
  131. {daspi-2.5.0 → daspi-2.6.0}/daspi/plotlib/styles/seaborn.mplstyle +0 -0
  132. {daspi-2.5.0 → daspi-2.6.0}/daspi/requirements.txt +0 -0
  133. {daspi-2.5.0 → daspi-2.6.0}/daspi/statistics/__init__.py +0 -0
  134. {daspi-2.5.0 → daspi-2.6.0}/daspi/statistics/confidence.py +0 -0
  135. {daspi-2.5.0 → daspi-2.6.0}/daspi/statistics/estimation.py +0 -0
  136. {daspi-2.5.0 → daspi-2.6.0}/daspi/statistics/hypothesis.py +0 -0
  137. {daspi-2.5.0 → daspi-2.6.0}/daspi/statistics/montecarlo.py +0 -0
  138. {daspi-2.5.0 → daspi-2.6.0}/tests/ANOVA_SS_Fehler.mpx +0 -0
  139. {daspi-2.5.0 → daspi-2.6.0}/tests/ANOVA_SS_Fehler.mpx.bak +0 -0
  140. {daspi-2.5.0 → daspi-2.6.0}/tests/GageRnR.mpx +0 -0
  141. {daspi-2.5.0 → daspi-2.6.0}/tests/GageRnR.mpx.bak +0 -0
  142. {daspi-2.5.0 → daspi-2.6.0}/tests/__init__.py +0 -0
  143. {daspi-2.5.0 → daspi-2.6.0}/tests/anova_convert_test.py +0 -0
  144. {daspi-2.5.0 → daspi-2.6.0}/tests/anova_model_test.py +0 -0
  145. {daspi-2.5.0 → daspi-2.6.0}/tests/anova_tables_test.py +0 -0
  146. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_kdes_kde-mean.png +0 -0
  147. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_kdes_mixed-kde.png +0 -0
  148. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/JointChart_probability_norm-prob.png +0 -0
  149. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_gage_rnr_model_basic.png +0 -0
  150. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/Precasts_gage_study_model_basic.png +0 -0
  151. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_KDE-cumulative_simple.png +0 -0
  152. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_KDE_simple.png +0 -0
  153. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_fitted-density_pdf-data.png +0 -0
  154. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_fitted-density_pdf-norm.png +0 -0
  155. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_simple-stripes-65ci.png +0 -0
  156. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_simple-stripes-99ci.png +0 -0
  157. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_simple-stripes.png +0 -0
  158. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_simple.png +0 -0
  159. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_scatter_transposed.png +0 -0
  160. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violine-contour_simple.png +0 -0
  161. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violine_mono.png +0 -0
  162. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violine_multiple.png +0 -0
  163. {daspi-2.5.0 → daspi-2.6.0}/tests/charts/SingleChart_violine_simple.png +0 -0
  164. {daspi-2.5.0 → daspi-2.6.0}/tests/config_test.py +0 -0
  165. {daspi-2.5.0 → daspi-2.6.0}/tests/data/anova3_result.csv +0 -0
  166. {daspi-2.5.0 → daspi-2.6.0}/tests/data/dists_10-samples.csv +0 -0
  167. {daspi-2.5.0 → daspi-2.6.0}/tests/data/dists_25-samples.csv +0 -0
  168. {daspi-2.5.0 → daspi-2.6.0}/tests/data/gage_rnr.csv +0 -0
  169. {daspi-2.5.0 → daspi-2.6.0}/tests/data/gage_study.csv +0 -0
  170. {daspi-2.5.0 → daspi-2.6.0}/tests/data/generate_dists.py +0 -0
  171. {daspi-2.5.0 → daspi-2.6.0}/tests/data/grnr_d-optimal.csv +0 -0
  172. {daspi-2.5.0 → daspi-2.6.0}/tests/data/uncertainties.csv +0 -0
  173. {daspi-2.5.0 → daspi-2.6.0}/tests/doe_build_test.py +0 -0
  174. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_appearance_test.py +0 -0
  175. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_chart_test.py +0 -0
  176. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_classify_test.py +0 -0
  177. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_facets_test.py +0 -0
  178. {daspi-2.5.0 → daspi-2.6.0}/tests/plotlib_templates_test.py +0 -0
  179. {daspi-2.5.0 → daspi-2.6.0}/tests/r2_pred.mpx +0 -0
  180. {daspi-2.5.0 → daspi-2.6.0}/tests/r2_pred.mpx.bak +0 -0
  181. {daspi-2.5.0 → daspi-2.6.0}/tests/statistics_confidence_test.py +0 -0
  182. {daspi-2.5.0 → daspi-2.6.0}/tests/statistics_estimation_test.py +0 -0
  183. {daspi-2.5.0 → daspi-2.6.0}/tests/statistics_hypothesis_test.py +0 -0
  184. {daspi-2.5.0 → daspi-2.6.0}/tests/statistics_montecarlo_test.py +0 -0
  185. {daspi-2.5.0 → daspi-2.6.0}/tests/strings_test.py +0 -0
  186. {daspi-2.5.0 → daspi-2.6.0}/tests/test_full_factorial_design_builder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DaSPi
3
- Version: 2.5.0
3
+ Version: 2.6.0
4
4
  Summary: Visualize and analyze your data with DaSPi. This package is designed for users who want to find relevant influencing factors in processes and validate improvements.
5
5
  Author-Email: Reto Jäggli <reto@jaeggli.email>
6
6
  License: MIT
@@ -80,6 +80,7 @@ if TYPE_CHECKING:
80
80
  ConfidenceInterval,
81
81
  DensityCurve,
82
82
  ErrorBar,
83
+ ExponentialSmoothingLine,
83
84
  FittedDensity,
84
85
  GaussianKDE,
85
86
  GaussianKDEContour,
@@ -90,6 +91,7 @@ if TYPE_CHECKING:
90
91
  LinearRegressionLine,
91
92
  LoessLine,
92
93
  MeanTest,
94
+ MovingAverageLine,
93
95
  ParallelCoordinate,
94
96
  Pareto,
95
97
  Plotter,
@@ -240,6 +242,7 @@ _LAZY_SUBMODULES: dict[str, str] = {
240
242
  'ConfidenceInterval': '.plotlib.plotter',
241
243
  'DensityCurve': '.plotlib.plotter',
242
244
  'ErrorBar': '.plotlib.plotter',
245
+ 'ExponentialSmoothingLine': '.plotlib.plotter',
243
246
  'FittedDensity': '.plotlib.plotter',
244
247
  'GaussianKDE': '.plotlib.plotter',
245
248
  'GaussianKDEContour': '.plotlib.plotter',
@@ -250,6 +253,7 @@ _LAZY_SUBMODULES: dict[str, str] = {
250
253
  'LinearRegressionLine': '.plotlib.plotter',
251
254
  'LoessLine': '.plotlib.plotter',
252
255
  'MeanTest': '.plotlib.plotter',
256
+ 'MovingAverageLine': '.plotlib.plotter',
253
257
  'ParallelCoordinate': '.plotlib.plotter',
254
258
  'Pareto': '.plotlib.plotter',
255
259
  'Plotter': '.plotlib.plotter',
@@ -376,6 +380,7 @@ __all__ = [
376
380
  'DistributionEstimator',
377
381
  'Dodger',
378
382
  'ErrorBar',
383
+ 'ExponentialSmoothingLine',
379
384
  'Factor',
380
385
  'FittedDensity',
381
386
  'FractionalFactorialDesignBuilder',
@@ -404,6 +409,7 @@ __all__ = [
404
409
  'Lowess',
405
410
  'MeanTest',
406
411
  'MeasurementUncertainty',
412
+ 'MovingAverageLine',
407
413
  'MultivariateChart',
408
414
  'GoodnessOfFitCharts',
409
415
  'PairComparisonCharts',
@@ -376,12 +376,13 @@ class LinearModel(BaseHTMLReprModel):
376
376
  covariates=['temperature', 'preparation'],
377
377
  order=2,)
378
378
 
379
- # Store goodnes of fit values for each elimination step
379
+ # Store and visualize goodnes of fit values for each elimination step
380
380
  df_gof = pd.concat(model.recursive_elimination())
381
+ dsp.GoodnessOfFitCharts(df_gof, model).plot().stripes().label(info=True)
381
382
 
382
383
  # Plot residual and parameter relevance analysis
383
384
  dsp.ResidualsCharts(model).plot().stripes().label(info=True)
384
- dsp.ParameterRelevanceCharts(model).plot().label(info=True)
385
+ dsp.ParameterRelevanceCharts(model).plot().stripes().label(info=True)
385
386
 
386
387
  # Get HTML output
387
388
  model
@@ -203,6 +203,12 @@ class _Kw_:
203
203
  """Keyword arguments for confidence interval area for fit."""
204
204
  return {'zorder': 2.2, 'alpha': 0.8, 'marker': ''}
205
205
 
206
+ @property
207
+ def FIT_LINE_HANDLE(self) -> dict[str, Any]:
208
+ """Keyword arguments for the legend handle of a fitted line
209
+ (e.g. `MovingAverageLine`, `ExponentialSmoothingLine`)."""
210
+ return {'lw': LINE.WIDTH, 'alpha': 0.8}
211
+
206
212
  @property
207
213
  def FIT_CI(self) -> dict[str, Any]:
208
214
  """Keyword arguments for confidence interval area for fit."""
@@ -520,6 +526,14 @@ class _Plotter_:
520
526
  SUBGROUP: Literal['_subgroup_'] = '_subgroup_'
521
527
  """Column name for subgroups used mostly in TransformPlotter."""
522
528
 
529
+ SMOOTHED_TARGET: Literal['_smoothed_target_'] = '_smoothed_target_'
530
+ """Column name for smoothed target values (moving average,
531
+ exponential smoothing)."""
532
+
533
+ SMOOTHED_FEATURE: Literal['_smoothed_feature_'] = '_smoothed_feature_'
534
+ """Column name for the feature values matching the smoothed target
535
+ values (moving average, exponential smoothing)."""
536
+
523
537
  @property
524
538
  def REGRESSION_CI_NAMES(self) -> tuple[str, str, str, str]:
525
539
  """Get names for regression confidences in order:
@@ -788,6 +802,13 @@ class _Default_:
788
802
  - 6 = ±3 σ, capturing about 99.7% of the data.
789
803
  """
790
804
 
805
+ MA_WINDOW: Literal[5] = 5
806
+ """Default window size for the `MovingAverageLine` Plotter."""
807
+
808
+ EWM_ALPHA: float = 0.3
809
+ """Default smoothing factor (alpha) for the
810
+ `ExponentialSmoothingLine` Plotter."""
811
+
791
812
  @property
792
813
  def MARKER(self) -> str:
793
814
  """Default marker for scatter plots."""
@@ -62,6 +62,7 @@ import pandas as pd
62
62
  from matplotlib.axes import Axes
63
63
  from matplotlib.axis import XAxis, YAxis
64
64
  from matplotlib.figure import Figure
65
+ from matplotlib.lines import Line2D
65
66
  from matplotlib.ticker import AutoMinorLocator, Formatter
66
67
  from numpy.typing import NDArray
67
68
  from pandas.core.frame import DataFrame
@@ -740,6 +741,14 @@ class SingleChart(Chart):
740
741
  handle_label[self.size] = self.sizing.handles_labels()
741
742
  if hasattr(self, 'stripes_facets'):
742
743
  handle_label[STR['stripes']] = self.stripes_facets.handles_labels()
744
+ smoothers = {
745
+ label: Line2D(
746
+ xdata=[], ydata=[], color=plot.color, **KW.FIT_LINE_HANDLE)
747
+ for plot in self._plots
748
+ if (label := getattr(plot, 'legend_label', None)) is not None}
749
+ if smoothers:
750
+ handle_label[STR['smoothing']] = (
751
+ tuple(smoothers.values()), tuple(smoothers.keys()))
743
752
  return handle_label
744
753
 
745
754
  def _check_current_data_(self) -> bool:
@@ -90,6 +90,7 @@ Control marks:
90
90
  import warnings
91
91
  from abc import ABC, abstractmethod
92
92
  from collections.abc import Callable, Generator, Hashable, Iterable
93
+ from functools import wraps
93
94
  from itertools import cycle
94
95
  from typing import Any, Literal, Self
95
96
 
@@ -147,6 +148,7 @@ __all__ = [
147
148
  'ConfidenceInterval',
148
149
  'DensityCurve',
149
150
  'ErrorBar',
151
+ 'ExponentialSmoothingLine',
150
152
  'FittedDensity',
151
153
  'GaussianKDE',
152
154
  'GaussianKDEContour',
@@ -157,6 +159,7 @@ __all__ = [
157
159
  'LinearRegressionLine',
158
160
  'LoessLine',
159
161
  'MeanTest',
162
+ 'MovingAverageLine',
160
163
  'ParallelCoordinate',
161
164
  'Pareto',
162
165
  'Plotter',
@@ -550,6 +553,25 @@ class Plotter(ABC):
550
553
  self.visible_spines = visible_spines
551
554
  self.hide_axis = hide_axis
552
555
 
556
+ def __init_subclass__(cls, **kwargs) -> None:
557
+ """Wrap every subclass `__call__` so that a `color` override
558
+ passed at call-time (e.g. via `kw_call`) is synced back to
559
+ `self.color`. Without this, artists relying on `self.color`
560
+ after the call (e.g. legend handles) could show a different
561
+ color than the one actually drawn."""
562
+ super().__init_subclass__(**kwargs)
563
+ call = cls.__dict__.get('__call__')
564
+ if call is None:
565
+ return
566
+
567
+ @wraps(call)
568
+ def wrapped_call(self: 'Plotter', *args: Any, **kwds: Any) -> Any:
569
+ if 'color' in kwds:
570
+ self._color = kwds['color']
571
+ return call(self, *args, **kwds)
572
+
573
+ cls.__call__ = wrapped_call
574
+
553
575
  @property
554
576
  def visible_spines(self) -> Literal['target', 'feature', 'none'] | None:
555
577
  """Get which spines are visible if specified.
@@ -1680,6 +1702,355 @@ class LoessLine(Plotter):
1680
1702
  self.ax.fill_betweenx(self.y, lower, upper, **_kw_fit_ci)
1681
1703
 
1682
1704
 
1705
+ class MovingAverageLine(Plotter):
1706
+ """A plotter for a simple moving average (rolling mean) line.
1707
+
1708
+ The feature-grouped data is sorted by the feature column (or by
1709
+ observation order if no feature is given) and smoothed with a
1710
+ rolling mean of the given `window` size. This is useful to
1711
+ highlight the underlying trend of noisy time-ordered or
1712
+ feature-ordered data.
1713
+
1714
+ Parameters
1715
+ ----------
1716
+ source : pandas DataFrame
1717
+ Pandas long format DataFrame containing the data source for the
1718
+ plot.
1719
+ target : str
1720
+ Column name of the target variable for the plot.
1721
+ feature : str, optional
1722
+ Column name of the feature variable for the plot. If not given,
1723
+ the observation order is used instead, by default ''.
1724
+ window : int, optional
1725
+ Size of the rolling window (number of observations) used to
1726
+ calculate the moving average, by default `DEFAULT.MA_WINDOW`.
1727
+ center : bool, optional
1728
+ Whether the window label is set at the center of the window
1729
+ (True) or at the trailing edge (False), by default False.
1730
+ min_periods : int | None, optional
1731
+ Minimum number of observations required within the window to
1732
+ produce a value. If None, defaults to `window`, by default None.
1733
+ target_on_y : bool, optional
1734
+ Flag indicating whether the target variable is plotted on the
1735
+ y-axis, by default True
1736
+ color : str | None, optional
1737
+ Color to be used to draw the artists. If None, the first
1738
+ color is taken from the color cycle, by default None.
1739
+ marker : str | None, optional
1740
+ The marker style for the individuals. Available markers see:
1741
+ https://matplotlib.org/stable/api/markers_api.html,
1742
+ by default None
1743
+ show_scatter : bool, optional
1744
+ Flag indicating whether to show markers on the smoothed line,
1745
+ by default False.
1746
+ ax : matplotlib.axes.Axes | None, optional
1747
+ The axes object for the plot. If None, the current axes is
1748
+ fetched using `plt.gca()`. If no axes are available, a new one
1749
+ is created. Defaults to None.
1750
+ visible_spines : Literal['target', 'feature', 'none'] | None, optional
1751
+ Specifies which spines are visible, the others are hidden.
1752
+ If 'none', no spines are visible. If None, the spines are drawn
1753
+ according to the stylesheet. Defaults to None.
1754
+ hide_axis : Literal['target', 'feature', 'both'] | None, optional
1755
+ Specifies which axes should be hidden. If None, both axes
1756
+ are displayed. Defaults to None.
1757
+ **kwds:
1758
+ Those arguments have no effect. Only serves to catch further
1759
+ arguments that have no use here (occurs when this class is
1760
+ used within chart objects).
1761
+
1762
+ Examples
1763
+ --------
1764
+ Apply to an existing Axes object:
1765
+
1766
+ ```python
1767
+ import numpy as np
1768
+ import pandas as pd
1769
+ import matplotlib.pyplot as plt
1770
+ from daspi import MovingAverageLine
1771
+
1772
+ fig, ax = plt.subplots()
1773
+ x = np.arange(100)
1774
+ df = pd.DataFrame(dict(x=x, y=np.sin(x / 5) + np.random.normal(0, 0.3, 100)))
1775
+ ma_line = MovingAverageLine(source=df, target='y', feature='x', window=7, ax=ax)
1776
+ ma_line(color='firebrick')
1777
+ ```
1778
+
1779
+ Apply using the plot method of a DaSPi Chart object:
1780
+
1781
+ ```python
1782
+ import numpy as np
1783
+ import daspi as dsp
1784
+ import pandas as pd
1785
+
1786
+ x = np.arange(100)
1787
+ df = pd.DataFrame(dict(x=x, y=np.sin(x / 5) + np.random.normal(0, 0.3, 100)))
1788
+ chart = dsp.SingleChart(
1789
+ source=df,
1790
+ target='y',
1791
+ feature='x'
1792
+ ).plot(
1793
+ dsp.Scatter,
1794
+ ).plot(
1795
+ dsp.MovingAverageLine,
1796
+ window=7,
1797
+ kw_call=dict(color='firebrick'))
1798
+ ```
1799
+ """
1800
+ __slots__ = ('center', 'legend_label', 'min_periods', 'show_scatter', 'window')
1801
+
1802
+ window: int
1803
+ """Size of the rolling window used to calculate the moving
1804
+ average."""
1805
+ center: bool
1806
+ """Whether the window label is set at the center of the window."""
1807
+ min_periods: int | None
1808
+ """Minimum number of observations required within the window to
1809
+ produce a value."""
1810
+ show_scatter: bool
1811
+ """Whether to show markers on the smoothed line."""
1812
+ legend_label: str
1813
+ """Legend hint stating the moving average window size, e.g.
1814
+ 'MA (n=7)'. Used by `Chart` to build a legend entry for this
1815
+ plotter."""
1816
+
1817
+ def __init__(
1818
+ self,
1819
+ source: DataFrame,
1820
+ target: str,
1821
+ feature: str = '',
1822
+ window: int = DEFAULT.MA_WINDOW,
1823
+ center: bool = False,
1824
+ min_periods: int | None = None,
1825
+ target_on_y: bool = True,
1826
+ color: str | None = None,
1827
+ marker: str | None = None,
1828
+ show_scatter: bool = False,
1829
+ ax: Axes | None = None,
1830
+ visible_spines: Literal['target', 'feature', 'none'] | None = None,
1831
+ hide_axis: Literal['target', 'feature', 'both'] | None = None,
1832
+ **kwds) -> None:
1833
+ self.window = window
1834
+ self.center = center
1835
+ self.min_periods = min_periods
1836
+ self.show_scatter = show_scatter
1837
+ self.legend_label = f'{STR["moving_average"]} (n={window})'
1838
+
1839
+ if feature:
1840
+ raw = source[[target, feature]].sort_values(feature)
1841
+ else:
1842
+ raw = source[[target]].copy()
1843
+ raw[PLOTTER.SMOOTHED_FEATURE] = np.arange(len(raw)) + 1
1844
+ feature = PLOTTER.SMOOTHED_FEATURE
1845
+ smoothed = raw[target].rolling(
1846
+ window=window, center=center, min_periods=min_periods).mean()
1847
+ df = pd.DataFrame({
1848
+ PLOTTER.SMOOTHED_TARGET: smoothed.to_numpy(),
1849
+ PLOTTER.SMOOTHED_FEATURE: raw[feature].to_numpy()})
1850
+ super().__init__(
1851
+ source=df,
1852
+ target=PLOTTER.SMOOTHED_TARGET,
1853
+ feature=PLOTTER.SMOOTHED_FEATURE,
1854
+ target_on_y=target_on_y,
1855
+ color=color,
1856
+ marker=marker,
1857
+ ax=ax,
1858
+ visible_spines=visible_spines,
1859
+ hide_axis=hide_axis)
1860
+
1861
+ @property
1862
+ def kw_default(self) -> dict[str, Any]:
1863
+ """Default keyword arguments for plotting (read-only)"""
1864
+ kwds = KW.FIT_LINE | {'color': self.color}
1865
+ return kwds
1866
+
1867
+ def __call__(self, **kwds) -> None:
1868
+ """Perform the moving average line plot operation.
1869
+
1870
+ Parameters
1871
+ ----------
1872
+ **kwds :
1873
+ Additional keyword arguments to be passed to the Axes `plot`
1874
+ method.
1875
+ """
1876
+ marker = self.marker if self.show_scatter else ''
1877
+ _kwds: dict[str, Any] = self.kw_default | {'marker': marker} | kwds
1878
+ self.ax.plot(self.x, self.y, **_kwds)
1879
+
1880
+
1881
+ class ExponentialSmoothingLine(Plotter):
1882
+ """A plotter for an exponentially weighted moving average line.
1883
+
1884
+ The feature-grouped data is sorted by the feature column (or by
1885
+ observation order if no feature is given) and smoothed using
1886
+ pandas' exponentially weighted mean (`Series.ewm`). Compared to
1887
+ `MovingAverageLine`, recent observations are weighted more heavily
1888
+ the larger `alpha` is, instead of weighting every observation inside
1889
+ a fixed window equally.
1890
+
1891
+ Parameters
1892
+ ----------
1893
+ source : pandas DataFrame
1894
+ Pandas long format DataFrame containing the data source for the
1895
+ plot.
1896
+ target : str
1897
+ Column name of the target variable for the plot.
1898
+ feature : str, optional
1899
+ Column name of the feature variable for the plot. If not given,
1900
+ the observation order is used instead, by default ''.
1901
+ alpha : float, optional
1902
+ The smoothing factor, between 0 (exclusive) and 1 (inclusive).
1903
+ Higher values discount older observations faster (less
1904
+ smoothing), by default `DEFAULT.EWM_ALPHA`.
1905
+ adjust : bool, optional
1906
+ Whether to use the adjusted (unbiased for the first
1907
+ observations) or the recursive formula for the exponentially
1908
+ weighted mean, see pandas `Series.ewm` for details,
1909
+ by default False.
1910
+ target_on_y : bool, optional
1911
+ Flag indicating whether the target variable is plotted on the
1912
+ y-axis, by default True
1913
+ color : str | None, optional
1914
+ Color to be used to draw the artists. If None, the first
1915
+ color is taken from the color cycle, by default None.
1916
+ marker : str | None, optional
1917
+ The marker style for the individuals. Available markers see:
1918
+ https://matplotlib.org/stable/api/markers_api.html,
1919
+ by default None
1920
+ show_scatter : bool, optional
1921
+ Flag indicating whether to show markers on the smoothed line,
1922
+ by default False.
1923
+ ax : matplotlib.axes.Axes | None, optional
1924
+ The axes object for the plot. If None, the current axes is
1925
+ fetched using `plt.gca()`. If no axes are available, a new one
1926
+ is created. Defaults to None.
1927
+ visible_spines : Literal['target', 'feature', 'none'] | None, optional
1928
+ Specifies which spines are visible, the others are hidden.
1929
+ If 'none', no spines are visible. If None, the spines are drawn
1930
+ according to the stylesheet. Defaults to None.
1931
+ hide_axis : Literal['target', 'feature', 'both'] | None, optional
1932
+ Specifies which axes should be hidden. If None, both axes
1933
+ are displayed. Defaults to None.
1934
+ **kwds:
1935
+ Those arguments have no effect. Only serves to catch further
1936
+ arguments that have no use here (occurs when this class is
1937
+ used within chart objects).
1938
+
1939
+ Examples
1940
+ --------
1941
+ Apply to an existing Axes object:
1942
+
1943
+ ```python
1944
+ import numpy as np
1945
+ import pandas as pd
1946
+ import matplotlib.pyplot as plt
1947
+ from daspi import ExponentialSmoothingLine
1948
+
1949
+ fig, ax = plt.subplots()
1950
+ x = np.arange(100)
1951
+ df = pd.DataFrame(dict(x=x, y=np.sin(x / 5) + np.random.normal(0, 0.3, 100)))
1952
+ ema_line = ExponentialSmoothingLine(
1953
+ source=df, target='y', feature='x', alpha=0.2, ax=ax)
1954
+ ema_line(color='firebrick')
1955
+ ```
1956
+
1957
+ Apply using the plot method of a DaSPi Chart object:
1958
+
1959
+ ```python
1960
+ import numpy as np
1961
+ import daspi as dsp
1962
+ import pandas as pd
1963
+
1964
+ x = np.arange(100)
1965
+ df = pd.DataFrame(dict(x=x, y=np.sin(x / 5) + np.random.normal(0, 0.3, 100)))
1966
+ chart = dsp.SingleChart(
1967
+ source=df,
1968
+ target='y',
1969
+ feature='x'
1970
+ ).plot(
1971
+ dsp.Scatter,
1972
+ ).plot(
1973
+ dsp.ExponentialSmoothingLine,
1974
+ alpha=0.2,
1975
+ kw_call=dict(color='firebrick'))
1976
+ ```
1977
+ """
1978
+ __slots__ = ('adjust', 'alpha', 'legend_label', 'show_scatter')
1979
+
1980
+ alpha: float
1981
+ """The smoothing factor used to calculate the exponentially
1982
+ weighted mean."""
1983
+ adjust: bool
1984
+ """Whether to use the adjusted or recursive exponentially weighted
1985
+ mean formula."""
1986
+ show_scatter: bool
1987
+ """Whether to show markers on the smoothed line."""
1988
+ legend_label: str
1989
+ """Legend hint stating the smoothing factor, e.g. 'EMA (α=0.2)'.
1990
+ Used by `Chart` to build a legend entry for this plotter."""
1991
+
1992
+ def __init__(
1993
+ self,
1994
+ source: DataFrame,
1995
+ target: str,
1996
+ feature: str = '',
1997
+ alpha: float = DEFAULT.EWM_ALPHA,
1998
+ adjust: bool = False,
1999
+ target_on_y: bool = True,
2000
+ color: str | None = None,
2001
+ marker: str | None = None,
2002
+ show_scatter: bool = False,
2003
+ ax: Axes | None = None,
2004
+ visible_spines: Literal['target', 'feature', 'none'] | None = None,
2005
+ hide_axis: Literal['target', 'feature', 'both'] | None = None,
2006
+ **kwds) -> None:
2007
+ assert 0 < alpha <= 1, 'alpha must be between 0 (exclusive) and 1'
2008
+ self.alpha = alpha
2009
+ self.adjust = adjust
2010
+ self.show_scatter = show_scatter
2011
+ self.legend_label = f'{STR["exponential_smoothing"]} (\u03b1={alpha:.2g})'
2012
+
2013
+ if feature:
2014
+ raw = source[[target, feature]].sort_values(feature)
2015
+ else:
2016
+ raw = source[[target]].copy()
2017
+ raw[PLOTTER.SMOOTHED_FEATURE] = np.arange(len(raw)) + 1
2018
+ feature = PLOTTER.SMOOTHED_FEATURE
2019
+ smoothed = raw[target].ewm(alpha=alpha, adjust=adjust).mean()
2020
+ df = pd.DataFrame({
2021
+ PLOTTER.SMOOTHED_TARGET: smoothed.to_numpy(),
2022
+ PLOTTER.SMOOTHED_FEATURE: raw[feature].to_numpy()})
2023
+ super().__init__(
2024
+ source=df,
2025
+ target=PLOTTER.SMOOTHED_TARGET,
2026
+ feature=PLOTTER.SMOOTHED_FEATURE,
2027
+ target_on_y=target_on_y,
2028
+ color=color,
2029
+ marker=marker,
2030
+ ax=ax,
2031
+ visible_spines=visible_spines,
2032
+ hide_axis=hide_axis)
2033
+
2034
+ @property
2035
+ def kw_default(self) -> dict[str, Any]:
2036
+ """Default keyword arguments for plotting (read-only)"""
2037
+ kwds = KW.FIT_LINE | {'color': self.color}
2038
+ return kwds
2039
+
2040
+ def __call__(self, **kwds) -> None:
2041
+ """Perform the exponential smoothing line plot operation.
2042
+
2043
+ Parameters
2044
+ ----------
2045
+ **kwds :
2046
+ Additional keyword arguments to be passed to the Axes `plot`
2047
+ method.
2048
+ """
2049
+ marker = self.marker if self.show_scatter else ''
2050
+ _kwds: dict[str, Any] = self.kw_default | {'marker': marker} | kwds
2051
+ self.ax.plot(self.x, self.y, **_kwds)
2052
+
2053
+
1683
2054
  class Probability(LinearRegressionLine):
1684
2055
  """A Q-Q and P-P probability plotter that extends the
1685
2056
  LinearRegressionLine class.
@@ -96,6 +96,21 @@ class _String_:
96
96
  'de': 'Linien',
97
97
  'fr': 'Lignes'})
98
98
 
99
+ moving_average = _LocalizedString({
100
+ 'en': 'MA',
101
+ 'de': 'GLD',
102
+ 'fr': 'MM'})
103
+
104
+ exponential_smoothing = _LocalizedString({
105
+ 'en': 'EMA',
106
+ 'de': 'EGLD',
107
+ 'fr': 'ME'})
108
+
109
+ smoothing = _LocalizedString({
110
+ 'en': 'Smoothing',
111
+ 'de': 'Glättung',
112
+ 'fr': 'Lissage'})
113
+
99
114
  ci = _LocalizedString({
100
115
  'en': 'CI',
101
116
  'de': 'KI',
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "DaSPi"
3
- version = "2.5.0"
3
+ version = "2.6.0"
4
4
  description = "Visualize and analyze your data with DaSPi. This package is designed for users who want to find relevant influencing factors in processes and validate improvements."
5
5
  authors = [
6
6
  { name = "Reto Jäggli", email = "reto@jaeggli.email" },