DaSPi 2.7.0__tar.gz → 2.8.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 (183) hide show
  1. {daspi-2.7.0 → daspi-2.8.0}/PKG-INFO +1 -1
  2. {daspi-2.7.0 → daspi-2.8.0}/daspi/config.py +36 -5
  3. {daspi-2.7.0 → daspi-2.8.0}/daspi/constants.py +15 -3
  4. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/chart.py +12 -12
  5. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/facets.py +8 -6
  6. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/plotter.py +6 -6
  7. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/precast.py +2 -1
  8. {daspi-2.7.0 → daspi-2.8.0}/daspi/statistics/estimation.py +23 -17
  9. {daspi-2.7.0 → daspi-2.8.0}/pyproject.toml +1 -1
  10. {daspi-2.7.0 → daspi-2.8.0}/tests/statistics_estimation_test.py +2 -1
  11. {daspi-2.7.0 → daspi-2.8.0}/LICENSE +0 -0
  12. {daspi-2.7.0 → daspi-2.8.0}/README.md +0 -0
  13. {daspi-2.7.0 → daspi-2.8.0}/daspi/__init__.py +0 -0
  14. {daspi-2.7.0 → daspi-2.8.0}/daspi/_typing.py +0 -0
  15. {daspi-2.7.0 → daspi-2.8.0}/daspi/_version.py +0 -0
  16. {daspi-2.7.0 → daspi-2.8.0}/daspi/anova/__init__.py +0 -0
  17. {daspi-2.7.0 → daspi-2.8.0}/daspi/anova/convert.py +0 -0
  18. {daspi-2.7.0 → daspi-2.8.0}/daspi/anova/model.py +0 -0
  19. {daspi-2.7.0 → daspi-2.8.0}/daspi/anova/tables.py +0 -0
  20. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/__init__.py +0 -0
  21. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/ancova.csv +0 -0
  22. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/anova.csv +0 -0
  23. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/anova2.csv +0 -0
  24. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/anova2_unbalanced.csv +0 -0
  25. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/anova3.csv +0 -0
  26. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/anova3_unbalanced.csv +0 -0
  27. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/carpet_full-factorial.csv +0 -0
  28. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/covariate.csv +0 -0
  29. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/drop_card.csv +0 -0
  30. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/eeprom_full-factorial.csv +0 -0
  31. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/eeprom_partial-factorial.csv +0 -0
  32. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/grnr_adjustment.csv +0 -0
  33. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/grnr_layer_thickness.csv +0 -0
  34. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/grnr_spc.csv +0 -0
  35. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/iris.csv +0 -0
  36. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/mpg.csv +0 -0
  37. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/painkillers-dissolution.csv +0 -0
  38. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/partial_factorial.csv +0 -0
  39. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/penguins.csv +0 -0
  40. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/process_capability.mpx +0 -0
  41. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/salt_sticks.csv +0 -0
  42. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/shoe-sole.csv +0 -0
  43. {daspi-2.7.0 → daspi-2.8.0}/daspi/datasets/tips.csv +0 -0
  44. {daspi-2.7.0 → daspi-2.8.0}/daspi/doe/__init__.py +0 -0
  45. {daspi-2.7.0 → daspi-2.8.0}/daspi/doe/build.py +0 -0
  46. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/__init__.py +0 -0
  47. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/appearance.py +0 -0
  48. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/classify.py +0 -0
  49. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/styles/daspi-dark.mplstyle +0 -0
  50. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/styles/daspi.mplstyle +0 -0
  51. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/styles/ggplot2.mplstyle +0 -0
  52. {daspi-2.7.0 → daspi-2.8.0}/daspi/plotlib/styles/seaborn.mplstyle +0 -0
  53. {daspi-2.7.0 → daspi-2.8.0}/daspi/requirements.txt +0 -0
  54. {daspi-2.7.0 → daspi-2.8.0}/daspi/statistics/__init__.py +0 -0
  55. {daspi-2.7.0 → daspi-2.8.0}/daspi/statistics/confidence.py +0 -0
  56. {daspi-2.7.0 → daspi-2.8.0}/daspi/statistics/hypothesis.py +0 -0
  57. {daspi-2.7.0 → daspi-2.8.0}/daspi/statistics/montecarlo.py +0 -0
  58. {daspi-2.7.0 → daspi-2.8.0}/daspi/strings.py +0 -0
  59. {daspi-2.7.0 → daspi-2.8.0}/tests/ANOVA_SS_Fehler.mpx +0 -0
  60. {daspi-2.7.0 → daspi-2.8.0}/tests/ANOVA_SS_Fehler.mpx.bak +0 -0
  61. {daspi-2.7.0 → daspi-2.8.0}/tests/GageRnR.mpx +0 -0
  62. {daspi-2.7.0 → daspi-2.8.0}/tests/GageRnR.mpx.bak +0 -0
  63. {daspi-2.7.0 → daspi-2.8.0}/tests/__init__.py +0 -0
  64. {daspi-2.7.0 → daspi-2.8.0}/tests/anova_convert_test.py +0 -0
  65. {daspi-2.7.0 → daspi-2.8.0}/tests/anova_model_test.py +0 -0
  66. {daspi-2.7.0 → daspi-2.8.0}/tests/anova_tables_test.py +0 -0
  67. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_alignments_basic.png +0 -0
  68. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_all_alignments.png +0 -0
  69. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_angles_basic.png +0 -0
  70. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_callable_formatters.png +0 -0
  71. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_combined_all_features.png +0 -0
  72. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_extreme_angles.png +0 -0
  73. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_formatters_basic.png +0 -0
  74. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_formatters_scientific.png +0 -0
  75. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_multivariate_formatting.png +0 -0
  76. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_orientation_mapping.png +0 -0
  77. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Formatting_Features_Test_percentage_formatter.png +0 -0
  78. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_comparison_with_violin.png +0 -0
  79. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_custom_color.png +0 -0
  80. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_custom_width.png +0 -0
  81. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_joint_chart_mixed_plots.png +0 -0
  82. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_multivariate_chart_facets.png +0 -0
  83. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_resolution_high.png +0 -0
  84. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_horizontal.png +0 -0
  85. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_no_fade.png +0 -0
  86. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_no_fill.png +0 -0
  87. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_simple.png +0 -0
  88. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_with_hue.png +0 -0
  89. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_bar_stacking.png +0 -0
  90. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_kdes_kde-mean.png +0 -0
  91. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_kdes_mixed-kde.png +0 -0
  92. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_pareto_marked.png +0 -0
  93. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_probability_dists-prob.png +0 -0
  94. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_probability_norm-prob.png +0 -0
  95. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/JointChart_regression_kde.png +0 -0
  96. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/MultivariateChart_full-stripes.png +0 -0
  97. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/MultivariateChart_full.png +0 -0
  98. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_bivariate-univariate-charts_contour-mean-test.png +0 -0
  99. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_bivariate-univariate-charts_mean-test.png +0 -0
  100. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_bivariate-univariate-charts_simple.png +0 -0
  101. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_bivariate-univariate-charts_smoothed.png +0 -0
  102. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_bivariate-univariate-charts_user.png +0 -0
  103. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_gage_rnr_model_basic.png +0 -0
  104. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_gage_study_model_basic.png +0 -0
  105. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_goodness_of_fit_charts_basic.png +0 -0
  106. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_goodness_of_fit_charts_refit-epoch-7.png +0 -0
  107. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_pair_comparison_charts_basic.png +0 -0
  108. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_parameter_relevance_charts_basic.png +0 -0
  109. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_process-capabity-analysis-charts_hue.png +0 -0
  110. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/Precasts_residual_charts_basic.png +0 -0
  111. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_KDE-cumulative_multiple.png +0 -0
  112. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_KDE-cumulative_simple.png +0 -0
  113. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_KDE_multiple.png +0 -0
  114. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_KDE_ridge.png +0 -0
  115. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_KDE_simple.png +0 -0
  116. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_beeswarm_multiple.png +0 -0
  117. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_beeswarm_simple.png +0 -0
  118. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_blandaltman_simple.png +0 -0
  119. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_blandaltman_user.png +0 -0
  120. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_box_fill.png +0 -0
  121. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_box_multiple.png +0 -0
  122. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_box_simple.png +0 -0
  123. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_categorical-float-features_simple.png +0 -0
  124. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_errorbar_mean-test.png +0 -0
  125. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_errorbar_sem.png +0 -0
  126. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_errorbar_std-test.png +0 -0
  127. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_errorbar_var-test.png +0 -0
  128. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_fitted-density_cdf-multiple.png +0 -0
  129. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_fitted-density_pdf-data.png +0 -0
  130. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_fitted-density_pdf-norm.png +0 -0
  131. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_jitter_multiple.png +0 -0
  132. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_jitter_simple.png +0 -0
  133. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_line_hue.png +0 -0
  134. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_line_hue_size.png +0 -0
  135. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_pareto-threshold_simple.png +0 -0
  136. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_pareto_simple.png +0 -0
  137. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_pareto_transposed.png +0 -0
  138. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_quantiles_multiple.png +0 -0
  139. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_quantiles_simple.png +0 -0
  140. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_full.png +0 -0
  141. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_hue-shape.png +0 -0
  142. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_hue-size.png +0 -0
  143. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_hue.png +0 -0
  144. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_shape.png +0 -0
  145. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_simple-stripes-65ci.png +0 -0
  146. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_simple-stripes-99ci.png +0 -0
  147. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_simple-stripes.png +0 -0
  148. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_simple.png +0 -0
  149. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_size-shape.png +0 -0
  150. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_size.png +0 -0
  151. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_scatter_transposed.png +0 -0
  152. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_smoothing_ma-ema.png +0 -0
  153. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violin_mono.png +0 -0
  154. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violin_multiple.png +0 -0
  155. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violin_simple.png +0 -0
  156. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violine-contour_simple.png +0 -0
  157. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violine_mono.png +0 -0
  158. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violine_multiple.png +0 -0
  159. {daspi-2.7.0 → daspi-2.8.0}/tests/charts/SingleChart_violine_simple.png +0 -0
  160. {daspi-2.7.0 → daspi-2.8.0}/tests/config_test.py +0 -0
  161. {daspi-2.7.0 → daspi-2.8.0}/tests/data/anova3_result.csv +0 -0
  162. {daspi-2.7.0 → daspi-2.8.0}/tests/data/dists_10-samples.csv +0 -0
  163. {daspi-2.7.0 → daspi-2.8.0}/tests/data/dists_25-samples.csv +0 -0
  164. {daspi-2.7.0 → daspi-2.8.0}/tests/data/gage_rnr.csv +0 -0
  165. {daspi-2.7.0 → daspi-2.8.0}/tests/data/gage_study.csv +0 -0
  166. {daspi-2.7.0 → daspi-2.8.0}/tests/data/generate_dists.py +0 -0
  167. {daspi-2.7.0 → daspi-2.8.0}/tests/data/grnr_d-optimal.csv +0 -0
  168. {daspi-2.7.0 → daspi-2.8.0}/tests/data/uncertainties.csv +0 -0
  169. {daspi-2.7.0 → daspi-2.8.0}/tests/doe_build_test.py +0 -0
  170. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_appearance_test.py +0 -0
  171. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_chart_test.py +0 -0
  172. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_classify_test.py +0 -0
  173. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_facets_test.py +0 -0
  174. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_plotter_test.py +0 -0
  175. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_templates_test.py +0 -0
  176. {daspi-2.7.0 → daspi-2.8.0}/tests/plotlib_visual_test.py +0 -0
  177. {daspi-2.7.0 → daspi-2.8.0}/tests/r2_pred.mpx +0 -0
  178. {daspi-2.7.0 → daspi-2.8.0}/tests/r2_pred.mpx.bak +0 -0
  179. {daspi-2.7.0 → daspi-2.8.0}/tests/statistics_confidence_test.py +0 -0
  180. {daspi-2.7.0 → daspi-2.8.0}/tests/statistics_hypothesis_test.py +0 -0
  181. {daspi-2.7.0 → daspi-2.8.0}/tests/statistics_montecarlo_test.py +0 -0
  182. {daspi-2.7.0 → daspi-2.8.0}/tests/strings_test.py +0 -0
  183. {daspi-2.7.0 → daspi-2.8.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.7.0
3
+ Version: 2.8.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
@@ -44,6 +44,7 @@ from collections.abc import Generator
44
44
  from contextlib import _GeneratorContextManager, contextmanager
45
45
  from typing import Any, Literal
46
46
 
47
+ from ._typing import EstimationStrategy
47
48
  from .strings import STR
48
49
 
49
50
  __all__ = ['CONFIG', 'Config']
@@ -101,7 +102,33 @@ class Config:
101
102
  """Set matplotlib style."""
102
103
  from .plotlib.appearance import style
103
104
  style.use(value)
104
-
105
+
106
+ # Strategy property (delegates to DEFAULT)
107
+ @property
108
+ def strategy(self) -> EstimationStrategy:
109
+ """Default strategy used to determine control limits (process
110
+ spread) for the `stripes` methods."""
111
+ from .constants import DEFAULT
112
+ return DEFAULT.STRATEGY
113
+
114
+ @strategy.setter
115
+ def strategy(self, value: EstimationStrategy) -> None:
116
+ from .constants import DEFAULT
117
+ DEFAULT.STRATEGY = value
118
+
119
+ # Agreement property (delegates to DEFAULT)
120
+ @property
121
+ def agreement(self) -> float | int:
122
+ """Default tolerated process variation (agreement) for control
123
+ limits in the `stripes` methods."""
124
+ from .constants import DEFAULT
125
+ return DEFAULT.AGREEMENT
126
+
127
+ @agreement.setter
128
+ def agreement(self, value: float | int) -> None:
129
+ from .constants import DEFAULT
130
+ DEFAULT.AGREEMENT = value
131
+
105
132
  # Context managers
106
133
  def use_style(self, style_name: str) -> _GeneratorContextManager:
107
134
  """Context manager for temporary style change.
@@ -165,7 +192,8 @@ class Config:
165
192
  ----------
166
193
  **kwargs : Any
167
194
  Key-value pairs of settings to update. Valid keys are
168
- 'language', 'username', and 'style'
195
+ 'language', 'username', 'style', 'strategy' and
196
+ 'agreement'
169
197
 
170
198
  Raises
171
199
  ------
@@ -186,7 +214,8 @@ class Config:
186
214
  if not hasattr(self, key):
187
215
  raise AttributeError(
188
216
  f"Config has no setting '{key}'. "
189
- f"Valid settings: language, username, style"
217
+ f"Valid settings: language, username, style, strategy, "
218
+ f"agreement"
190
219
  )
191
220
  setattr(self, key, value)
192
221
 
@@ -194,13 +223,15 @@ class Config:
194
223
  """Reset all settings to defaults.
195
224
 
196
225
  Sets language to 'en', username to the value from the
197
- USERNAME environment variable (or 'user' if not set), and
198
- style to 'daspi'.
226
+ USERNAME environment variable (or 'user' if not set), style
227
+ to 'daspi', strategy to 'eval' and agreement to 6.
199
228
  """
200
229
  from os import environ
201
230
  STR.language = 'en'
202
231
  STR.username = environ.get('USERNAME', 'user')
203
232
  self.style = 'daspi'
233
+ self.strategy = 'eval'
234
+ self.agreement = 6
204
235
 
205
236
  # Global configuration instance
206
237
  CONFIG = Config()
@@ -7,7 +7,7 @@ import matplotlib.pyplot as plt
7
7
  from patsy.desc import INTERCEPT
8
8
  from scipy.stats._continuous_distns import _distn_names
9
9
 
10
- from ._typing import LineStyle
10
+ from ._typing import EstimationStrategy, LineStyle
11
11
 
12
12
  __all__ = [
13
13
  'ANOVA',
@@ -755,14 +755,16 @@ DIST = _Distribution_()
755
755
  selecting distributions throughout the DaSPi library."""
756
756
 
757
757
 
758
- @dataclass(frozen=True)
758
+ @dataclass
759
759
  class _Default_:
760
760
  """Default values used throughout the DaSPi library, e.g. confidence
761
761
  level, sequence lengths for kernel density estimation and LOWESS,
762
762
  and quantile ranges.
763
763
 
764
764
  Don't instantiate this class directly. Use the `DEFAULT` constant
765
- instead."""
765
+ instead. Note that this class is not frozen (unlike the other
766
+ constant groups in this module) because `STRATEGY` and `AGREEMENT`
767
+ are meant to be changed at runtime via `daspi.CONFIG.configure()`."""
766
768
 
767
769
  CONFIDENCE_LEVEL: float = 0.95
768
770
  """Default confidence level. 95 % confidence interval is used very
@@ -809,6 +811,16 @@ class _Default_:
809
811
  """Default smoothing factor (alpha) for the
810
812
  `ExponentialSmoothingLine` Plotter."""
811
813
 
814
+ STRATEGY: EstimationStrategy = 'eval'
815
+ """Default strategy used to determine control limits (process
816
+ spread) for the `stripes` methods. Change this via
817
+ `daspi.CONFIG.configure(strategy=...)`."""
818
+
819
+ AGREEMENT: float | int = 6
820
+ """Default tolerated process variation (agreement) for control
821
+ limits in the `stripes` methods. Change this via
822
+ `daspi.CONFIG.configure(agreement=...)`."""
823
+
812
824
  @property
813
825
  def MARKER(self) -> str:
814
826
  """Default marker for scatter plots."""
@@ -1243,8 +1243,8 @@ class SingleChart(Chart):
1243
1243
  control_limits: bool = False,
1244
1244
  spec_limits: SpecLimits = UNBOUNDED,
1245
1245
  confidence: float | None = None,
1246
- strategy: EstimationStrategy = 'norm',
1247
- agreement: float | int = 6, # noqa: PYI041
1246
+ strategy: EstimationStrategy | None = None,
1247
+ agreement: float | int | None = None, # noqa: PYI041
1248
1248
  **kwds,
1249
1249
  ) -> Self:
