augplot 0.1.1__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.1 → augplot-0.2.0}/PKG-INFO +7 -2
  3. {augplot-0.1.1 → augplot-0.2.0}/README.md +6 -1
  4. {augplot-0.1.1 → augplot-0.2.0}/SECURITY.md +3 -2
  5. {augplot-0.1.1 → augplot-0.2.0}/docs/api.md +4 -0
  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.1 → augplot-0.2.0}/pyproject.toml +1 -1
  12. {augplot-0.1.1 → augplot-0.2.0}/src/augplot/__init__.py +1 -1
  13. {augplot-0.1.1 → 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.1 → augplot-0.2.0}/src/augplot/history.py +3 -3
  16. augplot-0.2.0/src/augplot/prompts.py +124 -0
  17. {augplot-0.1.1 → augplot-0.2.0}/tests/test_execution.py +124 -206
  18. {augplot-0.1.1 → augplot-0.2.0}/tests/test_history.py +15 -1
  19. {augplot-0.1.1 → augplot-0.2.0}/tests/test_notebook.py +1 -1
  20. augplot-0.2.0/tests/test_prompts.py +59 -0
  21. {augplot-0.1.1 → augplot-0.2.0}/tests/test_workflow.py +72 -0
  22. augplot-0.1.1/CHANGELOG.md +0 -16
  23. augplot-0.1.1/docs/generated-code-guardrails.md +0 -83
  24. augplot-0.1.1/examples/quickstart.ipynb +0 -841
  25. augplot-0.1.1/src/augplot/execution.py +0 -1462
  26. augplot-0.1.1/src/augplot/prompts.py +0 -226
  27. augplot-0.1.1/tests/test_prompts.py +0 -104
  28. {augplot-0.1.1 → augplot-0.2.0}/.github/dependabot.yml +0 -0
  29. {augplot-0.1.1 → augplot-0.2.0}/.github/workflows/codeql.yml +0 -0
  30. {augplot-0.1.1 → augplot-0.2.0}/.github/workflows/release.yml +0 -0
  31. {augplot-0.1.1 → augplot-0.2.0}/.github/workflows/tests.yml +0 -0
  32. {augplot-0.1.1 → augplot-0.2.0}/.gitignore +0 -0
  33. {augplot-0.1.1 → augplot-0.2.0}/AGENTS.md +0 -0
  34. {augplot-0.1.1 → augplot-0.2.0}/CODE_OF_CONDUCT.md +0 -0
  35. {augplot-0.1.1 → augplot-0.2.0}/CONTRIBUTING.md +0 -0
  36. {augplot-0.1.1 → augplot-0.2.0}/LICENSE +0 -0
  37. {augplot-0.1.1 → augplot-0.2.0}/NOTICE +0 -0
  38. {augplot-0.1.1 → augplot-0.2.0}/docs/assets/augplot-workflow.png +0 -0
  39. {augplot-0.1.1 → augplot-0.2.0}/docs/visualization-history.md +0 -0
  40. {augplot-0.1.1 → augplot-0.2.0}/src/augplot/datasets.py +0 -0
  41. {augplot-0.1.1 → augplot-0.2.0}/src/augplot/errors.py +0 -0
  42. {augplot-0.1.1 → augplot-0.2.0}/src/augplot/exporting.py +0 -0
  43. {augplot-0.1.1 → augplot-0.2.0}/src/augplot/profiling.py +0 -0
  44. {augplot-0.1.1 → augplot-0.2.0}/src/augplot/provider.py +0 -0
  45. {augplot-0.1.1 → augplot-0.2.0}/tests/conftest.py +0 -0
  46. {augplot-0.1.1 → augplot-0.2.0}/tests/notebook_charts.py +0 -0
  47. {augplot-0.1.1 → augplot-0.2.0}/tests/test_datasets.py +0 -0
  48. {augplot-0.1.1 → augplot-0.2.0}/tests/test_display.py +0 -0
  49. {augplot-0.1.1 → augplot-0.2.0}/tests/test_export.py +0 -0
  50. {augplot-0.1.1 → augplot-0.2.0}/tests/test_live.py +0 -0
  51. {augplot-0.1.1 → augplot-0.2.0}/tests/test_metadata.py +0 -0
  52. {augplot-0.1.1 → augplot-0.2.0}/tests/test_profiling.py +0 -0
  53. {augplot-0.1.1 → augplot-0.2.0}/tests/test_provider.py +0 -0
  54. {augplot-0.1.1 → augplot-0.2.0}/tests/titanic_fixture.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.1
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,11 @@ 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
+
81
86
  ## What can `data` be?
82
87
 
83
88
  `ap.plot(data)` accepts these nonempty, in-memory Python objects:
@@ -173,7 +178,7 @@ but does not train models or return predictions, forecasts, or other analytical
173
178
 
174
179
  ## Beta and security
175
180
 
176
- Augplot 0.1.1 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.
177
182
  Review generated code before sensitive or security-critical use, and report
178
183
  vulnerabilities through the [security policy](SECURITY.md).
179
184
 
@@ -40,6 +40,11 @@ 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
+
43
48
  ## What can `data` be?
44
49
 
45
50
  `ap.plot(data)` accepts these nonempty, in-memory Python objects:
@@ -135,7 +140,7 @@ but does not train models or return predictions, forecasts, or other analytical
135
140
 
136
141
  ## Beta and security
137
142
 
138
- Augplot 0.1.1 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.
139
144
  Review generated code before sensitive or security-critical use, and report
140
145
  vulnerabilities through the [security policy](SECURITY.md).
141
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
@@ -48,6 +48,10 @@ plt = ap.plot(
48
48
  | `show` | Display the resulting figure in the notebook. |
49
49
  | `regenerate` | Request new code instead of replaying the matching saved step. |
50
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
+
51
55
  ## Refine the current chart
52
56
 
53
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.