staplot 0.1.2__tar.gz → 0.1.3__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.
- {staplot-0.1.2/staplot.egg-info → staplot-0.1.3}/PKG-INFO +1 -1
- {staplot-0.1.2 → staplot-0.1.3}/pyproject.toml +1 -1
- staplot-0.1.3/staplot/__init__.py +1 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/api.py +16 -3
- {staplot-0.1.2 → staplot-0.1.3/staplot.egg-info}/PKG-INFO +1 -1
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_more_kinds_20261120.py +12 -1
- staplot-0.1.2/staplot/__init__.py +0 -1
- {staplot-0.1.2 → staplot-0.1.3}/LICENSE +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/README.md +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/setup.cfg +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/main.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/models/__init__.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/models/project.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/__init__.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/bar.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/before_after.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/bland_altman.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/box.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/distribution_plot.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/extras.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/grouped_bar.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/heatmap.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/histogram.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/layers.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/lines.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/qq.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/residuals.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/roc_plot.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/scatter.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/significance.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/styles.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/survival.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/plots/volcano.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/__init__.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/anova.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/chi_square.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/correlation.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/curve_fit.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/descriptive.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/distribution.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/multiple_comparisons.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/nested.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/normality.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/outliers.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/power.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/regression.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/repeated_measures.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/roc.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/tests.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/stats/two_way_anova.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/__init__.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/analysis_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/axis_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/computed_column_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/contingency_table_widget.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/data_table_widget.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/distribution_inspector.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/figure_layout_widget.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/graph_gallery.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/graph_options_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/grouped_table_widget.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/layout_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/main_window.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/multiple_comparisons_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/navigator.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/plot_canvas.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/plot_editor.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/power_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/report_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/reshape_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/results_widget.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/standard_curve_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/test_wizard.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/transform_dialog.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot/ui/undo_commands.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot.egg-info/SOURCES.txt +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot.egg-info/dependency_links.txt +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot.egg-info/entry_points.txt +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot.egg-info/requires.txt +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/staplot.egg-info/top_level.txt +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_bracket_layout_20261119.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_chatgpt_regressions.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_layers_y2_20261120.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_missing_values.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_plot_code.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_plot_editor.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_plot_editor_layers_20261120.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_plot_layout.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_read_table.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_review_fixes.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_stats_text_default.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_styles_scoped.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_subjects_20261120.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_table_import.py +0 -0
- {staplot-0.1.2 → staplot-0.1.3}/tests/test_tick_labels.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "staplot"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "Statistical analysis and publication-quality plotting — a GraphPad Prism replacement"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "BSD-2-Clause"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.3"
|
|
@@ -726,9 +726,12 @@ def suggest_kind(source, columns=None, where=None, skip_rows=None) -> dict:
|
|
|
726
726
|
if not numeric:
|
|
727
727
|
return {"kind": None, "n_min": None, "reason": "no column of numbers to plot"}
|
|
728
728
|
return {"kind": None, "n_min": None,
|
|
729
|
+
# the plot this table needs, named with its own columns (a seaborn plot
|
|
730
|
+
# was suggested instead; PyFigures MCP check 2026-11-21)
|
|
729
731
|
"reason": (f"a tidy table with factors ({', '.join(text)}) and measures "
|
|
730
|
-
f"({', '.join(numeric)}):
|
|
731
|
-
f"
|
|
732
|
+
f"({', '.join(numeric)}): pick one factor and one measure, "
|
|
733
|
+
f"columns=[{text[0]!r}, {numeric[-1]!r}]; another factor as a third column "
|
|
734
|
+
f"(grouped, split_violin) or as facet= (one plot per value)")}
|
|
732
735
|
table = table_from_csv(source)
|
|
733
736
|
else:
|
|
734
737
|
table = source
|
|
@@ -1152,6 +1155,12 @@ def plot(table, kind: str = "bar", *, error: str = "sd", annotate: bool = True,
|
|
|
1152
1155
|
*histogram* (one per column; *bins*); *heatmap* (the table's values; *cmap*).
|
|
1153
1156
|
"""
|
|
1154
1157
|
if ybreak:
|
|
1158
|
+
# these were silently left out of a broken axis (PyFigures MCP check 2026-11-21)
|
|
1159
|
+
if y2:
|
|
1160
|
+
raise ValueError("a broken y axis (ybreak) and a right-hand axis (y2) cannot be combined: "
|
|
1161
|
+
"keep one, or show the second measure in its own plot")
|
|
1162
|
+
if invert_y or log_y:
|
|
1163
|
+
raise ValueError("a broken y axis (ybreak) cannot also be inverted or logarithmic")
|
|
1155
1164
|
return _plot_broken(table, kind, ybreak, dict(
|
|
1156
1165
|
error=error, annotate=annotate, only_significant=only_significant, stats_mode=stats_mode,
|
|
1157
1166
|
title=title, ylabel=ylabel, xlabel=xlabel, colors=colors, show_title=show_title, order=order,
|
|
@@ -1234,7 +1243,11 @@ def _plot_broken(table, kind, ybreak, kwargs, layout, ax=None):
|
|
|
1234
1243
|
broken_axes_marks(top, bottom)
|
|
1235
1244
|
label = ylabel or getattr(table, "value_name", "") or "Value"
|
|
1236
1245
|
if kwargs.get("show_ylabel", True) is not False:
|
|
1237
|
-
|
|
1246
|
+
# on the lower axes, centred on both halves: matplotlib keeps an axis label clear of
|
|
1247
|
+
# the tick labels (a figure supylabel sat on them once the panel was cropped)
|
|
1248
|
+
bottom.set_ylabel(label)
|
|
1249
|
+
b, t = bottom.get_position(), top.get_position()
|
|
1250
|
+
bottom.yaxis.label.set_y(((t.y1 + b.y0) / 2 - b.y0) / b.height)
|
|
1238
1251
|
if title and show_title:
|
|
1239
1252
|
top.set_title(title)
|
|
1240
1253
|
from .plots.extras import one_sided_errors, set_y_ticks
|
|
@@ -23,9 +23,20 @@ def test_broken_y_axis(groups):
|
|
|
23
23
|
fig.canvas.draw()
|
|
24
24
|
assert bottom.get_ylim()[1] == 20 and top.get_ylim()[0] == 350
|
|
25
25
|
assert rec["ybreak"] == [20, 350]
|
|
26
|
-
|
|
26
|
+
# one label for both halves, on the lower axes, clear of its tick labels (a figure
|
|
27
|
+
# supylabel sat on them once PyFigures cropped the panel, MCP check 2026-11-21)
|
|
28
|
+
assert bottom.get_ylabel() == "area" and not top.get_ylabel()
|
|
29
|
+
renderer = fig.canvas.get_renderer()
|
|
30
|
+
label = bottom.yaxis.label.get_window_extent(renderer)
|
|
31
|
+
ticks = [t.get_window_extent(renderer) for t in bottom.get_yticklabels() if t.get_text()]
|
|
32
|
+
assert all(label.x1 <= t.x0 + 0.5 for t in ticks)
|
|
27
33
|
with pytest.raises(ValueError, match="low must be below"):
|
|
28
34
|
api.plot(api.table_from_csv(groups), kind="bar", ybreak=[50, 10])
|
|
35
|
+
# what a broken axis cannot take is refused, never left out silently
|
|
36
|
+
with pytest.raises(ValueError, match="right-hand axis"):
|
|
37
|
+
api.plot(api.table_from_csv(groups), kind="bar", ybreak=[20, 350], y2={"csv": groups, "columns": ["WT"]})
|
|
38
|
+
with pytest.raises(ValueError, match="inverted"):
|
|
39
|
+
api.plot(api.table_from_csv(groups), kind="bar", ybreak=[20, 350], invert_y=True)
|
|
29
40
|
|
|
30
41
|
|
|
31
42
|
def test_dose_response_fit(tmp_path):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.2"
|
|
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
|
|
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
|