1250
1250
  """Plot location and spread width lines, specification limits
@@ -1286,7 +1286,7 @@ class SingleChart(Chart):
1286
1286
  - `data`: The quantiles for the process variation tolerance
1287
1287
  are read directly from the data.
1288
1288
 
1289
- Default is 'norm'.
1289
+ If None, uses `daspi.CONFIG.strategy` (default 'eval').
1290
1290
  agreement : int or float, optional
1291
1291
  Specify the tolerated process variation for which the
1292
1292
  control limits are to be calculated.
@@ -1299,7 +1299,7 @@ class SingleChart(Chart):
1299
1299
  then interpreted as the acceptable proportion for the
1300
1300
  spread, e.g. 0.9973 (which corresponds to ~ 6 sigma)
1301
1301
 
1302
- Default is 6 because SixSigma ;-)
1302
+ If None, uses `daspi.CONFIG.agreement` (default 6).
1303
1303
  **kwds:
1304
1304
  Additional keyword arguments for configuring StripesFacets.
1305
1305
 
@@ -2054,8 +2054,8 @@ class JointChart(Chart):
2054
2054
  control_limits: bool | tuple[bool, ...] = False,
2055
2055
  spec_limits: SpecLimits | tuple[SpecLimits, ...] = UNBOUNDED,
2056
2056
  confidence: float | None | tuple[float | None, ...] = None,
2057
- strategy: EstimationStrategy | tuple = 'norm',
2058
- agreement: float | int | tuple[int | float, ...] = 6, # noqa: PYI041
2057
+ strategy: EstimationStrategy | None | tuple = None,
2058
+ agreement: float | int | None | tuple[int | float, ...] = None, # noqa: PYI041
2059
2059
  **kwds) -> Self:
2060
2060
  """Plot location and spread width lines, specification limits
