DaSPi 2.6.0__tar.gz → 2.7.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.6.0 → daspi-2.7.0}/PKG-INFO +1 -1
  2. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/chart.py +134 -1
  3. {daspi-2.6.0 → daspi-2.7.0}/pyproject.toml +1 -1
  4. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_chart_test.py +94 -0
  5. {daspi-2.6.0 → daspi-2.7.0}/LICENSE +0 -0
  6. {daspi-2.6.0 → daspi-2.7.0}/README.md +0 -0
  7. {daspi-2.6.0 → daspi-2.7.0}/daspi/__init__.py +0 -0
  8. {daspi-2.6.0 → daspi-2.7.0}/daspi/_typing.py +0 -0
  9. {daspi-2.6.0 → daspi-2.7.0}/daspi/_version.py +0 -0
  10. {daspi-2.6.0 → daspi-2.7.0}/daspi/anova/__init__.py +0 -0
  11. {daspi-2.6.0 → daspi-2.7.0}/daspi/anova/convert.py +0 -0
  12. {daspi-2.6.0 → daspi-2.7.0}/daspi/anova/model.py +0 -0
  13. {daspi-2.6.0 → daspi-2.7.0}/daspi/anova/tables.py +0 -0
  14. {daspi-2.6.0 → daspi-2.7.0}/daspi/config.py +0 -0
  15. {daspi-2.6.0 → daspi-2.7.0}/daspi/constants.py +0 -0
  16. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/__init__.py +0 -0
  17. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/ancova.csv +0 -0
  18. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/anova.csv +0 -0
  19. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/anova2.csv +0 -0
  20. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/anova2_unbalanced.csv +0 -0
  21. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/anova3.csv +0 -0
  22. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/anova3_unbalanced.csv +0 -0
  23. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/carpet_full-factorial.csv +0 -0
  24. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/covariate.csv +0 -0
  25. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/drop_card.csv +0 -0
  26. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/eeprom_full-factorial.csv +0 -0
  27. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/eeprom_partial-factorial.csv +0 -0
  28. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/grnr_adjustment.csv +0 -0
  29. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/grnr_layer_thickness.csv +0 -0
  30. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/grnr_spc.csv +0 -0
  31. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/iris.csv +0 -0
  32. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/mpg.csv +0 -0
  33. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/painkillers-dissolution.csv +0 -0
  34. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/partial_factorial.csv +0 -0
  35. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/penguins.csv +0 -0
  36. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/process_capability.mpx +0 -0
  37. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/salt_sticks.csv +0 -0
  38. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/shoe-sole.csv +0 -0
  39. {daspi-2.6.0 → daspi-2.7.0}/daspi/datasets/tips.csv +0 -0
  40. {daspi-2.6.0 → daspi-2.7.0}/daspi/doe/__init__.py +0 -0
  41. {daspi-2.6.0 → daspi-2.7.0}/daspi/doe/build.py +0 -0
  42. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/__init__.py +0 -0
  43. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/appearance.py +0 -0
  44. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/classify.py +0 -0
  45. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/facets.py +0 -0
  46. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/plotter.py +0 -0
  47. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/precast.py +0 -0
  48. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/styles/daspi-dark.mplstyle +0 -0
  49. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/styles/daspi.mplstyle +0 -0
  50. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/styles/ggplot2.mplstyle +0 -0
  51. {daspi-2.6.0 → daspi-2.7.0}/daspi/plotlib/styles/seaborn.mplstyle +0 -0
  52. {daspi-2.6.0 → daspi-2.7.0}/daspi/requirements.txt +0 -0
  53. {daspi-2.6.0 → daspi-2.7.0}/daspi/statistics/__init__.py +0 -0
  54. {daspi-2.6.0 → daspi-2.7.0}/daspi/statistics/confidence.py +0 -0
  55. {daspi-2.6.0 → daspi-2.7.0}/daspi/statistics/estimation.py +0 -0
  56. {daspi-2.6.0 → daspi-2.7.0}/daspi/statistics/hypothesis.py +0 -0
  57. {daspi-2.6.0 → daspi-2.7.0}/daspi/statistics/montecarlo.py +0 -0
  58. {daspi-2.6.0 → daspi-2.7.0}/daspi/strings.py +0 -0
  59. {daspi-2.6.0 → daspi-2.7.0}/tests/ANOVA_SS_Fehler.mpx +0 -0
  60. {daspi-2.6.0 → daspi-2.7.0}/tests/ANOVA_SS_Fehler.mpx.bak +0 -0
  61. {daspi-2.6.0 → daspi-2.7.0}/tests/GageRnR.mpx +0 -0
  62. {daspi-2.6.0 → daspi-2.7.0}/tests/GageRnR.mpx.bak +0 -0
  63. {daspi-2.6.0 → daspi-2.7.0}/tests/__init__.py +0 -0
  64. {daspi-2.6.0 → daspi-2.7.0}/tests/anova_convert_test.py +0 -0
  65. {daspi-2.6.0 → daspi-2.7.0}/tests/anova_model_test.py +0 -0
  66. {daspi-2.6.0 → daspi-2.7.0}/tests/anova_tables_test.py +0 -0
  67. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_alignments_basic.png +0 -0
  68. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_all_alignments.png +0 -0
  69. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_angles_basic.png +0 -0
  70. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_callable_formatters.png +0 -0
  71. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_combined_all_features.png +0 -0
  72. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_extreme_angles.png +0 -0
  73. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_formatters_basic.png +0 -0
  74. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_formatters_scientific.png +0 -0
  75. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_multivariate_formatting.png +0 -0
  76. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_orientation_mapping.png +0 -0
  77. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Formatting_Features_Test_percentage_formatter.png +0 -0
  78. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_comparison_with_violin.png +0 -0
  79. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_custom_color.png +0 -0
  80. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_custom_width.png +0 -0
  81. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_joint_chart_mixed_plots.png +0 -0
  82. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_multivariate_chart_facets.png +0 -0
  83. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_resolution_high.png +0 -0
  84. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_horizontal.png +0 -0
  85. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_no_fade.png +0 -0
  86. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_no_fill.png +0 -0
  87. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_simple.png +0 -0
  88. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/GaussianKDEContourUnivariate_single_chart_with_hue.png +0 -0
  89. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_bar_stacking.png +0 -0
  90. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_kdes_kde-mean.png +0 -0
  91. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_kdes_mixed-kde.png +0 -0
  92. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_pareto_marked.png +0 -0
  93. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_probability_dists-prob.png +0 -0
  94. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_probability_norm-prob.png +0 -0
  95. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/JointChart_regression_kde.png +0 -0
  96. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/MultivariateChart_full-stripes.png +0 -0
  97. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/MultivariateChart_full.png +0 -0
  98. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_bivariate-univariate-charts_contour-mean-test.png +0 -0
  99. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_bivariate-univariate-charts_mean-test.png +0 -0
  100. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_bivariate-univariate-charts_simple.png +0 -0
  101. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_bivariate-univariate-charts_smoothed.png +0 -0
  102. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_bivariate-univariate-charts_user.png +0 -0
  103. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_gage_rnr_model_basic.png +0 -0
  104. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_gage_study_model_basic.png +0 -0
  105. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_goodness_of_fit_charts_basic.png +0 -0
  106. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_goodness_of_fit_charts_refit-epoch-7.png +0 -0
  107. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_pair_comparison_charts_basic.png +0 -0
  108. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_parameter_relevance_charts_basic.png +0 -0
  109. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_process-capabity-analysis-charts_hue.png +0 -0
  110. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/Precasts_residual_charts_basic.png +0 -0
  111. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_KDE-cumulative_multiple.png +0 -0
  112. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_KDE-cumulative_simple.png +0 -0
  113. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_KDE_multiple.png +0 -0
  114. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_KDE_ridge.png +0 -0
  115. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_KDE_simple.png +0 -0
  116. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_beeswarm_multiple.png +0 -0
  117. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_beeswarm_simple.png +0 -0
  118. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_blandaltman_simple.png +0 -0
  119. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_blandaltman_user.png +0 -0
  120. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_box_fill.png +0 -0
  121. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_box_multiple.png +0 -0
  122. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_box_simple.png +0 -0
  123. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_categorical-float-features_simple.png +0 -0
  124. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_errorbar_mean-test.png +0 -0
  125. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_errorbar_sem.png +0 -0
  126. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_errorbar_std-test.png +0 -0
  127. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_errorbar_var-test.png +0 -0
  128. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_fitted-density_cdf-multiple.png +0 -0
  129. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_fitted-density_pdf-data.png +0 -0
  130. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_fitted-density_pdf-norm.png +0 -0
  131. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_jitter_multiple.png +0 -0
  132. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_jitter_simple.png +0 -0
  133. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_line_hue.png +0 -0
  134. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_line_hue_size.png +0 -0
  135. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_pareto-threshold_simple.png +0 -0
  136. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_pareto_simple.png +0 -0
  137. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_pareto_transposed.png +0 -0
  138. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_quantiles_multiple.png +0 -0
  139. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_quantiles_simple.png +0 -0
  140. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_full.png +0 -0
  141. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_hue-shape.png +0 -0
  142. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_hue-size.png +0 -0
  143. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_hue.png +0 -0
  144. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_shape.png +0 -0
  145. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_simple-stripes-65ci.png +0 -0
  146. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_simple-stripes-99ci.png +0 -0
  147. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_simple-stripes.png +0 -0
  148. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_simple.png +0 -0
  149. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_size-shape.png +0 -0
  150. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_size.png +0 -0
  151. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_scatter_transposed.png +0 -0
  152. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_smoothing_ma-ema.png +0 -0
  153. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violin_mono.png +0 -0
  154. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violin_multiple.png +0 -0
  155. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violin_simple.png +0 -0
  156. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violine-contour_simple.png +0 -0
  157. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violine_mono.png +0 -0
  158. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violine_multiple.png +0 -0
  159. {daspi-2.6.0 → daspi-2.7.0}/tests/charts/SingleChart_violine_simple.png +0 -0
  160. {daspi-2.6.0 → daspi-2.7.0}/tests/config_test.py +0 -0
  161. {daspi-2.6.0 → daspi-2.7.0}/tests/data/anova3_result.csv +0 -0
  162. {daspi-2.6.0 → daspi-2.7.0}/tests/data/dists_10-samples.csv +0 -0
  163. {daspi-2.6.0 → daspi-2.7.0}/tests/data/dists_25-samples.csv +0 -0
  164. {daspi-2.6.0 → daspi-2.7.0}/tests/data/gage_rnr.csv +0 -0
  165. {daspi-2.6.0 → daspi-2.7.0}/tests/data/gage_study.csv +0 -0
  166. {daspi-2.6.0 → daspi-2.7.0}/tests/data/generate_dists.py +0 -0
  167. {daspi-2.6.0 → daspi-2.7.0}/tests/data/grnr_d-optimal.csv +0 -0
  168. {daspi-2.6.0 → daspi-2.7.0}/tests/data/uncertainties.csv +0 -0
  169. {daspi-2.6.0 → daspi-2.7.0}/tests/doe_build_test.py +0 -0
  170. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_appearance_test.py +0 -0
  171. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_classify_test.py +0 -0
  172. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_facets_test.py +0 -0
  173. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_plotter_test.py +0 -0
  174. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_templates_test.py +0 -0
  175. {daspi-2.6.0 → daspi-2.7.0}/tests/plotlib_visual_test.py +0 -0
  176. {daspi-2.6.0 → daspi-2.7.0}/tests/r2_pred.mpx +0 -0
  177. {daspi-2.6.0 → daspi-2.7.0}/tests/r2_pred.mpx.bak +0 -0
  178. {daspi-2.6.0 → daspi-2.7.0}/tests/statistics_confidence_test.py +0 -0
  179. {daspi-2.6.0 → daspi-2.7.0}/tests/statistics_estimation_test.py +0 -0
  180. {daspi-2.6.0 → daspi-2.7.0}/tests/statistics_hypothesis_test.py +0 -0
  181. {daspi-2.6.0 → daspi-2.7.0}/tests/statistics_montecarlo_test.py +0 -0
  182. {daspi-2.6.0 → daspi-2.7.0}/tests/strings_test.py +0 -0
  183. {daspi-2.6.0 → daspi-2.7.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.6.0
3
+ Version: 2.7.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
@@ -114,7 +114,7 @@ def check_label_order[T](method: Callable[..., T]) -> Callable[..., T]:
114
114
  If the decorated method is called after label() method.
115
115
  """
116
116
  @wraps(method)
117
- def wrapper(self: Chart, *args: Any, **kwargs: Any) -> T:
117
+ def wrapper(self: 'Chart', *args: Any, **kwargs: Any) -> T:
118
118
  assert not hasattr(self, 'label_facets'), (
119
119
  f'Cannot call {method.__name__}() after label(). '
120
120
  'The label() method must be called after stripes() and plot().')
@@ -122,6 +122,21 @@ def check_label_order[T](method: Callable[..., T]) -> Callable[..., T]:
122
122
  return wrapper
123
123
 
124
124
 
125
+ _XY_SET_PARAMS: dict[str, tuple[str, str]] = {
126
+ 'lim': ('xlim', 'ylim'),
127
+ 'bound': ('xbound', 'ybound'),
128
+ 'margin': ('xmargin', 'ymargin'),
129
+ 'scale': ('xscale', 'yscale'),
130
+ 'ticks': ('xticks', 'yticks'),
131
+ 'ticklabels': ('xticklabels', 'yticklabels'),
132
+ 'inverted': ('xinverted', 'yinverted'),
133
+ 'autoscale': ('autoscalex_on', 'autoscaley_on'),
134
+ }
135
+ """Mapping of generic axis parameters to their corresponding Axes.set
136
+ keys. The keys correspond to the parameters used in the `Axes.set`
137
+ method for the x and y axes, respectively."""
138
+
139
+
125
140
  class Chart(ABC):
126
141
  """
127
142
  Abstract base class for creating chart visualizations.
@@ -444,6 +459,124 @@ class Chart(ABC):
444
459
  enhance readability and provide context for the visualized data.
445
460
  """
446
461
 
462
+ @check_label_order
463
+ def set(
464
+ self,
465
+ ax: int | tuple[int, int] | Literal['all', 'first', 'last'] | None = 'all',
466
+ *,
467
+ feature_lim: tuple[float, float] | None = None,
468
+ target_lim: tuple[float, float] | None = None,
469
+ feature_bound: tuple[float, float] | None = None,
470
+ target_bound: tuple[float, float] | None = None,
471
+ feature_margin: float | None = None,
472
+ target_margin: float | None = None,
473
+ feature_scale: str | None = None,
474
+ target_scale: str | None = None,
475
+ feature_ticks: Sequence[float] | None = None,
476
+ target_ticks: Sequence[float] | None = None,
477
+ feature_ticklabels: Sequence[str] | None = None,
478
+ target_ticklabels: Sequence[str] | None = None,
479
+ feature_inverted: bool | None = None,
480
+ target_inverted: bool | None = None,
481
+ feature_autoscale: bool | None = None,
482
+ target_autoscale: bool | None = None,
483
+ **kwds: Any,
484
+ ) -> Self:
485
+ """Set properties on one, several or all Axes of this chart.
486
+
487
+ This is a thin wrapper around matplotlib's
488
+ ``Axes.set(**kwargs)``. The `feature_*`/`target_*` keywords
489
+ mirror the x/y-paired properties of ``Axes.set`` (e.g. `xlim`
490
+ and `ylim`) but are named after the chart's feature and target
491
+ variable instead, so they resolve to the correct axis based on
492
+ the `target_on_y` attribute. All other matplotlib ``Axes.set``
493
+ properties that have no x/y counterpart (e.g. `title`,
494
+ `aspect`, `facecolor`) can be passed directly via `**kwds`.
495
+
496
+ Note that `xlabel`/`ylabel` are intentionally not supported
497
+ here, use the `label()` method to set axis labels instead.
498
+
499
+ Parameters
500
+ ----------
501
+ ax : int | tuple[int, int] | {'all', 'first', 'last'} | None, optional
502
+ Selects which Axes the properties are applied to:
503
+ - int or tuple[int, int]: the Axes at that position in the
504
+ `axes` grid (see `AxesFacets.__getitem__`).
505
+ - 'all': every Axes in the grid, by default.
506
+ - 'first': only the first Axes in the grid.
507
+ - 'last': only the last Axes in the grid.
508
+ - None: the Axes that was last worked on (falls back to the
509
+ default Axes if none was worked on yet).
510
+ feature_lim, target_lim : tuple[float, float], optional
511
+ Feature/target axis view limits (`xlim`/`ylim`).
512
+ feature_bound, target_bound : tuple[float, float], optional
513
+ Feature/target axis bounds (`xbound`/`ybound`).
514
+ feature_margin, target_margin : float, optional
515
+ Feature/target axis margins (`xmargin`/`ymargin`).
516
+ feature_scale, target_scale : str, optional
517
+ Feature/target axis scale (`xscale`/`yscale`).
518
+ feature_ticks, target_ticks : Sequence[float], optional
519
+ Feature/target axis tick locations (`xticks`/`yticks`).
520
+ feature_ticklabels, target_ticklabels : Sequence[str], optional
521
+ Feature/target axis tick labels
522
+ (`xticklabels`/`yticklabels`).
523
+ feature_inverted, target_inverted : bool, optional
524
+ Whether the feature/target axis is inverted
525
+ (`xinverted`/`yinverted`).
526
+ feature_autoscale, target_autoscale : bool, optional
527
+ Whether the feature/target axis autoscales
528
+ (`autoscalex_on`/`autoscaley_on`).
529
+ **kwds
530
+ Additional keyword arguments forwarded as-is to
531
+ `Axes.set()`, for properties without a feature/target
532
+ counterpart (e.g. `title`, `aspect`, `facecolor`,
533
+ `visible`, `zorder`).
534
+
535
+ Returns
536
+ -------
537
+ Self
538
+ The updated Chart object.
539
+ """
540
+ feature_values = {
541
+ 'lim': feature_lim, 'bound': feature_bound,
542
+ 'margin': feature_margin, 'scale': feature_scale,
543
+ 'ticks': feature_ticks, 'ticklabels': feature_ticklabels,
544
+ 'inverted': feature_inverted, 'autoscale': feature_autoscale}
545
+ target_values = {
546
+ 'lim': target_lim, 'bound': target_bound,
547
+ 'margin': target_margin, 'scale': target_scale,
548
+ 'ticks': target_ticks, 'ticklabels': target_ticklabels,
549
+ 'inverted': target_inverted, 'autoscale': target_autoscale}
550
+
551
+ feature_axis = 0 if self.target_on_y else 1
552
+ target_axis = 1 if self.target_on_y else 0
553
+ kwds = dict(kwds)
554
+ for name, value in feature_values.items():
555
+ if value is not None:
556
+ kwds[_XY_SET_PARAMS[name][feature_axis]] = value
557
+ for name, value in target_values.items():
558
+ if value is not None:
559
+ kwds[_XY_SET_PARAMS[name][target_axis]] = value
560
+
561
+ if ax == 'all':
562
+ axes = self.axes.flat
563
+ elif ax == 'first':
564
+ axes = [self.axes.flat[0]]
565
+ elif ax == 'last':
566
+ axes = [self.axes.flat[-1]]
567
+ elif ax is None:
568
+ current = self._ax if self._ax is not None else self.axes.ax
569
+ assert current is not None, (
570
+ 'No current Axes to set properties on, specify `ax` '
571
+ 'explicitly.')
572
+ axes = [current]
573
+ else:
574
+ axes = [self.axes[ax]]
575
+
576
+ for _ax in axes:
577
+ _ax.set(**kwds)
578
+ return self
579
+
447
580
  def save(
448
581
  self,
449
582
  file_name: str | Path,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "DaSPi"
3
- version = "2.6.0"
3
+ version = "2.7.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" },
@@ -221,6 +221,100 @@ class TestJointChart:
221
221
  assert chart.single_label_allowed(is_target=True)
222
222
 
223
223
 
224
+ class TestChartSet:
225
+ """Tests for the Chart.set() method shared by all Chart subclasses."""
226
+
227
+ @pytest.fixture
228
+ def single_data(self) -> pd.DataFrame:
229
+ return pd.DataFrame({
230
+ 'x': [1, 2, 3, 4, 5],
231
+ 'y': [2, 4, 6, 8, 10],
232
+ })
233
+
234
+ @pytest.fixture
235
+ def joint_data(self) -> pd.DataFrame:
236
+ return pd.DataFrame({
237
+ 'x': [1, 2, 3, 4, 5],
238
+ 'y': [2, 4, 6, 8, 10],
239
+ })
240
+
241
+ def test_returns_self(self, single_data: pd.DataFrame) -> None:
242
+ chart = SingleChart(single_data, 'y', 'x')
243
+ assert chart.set(title='hello') is chart
244
+
245
+ def test_feature_target_mapping_target_on_y(
246
+ self, single_data: pd.DataFrame) -> None:
247
+ chart = SingleChart(single_data, 'y', 'x', target_on_y=True)
248
+ chart.set(feature_lim=(0, 1), target_lim=(2, 3))
249
+ assert chart.axes.ax.get_xlim() == (0, 1)
250
+ assert chart.axes.ax.get_ylim() == (2, 3)
251
+
252
+ def test_feature_target_mapping_target_on_x(
253
+ self, single_data: pd.DataFrame) -> None:
254
+ chart = SingleChart(single_data, 'y', 'x', target_on_y=False)
255
+ chart.set(feature_lim=(0, 1), target_lim=(2, 3))
256
+ assert chart.axes.ax.get_xlim() == (2, 3)
257
+ assert chart.axes.ax.get_ylim() == (0, 1)
258
+
259
+ def test_non_xy_kwargs_passthrough(self, single_data: pd.DataFrame) -> None:
260
+ chart = SingleChart(single_data, 'y', 'x')
261
+ chart.set(title='my title')
262
+ assert chart.axes.ax.get_title(loc='left') == 'my title'
263
+
264
+ def test_ax_all_applies_to_every_axes(
265
+ self, joint_data: pd.DataFrame) -> None:
266
+ chart = JointChart(
267
+ joint_data, feature='x', target='y', ncols=2, nrows=2)
268
+ chart.set(ax='all', title='shared title')
269
+ assert all(
270
+ ax.get_title(loc='left') == 'shared title'
271
+ for ax in chart.axes.flat)
272
+
273
+ def test_ax_first_applies_only_to_first_axes(
274
+ self, joint_data: pd.DataFrame) -> None:
275
+ chart = JointChart(
276
+ joint_data, feature='x', target='y', ncols=2, nrows=2)
277
+ chart.set(ax='first', title='first title')
278
+ titles = [ax.get_title(loc='left') for ax in chart.axes.flat]
279
+ assert titles[0] == 'first title'
280
+ assert all(t == '' for t in titles[1:])
281
+
282
+ def test_ax_last_applies_only_to_last_axes(
283
+ self, joint_data: pd.DataFrame) -> None:
284
+ chart = JointChart(
285
+ joint_data, feature='x', target='y', ncols=2, nrows=2)
286
+ chart.set(ax='last', title='last title')
287
+ titles = [ax.get_title(loc='left') for ax in chart.axes.flat]
288
+ assert titles[-1] == 'last title'
289
+ assert all(t == '' for t in titles[:-1])
290
+
291
+ def test_ax_by_flat_index(self, joint_data: pd.DataFrame) -> None:
292
+ chart = JointChart(
293
+ joint_data, feature='x', target='y', ncols=2, nrows=2)
294
+ chart.set(ax=2, title='indexed title')
295
+ titles = [ax.get_title(loc='left') for ax in chart.axes.flat]
296
+ assert titles[2] == 'indexed title'
297
+ assert all(t == '' for i, t in enumerate(titles) if i != 2)
298
+
299
+ def test_ax_by_grid_index(self, joint_data: pd.DataFrame) -> None:
300
+ chart = JointChart(
301
+ joint_data, feature='x', target='y', ncols=2, nrows=2)
302
+ chart.set(ax=(1, 0), title='grid title')
303
+ assert chart.axes[1, 0].get_title(loc='left') == 'grid title'
304
+ assert chart.axes[0, 0].get_title(loc='left') == ''
305
+
306
+ def test_ax_none_falls_back_to_current_axes(
307
+ self, single_data: pd.DataFrame) -> None:
308
+ chart = SingleChart(single_data, 'y', 'x')
309
+ chart.set(ax=None, title='current title')
310
+ assert chart.axes.ax.get_title(loc='left') == 'current title'
311
+
312
+ def test_set_blocked_after_label(self, single_data: pd.DataFrame) -> None:
313
+ chart = SingleChart(single_data, 'y', 'x').label()
314
+ with pytest.raises(AssertionError):
315
+ chart.set(title='too late')
316
+
317
+
224
318
  class TestChartFormatting:
225
319
  """Test the new formatting features for SingleChart and MultivariateChart."""
226
320
 
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
File without changes
File without changes
File without changes
File without changes