figrecipe 0.4.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 (49) hide show
  1. figrecipe-0.4.0/.gitignore +85 -0
  2. figrecipe-0.4.0/CHANGELOG.md +130 -0
  3. figrecipe-0.4.0/LICENSE +661 -0
  4. figrecipe-0.4.0/Makefile +76 -0
  5. figrecipe-0.4.0/PKG-INFO +352 -0
  6. figrecipe-0.4.0/README.md +310 -0
  7. figrecipe-0.4.0/docs/to_claude/examples/pip-project-template/pyproject.toml +160 -0
  8. figrecipe-0.4.0/examples/.ipynb_checkpoints/plotspec_demo-checkpoint.ipynb +751 -0
  9. figrecipe-0.4.0/examples/.ipynb_checkpoints/plotspec_demo_executed-checkpoint.ipynb +1950 -0
  10. figrecipe-0.4.0/examples/01_basic_usage.py +99 -0
  11. figrecipe-0.4.0/examples/01_roundtrip_basic.py +76 -0
  12. figrecipe-0.4.0/examples/02_roundtrip_scatter.py +76 -0
  13. figrecipe-0.4.0/examples/03_roundtrip_bar.py +90 -0
  14. figrecipe-0.4.0/examples/04_roundtrip_hist.py +87 -0
  15. figrecipe-0.4.0/examples/05_seaborn.py +183 -0
  16. figrecipe-0.4.0/examples/06_mm_layout.py +171 -0
  17. figrecipe-0.4.0/examples/07_style.py +192 -0
  18. figrecipe-0.4.0/examples/demo.py +111 -0
  19. figrecipe-0.4.0/examples/figrecipe_demo.ipynb +1741 -0
  20. figrecipe-0.4.0/examples/figrecipe_demo.pdf +0 -0
  21. figrecipe-0.4.0/examples/figrecipe_demo_executed.ipynb +1691 -0
  22. figrecipe-0.4.0/examples/roundtrip_all_types.py +207 -0
  23. figrecipe-0.4.0/pyproject.toml +80 -0
  24. figrecipe-0.4.0/src/figrecipe/__init__.py +798 -0
  25. figrecipe-0.4.0/src/figrecipe/_recorder.py +429 -0
  26. figrecipe-0.4.0/src/figrecipe/_reproducer.py +357 -0
  27. figrecipe-0.4.0/src/figrecipe/_seaborn.py +305 -0
  28. figrecipe-0.4.0/src/figrecipe/_serializer.py +227 -0
  29. figrecipe-0.4.0/src/figrecipe/_signatures/__init__.py +7 -0
  30. figrecipe-0.4.0/src/figrecipe/_signatures/_loader.py +186 -0
  31. figrecipe-0.4.0/src/figrecipe/_utils/__init__.py +25 -0
  32. figrecipe-0.4.0/src/figrecipe/_utils/_diff.py +98 -0
  33. figrecipe-0.4.0/src/figrecipe/_utils/_image_diff.py +204 -0
  34. figrecipe-0.4.0/src/figrecipe/_utils/_numpy_io.py +204 -0
  35. figrecipe-0.4.0/src/figrecipe/_utils/_units.py +161 -0
  36. figrecipe-0.4.0/src/figrecipe/_validator.py +186 -0
  37. figrecipe-0.4.0/src/figrecipe/_wrappers/__init__.py +8 -0
  38. figrecipe-0.4.0/src/figrecipe/_wrappers/_axes.py +327 -0
  39. figrecipe-0.4.0/src/figrecipe/_wrappers/_figure.py +222 -0
  40. figrecipe-0.4.0/src/figrecipe/plt.py +12 -0
  41. figrecipe-0.4.0/src/figrecipe/pyplot.py +248 -0
  42. figrecipe-0.4.0/src/figrecipe/styles/__init__.py +48 -0
  43. figrecipe-0.4.0/src/figrecipe/styles/_style_applier.py +367 -0
  44. figrecipe-0.4.0/src/figrecipe/styles/_style_loader.py +341 -0
  45. figrecipe-0.4.0/tests/__init__.py +3 -0
  46. figrecipe-0.4.0/tests/test_integration.py +230 -0
  47. figrecipe-0.4.0/tests/test_recorder.py +162 -0
  48. figrecipe-0.4.0/tests/test_roundtrip.py +273 -0
  49. figrecipe-0.4.0/tests/test_seaborn.py +181 -0