2061
2061
  and/or confidence interval areas as stripes on each Axes. The
@@ -2096,7 +2096,7 @@ class JointChart(Chart):
2096
2096
  - `data`: The quantiles for the process variation tolerance
2097
2097
  are read directly from the data.
2098
2098
 
2099
- Default is 'norm'.
2099
+ If None, uses `daspi.CONFIG.strategy` (default 'eval').
2100
2100
  agreement : int | float | tuple[int | float, ...], optional
2101
2101
  Specify the tolerated process variation for which the
2102
2102
  control limits are to be calculated.
@@ -2109,7 +2109,7 @@ class JointChart(Chart):
2109
2109
  then interpreted as the acceptable proportion for the
2110
2110
  spread, e.g. 0.9973 (which corresponds to ~ 6 sigma)
2111
2111
 
2112
- Default is 6 because SixSigma ;-)
2112
+ If None, uses `daspi.CONFIG.agreement` (default 6).
2113
2113
  **kwds:
2114
2114
  Additional keyword arguments for configuring StripesFacets.
2115
2115
 
@@ -2515,8 +2515,8 @@ class MultivariateChart(SingleChart):
2515
2515
  control_limits: bool = False,
2516
2516
  spec_limits: SpecLimits = UNBOUNDED,
2517
2517
  confidence: float | None = None,
