augplot 0.1.0__tar.gz → 0.2.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 (54) hide show
  1. augplot-0.2.0/CHANGELOG.md +37 -0
  2. {augplot-0.1.0 → augplot-0.2.0}/PKG-INFO +41 -2
  3. {augplot-0.1.0 → augplot-0.2.0}/README.md +40 -1
  4. {augplot-0.1.0 → augplot-0.2.0}/SECURITY.md +3 -2
  5. {augplot-0.1.0 → augplot-0.2.0}/docs/api.md +7 -2
  6. augplot-0.2.0/docs/assets/cross-validation-comparison.png +0 -0
  7. augplot-0.2.0/docs/assets/quickstart-seasonal-heatmap.png +0 -0
  8. augplot-0.2.0/docs/generated-code-guardrails.md +66 -0
  9. augplot-0.2.0/examples/cross-validation-model-comparison.ipynb +953 -0
  10. augplot-0.2.0/examples/quickstart.ipynb +748 -0
  11. {augplot-0.1.0 → augplot-0.2.0}/pyproject.toml +1 -1
  12. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/__init__.py +1 -1
  13. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/core.py +45 -10
  14. augplot-0.2.0/src/augplot/execution.py +683 -0
  15. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/history.py +3 -3
  16. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/profiling.py +6 -2
  17. augplot-0.2.0/src/augplot/prompts.py +124 -0
  18. {augplot-0.1.0 → augplot-0.2.0}/tests/test_execution.py +343 -74
  19. {augplot-0.1.0 → augplot-0.2.0}/tests/test_history.py +15 -1
  20. {augplot-0.1.0 → augplot-0.2.0}/tests/test_notebook.py +1 -1
  21. {augplot-0.1.0 → augplot-0.2.0}/tests/test_profiling.py +18 -2
  22. augplot-0.2.0/tests/test_prompts.py +59 -0
  23. {augplot-0.1.0 → augplot-0.2.0}/tests/test_workflow.py +144 -0
  24. augplot-0.2.0/tests/titanic_fixture.py +40 -0
  25. augplot-0.1.0/CHANGELOG.md +0 -16
  26. augplot-0.1.0/docs/generated-code-guardrails.md +0 -70
  27. augplot-0.1.0/examples/quickstart.ipynb +0 -841
  28. augplot-0.1.0/src/augplot/execution.py +0 -1285
  29. augplot-0.1.0/src/augplot/prompts.py +0 -208
  30. augplot-0.1.0/tests/test_prompts.py +0 -97
  31. {augplot-0.1.0 → augplot-0.2.0}/.github/dependabot.yml +0 -0
  32. {augplot-0.1.0 → augplot-0.2.0}/.github/workflows/codeql.yml +0 -0
  33. {augplot-0.1.0 → augplot-0.2.0}/.github/workflows/release.yml +0 -0
  34. {augplot-0.1.0 → augplot-0.2.0}/.github/workflows/tests.yml +0 -0
  35. {augplot-0.1.0 → augplot-0.2.0}/.gitignore +0 -0
  36. {augplot-0.1.0 → augplot-0.2.0}/AGENTS.md +0 -0
  37. {augplot-0.1.0 → augplot-0.2.0}/CODE_OF_CONDUCT.md +0 -0
  38. {augplot-0.1.0 → augplot-0.2.0}/CONTRIBUTING.md +0 -0
  39. {augplot-0.1.0 → augplot-0.2.0}/LICENSE +0 -0
  40. {augplot-0.1.0 → augplot-0.2.0}/NOTICE +0 -0
  41. {augplot-0.1.0 → augplot-0.2.0}/docs/assets/augplot-workflow.png +0 -0
  42. {augplot-0.1.0 → augplot-0.2.0}/docs/visualization-history.md +0 -0
  43. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/datasets.py +0 -0
  44. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/errors.py +0 -0
  45. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/exporting.py +0 -0
  46. {augplot-0.1.0 → augplot-0.2.0}/src/augplot/provider.py +0 -0
  47. {augplot-0.1.0 → augplot-0.2.0}/tests/conftest.py +0 -0
  48. {augplot-0.1.0 → augplot-0.2.0}/tests/notebook_charts.py +0 -0
  49. {augplot-0.1.0 → augplot-0.2.0}/tests/test_datasets.py +0 -0
  50. {augplot-0.1.0 → augplot-0.2.0}/tests/test_display.py +0 -0
  51. {augplot-0.1.0 → augplot-0.2.0}/tests/test_export.py +0 -0
  52. {augplot-0.1.0 → augplot-0.2.0}/tests/test_live.py +0 -0
  53. {augplot-0.1.0 → augplot-0.2.0}/tests/test_metadata.py +0 -0
  54. {augplot-0.1.0 → augplot-0.2.0}/tests/test_provider.py +0 -0
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to Augplot are documented in this file.
4
+
5
+ ## [0.2.0] - 2026-09-23
6
+
7
+ ### Changed
8
+
9
+ - Replace the plotting capability manifest with a smaller security-focused validator.
10
+ Common Pandas/NumPy transformations, local assignments, and data-sized loops now work
11
+ without method-by-method approval.
12
+ - Keep checks for imports, file and network access, subprocess and dynamic execution,
13
+ reflection, active rendering options, and obvious resource bombs.
14
+ - Shorten generation guidance and invalidate cached code accepted under the old policy.
15
+ - Report generation and repair progress, including a notice after 20 seconds of waiting.
16
+ - Improve chart guidance for titles, legends, labels, uncertainty notes, and spacing.
17
+ - Refresh the quickstart notebook and add an anonymized cross-validation walkthrough.
18
+
19
+ ## [0.1.1] - 2026-09-23
20
+
21
+ ### Changed
22
+
23
+ - Broaden guarded plotting compatibility for timeline annotations, axis styling,
24
+ data-sized positions, and additional Pandas and NumPy data shapes.
25
+
26
+ ## [0.1.0] - 2026-09-22
27
+
28
+ Initial beta release.
29
+
30
+ ### Added
31
+
32
+ - Notebook-first `plot`, `refine`, `render`, and `to_python` workflow.
33
+ - Support for Pandas objects, NumPy arrays, lists, and nested dictionaries.
34
+ - Persistent visualization history for replaying and revising generated plots.
35
+ - Validated local execution of generated Matplotlib and Seaborn code.
36
+ - Strict JSON Schema model responses with explicit provider capability checks.
37
+ - Seaborn example-dataset loading and a quickstart notebook.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: augplot
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Turn notebook data into visualizations and reusable Python with an LLM.
5
5
  Project-URL: Repository, https://github.com/egpand/augplot