@@ -0,0 +1,85 @@
1
+ # Claude Code
2
+ CLAUDE.md
3
+ .claude
4
+ docs/to_claude
5
+
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+
32
+ # PyInstaller
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Environments
59
+ .env
60
+ .venv
61
+ env/
62
+ venv/
63
+ ENV/
64
+ env.bak/
65
+ venv.bak/
66
+
67
+ # IDE
68
+ .idea/
69
+ .vscode/
70
+ *.swp
71
+ *.swo
72
+ *~
73
+
74
+ # OS
75
+ .DS_Store
76
+ Thumbs.db
77
+
78
+ # Project specific
79
+ outputs/
80
+ *.png
81
+ *.yaml
82
+ !pyproject.toml
83
+ *.npy
84
+ *.npz
85
+ *.csv
@@ -0,0 +1,130 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.4] - 2025-12-21
9
+
10
+ ### Added
11
+ - **Style presets** - Built-in style presets for easy switching:
12
+ - `SCIENTIFIC` (default): Publication-quality with colorblind-friendly Wong 2011 palette
13
+ - `MINIMAL`: Clean, minimal design with grayscale emphasis
14
+ - `PRESENTATION`: Large fonts and bold lines for slides
15
+ - **`ps.list_presets()`** - List all available style presets
16
+ - **Custom YAML styles** - Load your own style files: `ps.load_style("/path/to/style.yaml")`
17
+ - **Reproducibility validation** - Validate recipe reproduces original figure:
18
+ - `ps.save(fig, path, validate=True)` - Validate on save
19
+ - `ps.validate(path)` - Standalone validation
20
+ - Returns `ValidationResult` with MSE, dimensions, PSNR
21
+ - **Layout recording** - `subplots_adjust` parameters now recorded for pixel-perfect reproduction
22
+ - **Style recording** - Style parameters recorded and re-applied during reproduction
23
+
24
+ ### Changed
25
+ - Renamed brand-specific "SCITEX" references to generic "SCIENTIFIC" preset
26
+ - `ps.load_style()` now accepts preset names: `ps.load_style("MINIMAL")`
27
+ - Default style is now the SCIENTIFIC preset
28
+
29
+ ### Fixed
30
+ - **Pixel-perfect reproduction** - MM-layout and styled figures now reproduce with MSE=0
31
+
32
+ ## [0.3.2] - 2025-12-21
33
+
34
+ ### Added
35
+ - **Colorblind-friendly color palette** - Scientific color palette automatically applied via rcParams
36
+ - Blue (#0072B2), Orange (#D55E00), Green (#009E73), Purple (#CC79A7), etc.
37
+ - Access via `style.colors.palette` or auto-cycling in plots
38
+ - **Transparent background** - Default light theme now uses transparent background
39
+
40
+ ### Fixed
41
+ - **Title overlap in multi-panel figures** - Added proper `subplots_adjust()` based on mm layout parameters
42
+ - **n_ticks** - Changed default from 5 to 4 for cleaner tick labels
43
+
44
+ ### Changed
45
+ - Style applier now sets matplotlib color cycle from style palette
46
+
47
+ ## [0.3.1] - 2025-12-21
48
+
49
+ ### Fixed
50
+ - **Seaborn duplicate recording** - Seaborn calls no longer record underlying matplotlib calls (e.g., `ax.scatter()` from `sns.scatterplot()`)
51
+ - **Seaborn sizes parameter** - `sizes=(min, max)` tuples now correctly serialize and deserialize, fixing the legend reproduction issue where all size values were listed instead of grouped ranges
52
+
53
+ ## [0.3.0] - 2025-12-21
54
+
55
+ ### Added
56
+ - **MM-based layout system** for publication-quality figures
57
+ - `axes_width_mm`, `axes_height_mm` parameters for precise axes sizing
58
+ - `margin_left_mm`, `margin_right_mm`, `margin_bottom_mm`, `margin_top_mm` for margins
59
+ - `space_w_mm`, `space_h_mm` for spacing between axes in multi-panel figures
60
+ - **Style system** inspired by SciTeX
61
+ - `ps.load_style()` to load style configuration from YAML
62
+ - `ps.apply_style()` to apply publication-quality styling to axes
63
+ - `ps.STYLE` proxy for quick access to default style
64
+ - `FIGRECIPE_STYLE.yaml` default configuration with:
65
+ - Font sizes (axis labels, tick labels, title, legend)
66
+ - Line thicknesses in mm
67
+ - Tick parameters in mm
68
+ - Theme support (light/dark mode)
69
+ - **Unit conversion utilities**
70
+ - `ps.mm_to_inch()`, `ps.inch_to_mm()`
71
+ - `ps.mm_to_pt()`, `ps.pt_to_mm()`
72
+ - Example `06_mm_layout_and_style.py` demonstrating new features
73
+
74
+ ### Changed
75
+ - `ps.subplots()` now accepts mm-based layout parameters
76
+ - `ps.subplots()` accepts `apply_style_mm=True` for automatic style application
77
+ - Version updated to 0.3.0
78
+
79
+ ## [0.2.0] - 2025-12-21
80
+
81
+ ### Added
82
+ - CHANGELOG.md for tracking version history
83
+ - Version bump for PyPI publication
84
+
85
+ ### Changed
86
+ - Version updated to 0.2.0
87
+
88
+ ## [0.1.0] - 2025-12-21
89
+
90
+ ### Added
91
+ - Core recording functionality via `ps.subplots()` wrapper
92
+ - YAML-based recipe format for figure serialization
93
+ - `ps.save()` function to export figures as recipes
94
+ - `ps.reproduce()` function to recreate figures from recipes
95
+ - `ps.info()` function to inspect recipe metadata
96
+ - CSV as default data format for human readability
97
+ - NPZ format support for binary data storage
98
+ - External data file support for large arrays (>100 elements)
99
+ - Custom call IDs for identifying plot elements
100
+ - Selective call reproduction via `calls` parameter
101
+ - Seaborn integration (`ps.sns.scatterplot()`, `ps.sns.lineplot()`, etc.)
102
+ - DataFrame column serialization for seaborn plots
103
+ - Makefile for common development tasks
104
+ - Comprehensive test suite (40 tests)
105
+ - Example scripts demonstrating core functionality
106
+
107
+ ### Supported matplotlib methods
108
+ - `plot()` - line plots
109
+ - `scatter()` - scatter plots
110
+ - `bar()`, `barh()` - bar charts
111
+ - `fill_between()` - filled areas
112
+ - `step()` - step plots
113
+ - `errorbar()` - error bar plots
114
+ - `hist()` - histograms
115
+ - `imshow()` - image display
116
+ - `contour()`, `contourf()` - contour plots
117
+ - `set_xlabel()`, `set_ylabel()`, `set_title()` - decorations
118
+ - `legend()`, `grid()` - additional decorations
119
+
120
+ ### Supported seaborn functions
121
+ - `scatterplot()` - scatter plots with hue/size support
122
+ - `lineplot()` - line plots with confidence intervals
123
+ - Additional functions available but may need further testing
124
+
125
+ [0.3.4]: https://github.com/ywatanabe1989/figrecipe/compare/v0.3.2...v0.3.4
126
+ [0.3.2]: https://github.com/ywatanabe1989/figrecipe/compare/v0.3.1...v0.3.2
127
+ [0.3.1]: https://github.com/ywatanabe1989/figrecipe/compare/v0.3.0...v0.3.1
128
+ [0.3.0]: https://github.com/ywatanabe1989/figrecipe/compare/v0.2.0...v0.3.0
129
+ [0.2.0]: https://github.com/ywatanabe1989/figrecipe/compare/v0.1.0...v0.2.0
130
+ [0.1.0]: https://github.com/ywatanabe1989/figrecipe/releases/tag/v0.1.0