2518
- strategy: EstimationStrategy = 'norm',
2519
- agreement: float | int = 6, # noqa: PYI041
2518
+ strategy: EstimationStrategy | None = None,
2519
+ agreement: float | int | None = None, # noqa: PYI041
2520
2520
  **kwds,
2521
2521
  ) -> Self:
2522
2522
  """Plot location and spread width lines, specification limits
@@ -2558,7 +2558,7 @@ class MultivariateChart(SingleChart):
2558
2558
  - `data`: The quantiles for the process variation tolerance
2559
2559
  are read directly from the data.
2560
2560
 
2561
- Default is 'norm'.
2561
+ If None, uses `daspi.CONFIG.strategy` (default 'eval').
2562
2562
  agreement : int or float, optional
2563
2563
  Specify the tolerated process variation for which the
2564
2564
  control limits are to be calculated.
@@ -2571,7 +2571,7 @@ class MultivariateChart(SingleChart):
2571
2571
  then interpreted as the acceptable proportion for the
2572
2572
  spread, e.g. 0.9973 (which corresponds to ~ 6 sigma)
2573
2573
 
2574
- Default is 6 because SixSigma ;-)
2574
+ If None, uses `daspi.CONFIG.agreement` (default 6).
2575
2575
  **kwds:
2576
2576
  Additional keyword arguments for configuring StripesFacets.
2577
2577
 
@@ -427,7 +427,8 @@ class StripesFacets:
427
427
  distribution. The variation tolerance is then calculated as
428
428
  agreement * standard deviation
429
429
  - data: The quantiles for the process variation tolerance are
430
- read directly from the data. by default 'norm'
430
+ read directly from the data. by default `daspi.CONFIG.strategy`
431
+ ('eval')
431
432
 
432
433
  agreement : float or int, optional
433
434
  Specify the tolerated process variation for which the control
@@ -438,7 +439,8 @@ class StripesFacets:
438
439
  calculated from this.
439
440
  If float, the value must be between 0 and 1.This value is then
440
441
  interpreted as the acceptable proportion for the spread, e.g.
441
- 0.9973 (which corresponds to ~ 6 sigma) by default 6
442
+ 0.9973 (which corresponds to ~ 6 sigma) by default
443
+ `daspi.CONFIG.agreement` (6)
442
444
  **kwds : dict, optional
443
445
  Additional keyword arguments to pass to the ProcessEstimator.
444
446
  """