6
6
  Project-URL: Documentation, https://github.com/egpand/augplot/tree/main/docs
@@ -78,6 +78,45 @@ viz.to_python(function_name="plot_monthly_passengers")
78
78
  Open or download the [example notebook](examples/quickstart.ipynb) to try the complete
79
79
  workflow.
80
80
 
81
+ For nested cross-validation results, try the
82
+ [model comparison notebook](examples/cross-validation-model-comparison.ipynb). It starts
83
+ with an inline results dictionary, successive refinements, and an intentional
84
+ `ScopeError` example.
85
+
86
+ ## What can `data` be?
87
+
88
+ `ap.plot(data)` accepts these nonempty, in-memory Python objects:
89
+
90
+ | Input | Typical use |
91
+ | --- | --- |
92
+ | `pandas.DataFrame` | Rows and columns, including dates and categories. |
93
+ | `pandas.Series` | One labeled sequence of values. |
94
+ | `numpy.ndarray` | One- or two-dimensional numeric or mixed data. |
95
+ | `list` or `tuple` | Values such as `[2, 4, 6]`, or records such as `[{'x': 1, 'y': 2}]`. |
96
+ | `dict` | Columns such as `{'x': [1, 2], 'y': [2, 3]}`, or nested results keyed by model and metric. |
97
+
98
+ Nested lists and dictionaries can contain ordinary scalars, missing values, NumPy arrays,
99
+ and Pandas objects. Parsed JSON is therefore a valid input when its root is a nonempty
100
+ list or dictionary:
101
+
102
+ ```python
103
+ import json
104
+
105
+ records = json.loads('[{"month": "Jan", "sales": 10}, {"month": "Feb", "sales": 12}]')
106
+ viz = ap.plot(records)
107
+
108
+ results = {
109
+ "baseline": {"test_f1": [0.3, 0.4, 0.5]},
110
+ "candidate": {"test_f1": [0.4, 0.5, 0.6]},
111
+ }
112
+ viz = ap.plot(results, prompt="Compare F1 scores across models")
113
+ ```
114
+
115
+ Pass the parsed object, not a JSON string or file path. Empty inputs, cyclic containers,
116
+ custom objects, and NumPy arrays with zero or more than two dimensions raise `DataError`.
117
+ For a Pandas `Index`, another table library, or an iterator, convert to one of the types
118
+ above first.
119
+
81
120
  ## Workflow