@@ -476,16 +478,16 @@ class StripesFacets:
476
478
  control_limits: bool = False,
477
479
  spec_limits: SpecLimits = UNBOUNDED,
478
480
  confidence: float | None = None,
479
- strategy: EstimationStrategy = 'norm',
480
- agreement: float | int = 6, # noqa: PYI041
481
+ strategy: EstimationStrategy | None = None,
482
+ agreement: float | int | None = None, # noqa: PYI041
481
483
  **kwds) -> None:
482
484
  self.single_axes = single_axes
483
485
  self._confidence = confidence
484
486
  self.estimation = ProcessEstimator(
485
487
  samples=target,
486
488
  spec_limits=spec_limits,
487
- strategy=strategy,
488
- agreement=agreement,
489
+ strategy=strategy if strategy is not None else DEFAULT.STRATEGY,
490
+ agreement=agreement if agreement is not None else DEFAULT.AGREEMENT,
489
491
  **kwds)
490
492
  self.target_on_y = target_on_y
491
493
  self.stripes = {s.identity: s for s in (stripes or [])}
@@ -6808,8 +6808,8 @@ class SpreadWidth(ErrorBar):
6808
6808
  source: DataFrame,
6809
6809
  target: str,
6810
6810
  feature: str = '',
6811
- strategy: EstimationStrategy = 'norm',
6812
- agreement: float | int = 6, # noqa: PYI041
6811
+ strategy: EstimationStrategy | None = None,
6812
+ agreement: float | int | None = None, # noqa: PYI041
6813
6813
  possible_dists: tuple[str | rv_continuous, ...] = DIST.COMMON,