82
121
 
83
122
  - `plot()` generates the initial visualization.
@@ -139,7 +178,7 @@ but does not train models or return predictions, forecasts, or other analytical
139
178
 
140
179
  ## Beta and security
141
180
 
142
- Augplot 0.1.0 is a beta release; APIs and saved-history formats may change before 1.0.
181
+ Augplot 0.2.0 is a beta release; APIs and saved-history formats may change before 1.0.
143
182
  Review generated code before sensitive or security-critical use, and report
144
183
  vulnerabilities through the [security policy](SECURITY.md).
145
184
 
@@ -40,6 +40,45 @@ viz.to_python(function_name="plot_monthly_passengers")
40
40
  Open or download the [example notebook](examples/quickstart.ipynb) to try the complete
41
41
  workflow.
42
42
 
43
+ For nested cross-validation results, try the
44
+ [model comparison notebook](examples/cross-validation-model-comparison.ipynb). It starts
45
+ with an inline results dictionary, successive refinements, and an intentional
46
+ `ScopeError` example.
47
+
48
+ ## What can `data` be?
49
+
50
+ `ap.plot(data)` accepts these nonempty, in-memory Python objects:
51
+
52
+ | Input | Typical use |
53
+ | --- | --- |
54
+ | `pandas.DataFrame` | Rows and columns, including dates and categories. |
55
+ | `pandas.Series` | One labeled sequence of values. |
56
+ | `numpy.ndarray` | One- or two-dimensional numeric or mixed data. |
57
+ | `list` or `tuple` | Values such as `[2, 4, 6]`, or records such as `[{'x': 1, 'y': 2}]`. |
58
+ | `dict` | Columns such as `{'x': [1, 2], 'y': [2, 3]}`, or nested results keyed by model and metric. |
59
+
60
+ Nested lists and dictionaries can contain ordinary scalars, missing values, NumPy arrays,
61
+ and Pandas objects. Parsed JSON is therefore a valid input when its root is a nonempty
62
+ list or dictionary:
63
+
64
+ ```python
65
+ import json
66
+
67
+ records = json.loads('[{"month": "Jan", "sales": 10}, {"month": "Feb", "sales": 12}]')
68
+ viz = ap.plot(records)
69
+
70
+ results = {
71
+ "baseline": {"test_f1": [0.3, 0.4, 0.5]},
72
+ "candidate": {"test_f1": [0.4, 0.5, 0.6]},
73
+ }
74
+ viz = ap.plot(results, prompt="Compare F1 scores across models")
75
+ ```
76
+
77
+ Pass the parsed object, not a JSON string or file path. Empty inputs, cyclic containers,
78
+ custom objects, and NumPy arrays with zero or more than two dimensions raise `DataError`.
79
+ For a Pandas `Index`, another table library, or an iterator, convert to one of the types
80
+ above first.
81
+
43
82
  ## Workflow
44
83
 
45
84
  - `plot()` generates the initial visualization.
@@ -101,7 +140,7 @@ but does not train models or return predictions, forecasts, or other analytical
101
140
 
102
141
  ## Beta and security
103
142
 
104
- Augplot 0.1.0 is a beta release; APIs and saved-history formats may change before 1.0.
143
+ Augplot 0.2.0 is a beta release; APIs and saved-history formats may change before 1.0.
105
144
  Review generated code before sensitive or security-critical use, and report
106
145
  vulnerabilities through the [security policy](SECURITY.md).
107
146
 
@@ -2,12 +2,13 @@
2
2
 
3
3
  ## Supported versions
4
4
 
5
- Augplot is currently in beta. Security fixes are provided for the latest `0.1.x`
5
+ Augplot is currently in beta. Security fixes are provided for the latest `0.2.x`
6
6
  release and the `main` branch.
7
7
 
8
8
  | Version | Supported |
9
9
  | --- | --- |
10
- | 0.1.x | Yes |
10
+ | 0.2.x | Yes |
11
+ | 0.1.x | No |
11
12
  | Earlier versions | No |
12
13
 
13
14
  ## Reporting a vulnerability
@@ -11,8 +11,9 @@ import augplot as ap
11
11
  plt = ap.plot(data, prompt="Plot revenue by channel")
12
12
  ```
13
13
 
14
- `ap.plot()` accepts Pandas objects, NumPy arrays, lists, and nested dictionaries. It
15
- returns the current Augplot chart object and displays its figure by default.
14
+ `ap.plot()` accepts Pandas objects, one- or two-dimensional NumPy arrays, lists, tuples,
15
+ and nested dictionaries. It returns the current Augplot chart object and displays its
16
+ figure by default.
16
17
 
17
18
  ```python
18
19
  plt = ap.plot(
@@ -47,6 +48,10 @@ plt = ap.plot(
47
48
  | `show` | Display the resulting figure in the notebook. |
48
49
  | `regenerate` | Request new code instead of replaying the matching saved step. |
49
50
 
51
+ Fresh generations print the current attempt (`plotting` or `repairing`) and when returned
52
+ code is checked. A request still waiting after 20 seconds prints another status line.
53
+ Saved-history replays do not make model requests or print these progress messages.
54
+
50
55
  ## Refine the current chart
51
56
 
52
57
  ```python
@@ -0,0 +1,66 @@
1
+ # Generated-code guardrails
2
+
3
+ Augplot validates model-generated Python before running it in the notebook process.
4
+ The 0.2.0 validator focuses on security-sensitive operations and obvious resource
5
+ bombs. It is a defense-in-depth check, **not an operating-system sandbox**. Python
6
+ libraries can have side effects that static checks cannot reliably identify.
7
+
8
+ ## Generated-code contract
9
+
10
+ Code defines one undecorated `plot_data(data, *, title=None, figsize=None)` function,
11
+ imports approved plotting/data libraries inside it, and returns a Matplotlib Figure.
12
+ The returned value is checked at runtime. Augplot passes a copy of the input data
13
+ and closes figures opened during execution. Generated source may use ordinary Pandas
14
+ and NumPy transformations, assignment to local data, loops, comprehensions, and
15
+ Matplotlib or Seaborn plotting APIs. There is no chart-type or artist-method manifest.
16
+
17
+ ## Security checks
18
+
19
+ The validator rejects:
20
+
21
+ - Imports outside NumPy, Pandas, Matplotlib pyplot/ticker/dates, and Seaborn; Seaborn
22
+ imports also require a compatible backend.
23
+ - File, network, subprocess, environment, serialization, and plot-export APIs,
24
+ including read/write/save methods and module-internal traversal.
25
+ - Dynamic execution, indirect calls, private/dunder access, nested definitions,
26
+ reflection routes, and active rendering options such as external URLs or `usetex`.
27
+ - Pandas string dispatch to arbitrary method names and explicit plotting-backend
28
+ selection. Simple aggregation names and direct safe NumPy functions are accepted.
29
+ - Oversized source, ASTs, literals, numeric ranges, static array allocations,
30
+ subplot grids, figure dimensions, and format widths.
31
+
32
+ For example, these are rejected before compilation:
33
+
34
+ ```python
35
+ pd.read_csv("https://example.invalid/data.csv")
36
+ frame.to_pickle("chart.pkl")
37
+ fig.savefig("chart.png")
38
+ ```
39
+
40
+ The checks are intentionally modest. Data-sized loops and allocations are allowed,
41
+ so a large input or expensive plotting operation can still use substantial CPU or
42
+ memory. The AST rules reduce obvious side effects but cannot guarantee that every
43
+ public third-party method is side-effect free. Do not use Augplot with sensitive data
44
+ where executing model-produced Python is unacceptable.
45
+
46
+ ## Validation failures and saved plots
47
+
48
+ Fresh model output receives at most the configured repair attempt (`max_repairs=1` by
49
+ default). The repair request contains a sanitized validation diagnostic, not data
50
+ values or a runtime exception message. If repair fails, `ap.plot()` raises
51
+ `GenerationError`; rejected source is not executed, displayed, exported, or saved.
52
+
53
+ ```python
54
+ try:
55
+ viz = ap.plot(data, prompt="...")
56
+ except ap.GenerationError as exc:
57
+ print(exc)
58
+ print(exc.violations)
59
+ print(exc.code)
60
+ ```
61
+
62
+ Saved source is revalidated on every replay. The validator version is part of the
63
+ cache identity and metadata, so code accepted under an older policy is not silently
64
+ reused. A cache checksum establishes file integrity, not trust. If saved code is
65
+ rejected, Augplot does not make an automatic model request; use `regenerate=True`
66
+ when you want new code.