6814
6814
  show_center: bool = True,
6815
6815
  kind: Literal['mean', 'median'] = 'mean',
@@ -6824,8 +6824,8 @@ class SpreadWidth(ErrorBar):
6824
6824
  **kwds) -> None:
6825
6825
  self._kind = 'mean'
6826
6826
  self.kind = kind
6827
- self.strategy = strategy
6828
- self.agreement = agreement
6827
+ self.strategy = strategy if strategy is not None else DEFAULT.STRATEGY
6828
+ self.agreement = agreement if agreement is not None else DEFAULT.AGREEMENT
6829
6829
  self.possible_dists = possible_dists
6830
6830
 
6831
6831
  super().__init__(
@@ -7812,8 +7812,8 @@ class CapabilityConfidenceInterval(ConfidenceInterval):
7812
7812
  `ProcessEstimator` class. Possible keword arguments are (default
7813
7813
  is None):
7814
7814
  - error_values: tuple[float, ...] = (),
7815
- - strategy: EstimationStrategy = 'norm',
7816
- - agreement: float | int = 6,
7815
+ - strategy: EstimationStrategy = `daspi.CONFIG.strategy` (default 'eval'),
7816
+ - agreement: float | int = `daspi.CONFIG.agreement` (default 6),
7817
7817
  - possible_dists: tuple[str | rv_continuous, ...] = DIST.COMMON
7818
7818
 
7819
7819
  **kwds:
@@ -1248,10 +1248,11 @@ class ProcessCapabilityAnalysisCharts(JointChart):
1248
1248
  strategy: Literal['norm', 'fit', 'data'] = 'norm',
1249
1249
  dist: rv_continuous | str = 'norm',
1250
1250
  error_values: tuple[float, ...] = (),
1251
- agreement: float | int = 6, # noqa: PYI041
1251
+ agreement: float | int | None = None, # noqa: PYI041
1252
1252
  possible_dists: tuple[str | rv_continuous, ...] = DIST.COMMON,
1253
1253
  stretch_figsize: bool | float | tuple[float, float] = False,
1254
1254
  ) -> None:
1255
+ agreement = agreement if agreement is not None else DEFAULT.AGREEMENT
1255
1256
  assert not spec_limits.both_unbounded, (
1256
1257
  'At least one specification limit must not be None')
1257
1258
  assert strategy in ('norm', 'fit', 'data'), (
@@ -1487,7 +1487,7 @@ class LocationDispersionEstimator(DistributionEstimator):
1487
1487
  _sem: float | None
1488
1488
  _lcl: float | None
1489
1489
  _ucl: float | None
1490
- _strategy: EstimationStrategy
1490
+ _strategy: EstimationStrategy | None
1491
1491
  _agreement: int | float
1492
1492
  _k: float
1493
1493
  _evaluate: Callable | None
@@ -1497,8 +1497,8 @@ class LocationDispersionEstimator(DistributionEstimator):
1497
1497
  def __init__(
1498
1498
  self,
1499
1499
  samples: NumericSample1D,
1500
- strategy: EstimationStrategy = 'norm',
1501
- agreement: int | float = 6, # noqa: PYI041
1500
+ strategy: EstimationStrategy | None = None,
1501
+ agreement: int | float | None = None, # noqa: PYI041
1502
1502
  possible_dists: tuple[str | rv_continuous, ...] = DIST.COMMON,
1503
1503
  evaluate: Callable | None = None,
1504
1504
  nan_policy: Literal['propagate', 'raise', 'omit'] = 'omit',
@@ -1519,10 +1519,9 @@ class LocationDispersionEstimator(DistributionEstimator):
1519
1519
  self._ucl = None
1520
1520
  self._q_low = None
1521
1521
  self._q_upp = None
1522
- self._strategy = 'norm'
1523
- self.strategy = strategy
1522
+ self._strategy = strategy
1524
1523
  self._agreement = -1
1525
- self.agreement = agreement
1524
+ self.agreement = agreement if agreement is not None else DEFAULT.AGREEMENT
1526
1525
  self._evaluate = evaluate
1527
1526
  self._attrs_describe = (
1528
1527
  'n_samples',
@@ -1636,7 +1635,7 @@ class LocationDispersionEstimator(DistributionEstimator):
1636
1635
  return self._q_upp
1637
1636
 
1638
1637
  @property
1639
- def strategy(self) -> Literal['eval', 'fit', 'norm', 'data']:
1638
+ def strategy(self) -> Literal['fit', 'norm', 'data']:
1640
1639
  """Strategy used to determine the control limits. The control
1641
1640
  limits can also be interpreted as the process range.
1642
1641
 
@@ -1650,7 +1649,16 @@ class LocationDispersionEstimator(DistributionEstimator):
1650
1649
  distribution. The variation tolerance is then calculated as
1651
1650
  agreement * standard deviation
1652
1651
  - data: The quantiles for the process variation tolerance
1653
- are read directly from the samples."""
1652
+ are read directly from the samples.
1653
+
1654
+ Getting this value never returns 'eval' or None: if unset, it
1655
+ resolves to `DEFAULT.STRATEGY`, and if that is (or resolves to)
1656
+ 'eval', `evaluate()` is run immediately and its result ('fit',
1657
+ 'norm' or 'data') is stored and returned instead."""
1658
+ if self._strategy is None:
1659
+ self._strategy = DEFAULT.STRATEGY
1660
+ if self._strategy == 'eval':
1661
+ self._strategy = self.evaluate()
1654
1662
  return self._strategy
1655
1663
  @strategy.setter
1656
1664
  def strategy(self, strategy: EstimationStrategy) -> None:
@@ -1817,10 +1825,7 @@ class LocationDispersionEstimator(DistributionEstimator):
1817
1825
 
1818
1826
  def _calculate_control_limits_(self) -> tuple[float, float]:
1819
1827
  """Calculate the control limits according to given strategy
1820
-
1821
- - `eval`: first evaluate the strategy according to evaluate
1822
- method. Then the limits are calculated using one of the
1823
- following points.
1828
+
1824
1829
  - `fit`: first fit samples to a distribution and then calculate
1825
1830
  quantile for this distribution according to given agreement.
1826
1831
  - `norm`: The control limits are calculated from the mean plus
@@ -1829,15 +1834,16 @@ class LocationDispersionEstimator(DistributionEstimator):
1829
1834
  - `data`: The quantiles are calculated directly from the sample
1830
1835
  according the given agreement
1831
1836
 
1837
+ Note that `strategy` is never 'eval' here: the `strategy`
1838
+ property resolves 'eval' to one of 'fit', 'norm' or 'data' via
1839
+ `evaluate()` before returning.
1840
+
1832
1841
  Returns
1833
1842
  -------
1834
1843
  lcl, ucl : float
1835
1844
  control limits also known as process range.
1836
1845
  """
1837
1846
  match self.strategy:
1838
- case 'eval':
1839
- self.strategy = self.evaluate()
1840
- lcl, ucl = self._calculate_control_limits_()
1841
1847
  case 'fit':
1842
1848
  lcl = float(self.dist.ppf(self.q_low, *self.shape_params))
1843
1849
  ucl = float(self.dist.ppf(self.q_upp, *self.shape_params))
@@ -2017,8 +2023,8 @@ class ProcessEstimator(LocationDispersionEstimator):
2017
2023
  samples: NumericSample1D,
2018
2024
  spec_limits: SpecLimits | Specification,
2019
2025
  error_values: tuple[float, ...] = (),
2020
- strategy: EstimationStrategy = 'norm',
2021
- agreement: float | int = 6, # noqa: PYI041
2026
+ strategy: EstimationStrategy | None = None,
2027
+ agreement: float | int | None = None, # noqa: PYI041
2022
2028
  possible_dists: tuple[str | rv_continuous, ...] = DIST.COMMON,
2023
2029
  evaluate: Callable | None = None,
2024
2030
  nan_policy: Literal['propagate', 'raise', 'omit'] = 'omit',
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "DaSPi"
3
- version = "2.7.0"
3
+ version = "2.8.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" },
@@ -543,7 +543,8 @@ class TestProcessEstimator:
543
543
 
544
544
  def test_describe_with_nan_values(self) -> None:
545
545
  data = [1.0, np.nan, 3.0, 4.0, np.nan]
546
- estimator = ProcessEstimator(data, SpecLimits(lower=1.5, upper=3.5))
546
+ estimator = ProcessEstimator(
547
+ data, SpecLimits(lower=1.5, upper=3.5), strategy='norm')
547
548
  result = estimator.describe()
548
549
  assert not np.isnan(result.loc['mean'][0])
549
550
  assert not np.isnan(result.loc['std'][0])
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes