figurekit 0.5.1__tar.gz → 0.6.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 (80) hide show
  1. {figurekit-0.5.1 → figurekit-0.6.0}/CHANGELOG.md +20 -1
  2. {figurekit-0.5.1 → figurekit-0.6.0}/PKG-INFO +25 -3
  3. {figurekit-0.5.1 → figurekit-0.6.0}/README.md +24 -2
  4. figurekit-0.6.0/docs/examples/formula-dark.png +0 -0
  5. figurekit-0.6.0/docs/examples/formula-dark.svg +1808 -0
  6. figurekit-0.6.0/docs/examples/formula.png +0 -0
  7. figurekit-0.6.0/docs/examples/formula.svg +1808 -0
  8. figurekit-0.6.0/docs/examples/multiples-dark.png +0 -0
  9. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/multiples-dark.svg +21 -27
  10. figurekit-0.6.0/docs/examples/multiples.png +0 -0
  11. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/multiples.svg +21 -27
  12. {figurekit-0.5.1 → figurekit-0.6.0}/docs/style-guide.md +5 -0
  13. figurekit-0.6.0/notes.md +21 -0
  14. {figurekit-0.5.1 → figurekit-0.6.0}/pyproject.toml +1 -1
  15. {figurekit-0.5.1 → figurekit-0.6.0}/scripts/examples.py +33 -2
  16. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/__init__.py +2 -0
  17. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/export.py +49 -3
  18. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/theme.py +54 -4
  19. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/tokens.json +2 -1
  20. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/tokens.schema.json +17 -0
  21. figurekit-0.6.0/tests/test_math.py +141 -0
  22. {figurekit-0.5.1 → figurekit-0.6.0}/uv.lock +1 -1
  23. figurekit-0.5.1/docs/examples/multiples-dark.png +0 -0
  24. figurekit-0.5.1/docs/examples/multiples.png +0 -0
  25. figurekit-0.5.1/notes.md +0 -12
  26. {figurekit-0.5.1 → figurekit-0.6.0}/.gitattributes +0 -0
  27. {figurekit-0.5.1 → figurekit-0.6.0}/.github/workflows/ci.yml +0 -0
  28. {figurekit-0.5.1 → figurekit-0.6.0}/.github/workflows/release.yml +0 -0
  29. {figurekit-0.5.1 → figurekit-0.6.0}/.gitignore +0 -0
  30. {figurekit-0.5.1 → figurekit-0.6.0}/.pre-commit-config.yaml +0 -0
  31. {figurekit-0.5.1 → figurekit-0.6.0}/LICENSE +0 -0
  32. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/bars-dark.png +0 -0
  33. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/bars-dark.svg +0 -0
  34. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/bars.png +0 -0
  35. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/bars.svg +0 -0
  36. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/card-dark.png +0 -0
  37. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/card.png +0 -0
  38. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/heatmap-dark.png +0 -0
  39. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/heatmap-dark.svg +0 -0
  40. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/heatmap.png +0 -0
  41. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/heatmap.svg +0 -0
  42. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/lines-dark.png +0 -0
  43. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/lines-dark.svg +0 -0
  44. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/lines.png +0 -0
  45. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/lines.svg +0 -0
  46. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/lines-dark.png +0 -0
  47. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/lines-dark.svg +0 -0
  48. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/lines-print.png +0 -0
  49. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/lines-print.svg +0 -0
  50. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/lines.png +0 -0
  51. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/lines.svg +0 -0
  52. {figurekit-0.5.1 → figurekit-0.6.0}/docs/examples/style/tokens.json +0 -0
  53. {figurekit-0.5.1 → figurekit-0.6.0}/docs/readme/before.svg +0 -0
  54. {figurekit-0.5.1 → figurekit-0.6.0}/docs/readme/modes.png +0 -0
  55. {figurekit-0.5.1 → figurekit-0.6.0}/scripts/build_fonts.py +0 -0
  56. {figurekit-0.5.1 → figurekit-0.6.0}/scripts/check_package.sh +0 -0
  57. {figurekit-0.5.1 → figurekit-0.6.0}/scripts/release_notes.py +0 -0
  58. {figurekit-0.5.1 → figurekit-0.6.0}/scripts/smoke.py +0 -0
  59. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/access.py +0 -0
  60. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/check.py +0 -0
  61. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/cli.py +0 -0
  62. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/fonts/BricolageGrotesque-Regular.ttf +0 -0
  63. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/fonts/BricolageGrotesque-SemiBold.ttf +0 -0
  64. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/fonts/JetBrainsMono-Regular.ttf +0 -0
  65. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/fonts/JetBrainsMono-SemiBold.ttf +0 -0
  66. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/fonts/OFL-BricolageGrotesque.txt +0 -0
  67. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/fonts/OFL-JetBrainsMono.txt +0 -0
  68. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/helpers.py +0 -0
  69. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/language.py +0 -0
  70. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/manifest.py +0 -0
  71. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/preview.py +0 -0
  72. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/project.py +0 -0
  73. {figurekit-0.5.1 → figurekit-0.6.0}/src/figkit/py.typed +0 -0
  74. {figurekit-0.5.1 → figurekit-0.6.0}/tests/conftest.py +0 -0
  75. {figurekit-0.5.1 → figurekit-0.6.0}/tests/test_access.py +0 -0
  76. {figurekit-0.5.1 → figurekit-0.6.0}/tests/test_figkit.py +0 -0
  77. {figurekit-0.5.1 → figurekit-0.6.0}/tests/test_language.py +0 -0
  78. {figurekit-0.5.1 → figurekit-0.6.0}/tests/test_project.py +0 -0
  79. {figurekit-0.5.1 → figurekit-0.6.0}/tests/test_release.py +0 -0
  80. {figurekit-0.5.1 → figurekit-0.6.0}/tests/test_style.py +0 -0
@@ -6,6 +6,24 @@ section of that version.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.6.0] - 2026-11-28
10
+
11
+ ### Added
12
+
13
+ - `font.math` in the tokens names the fonts of formulas: `italic` for variables and `fallback`
14
+ for characters that the other fonts lack.
15
+ - `render` fails with the character and the figure when a text or formula needs a glyph that no
16
+ font has, before it writes any file. `complete_glyphs` makes the same check for other code.
17
+ - The gallery shows a fitted decay with its formula and the fitted parameters in the subtitle.
18
+
19
+ ### Changed
20
+
21
+ - Formulas set variables and Greek letters in DejaVu Sans italic, which comes with matplotlib.
22
+ Before, variables were upright in Bricolage Grotesque and Greek letters came from the serif
23
+ Computer Modern. Figures with formulas change on the next render.
24
+ - `register_fonts` fails if the math italic has no italic face instead of setting variables
25
+ upright.
26
+
9
27
  ## [0.5.1] - 2026-11-27
10
28
 
11
29
  ### Changed
@@ -175,7 +193,8 @@ section of that version.
175
193
  label of a vertical reference line goes on either side.
176
194
  - `figkit check` for light/dark pairs, transparency and file sizes.
177
195
 
178
- [Unreleased]: https://github.com/BenBotsch/FigureKit/compare/v0.5.1...HEAD
196
+ [Unreleased]: https://github.com/BenBotsch/FigureKit/compare/v0.6.0...HEAD
197
+ [0.6.0]: https://github.com/BenBotsch/FigureKit/compare/v0.5.1...v0.6.0
179
198
  [0.5.1]: https://github.com/BenBotsch/FigureKit/compare/v0.5.0...v0.5.1
180
199
  [0.5.0]: https://github.com/BenBotsch/FigureKit/compare/v0.4.0...v0.5.0
181
200
  [0.4.0]: https://github.com/BenBotsch/FigureKit/compare/v0.3.1...v0.4.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: figurekit
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: One figure style for every project: light and dark themes, transparent SVG and PNG, Bricolage Grotesque and JetBrains Mono, reproducible files.
5
5
  Project-URL: Repository, https://github.com/BenBotsch/FigureKit
6
6
  Project-URL: Issues, https://github.com/BenBotsch/FigureKit/issues
@@ -190,7 +190,7 @@ for (i, j), count in np.ndenumerate(counts):
190
190
 
191
191
  <picture>
192
192
  <source media="(prefers-color-scheme: dark)" srcset="docs/examples/multiples-dark.svg">
193
- <img src="https://raw.githubusercontent.com/BenBotsch/FigureKit/main/docs/examples/multiples.svg" alt="Three panels of learning curves, macro F1 against training images, each line with a shaded band; the middle one points out its plateau.">
193
+ <img src="https://raw.githubusercontent.com/BenBotsch/FigureKit/main/docs/examples/multiples.svg" alt="Three panels of learning curves, macro F₁ against training images, each line with a shaded band; the middle one points out its plateau.">
194
194
  </picture>
195
195
 
196
196
  ```python
@@ -206,6 +206,27 @@ for points instead of lines.
206
206
 
207
207
  </details>
208
208
 
209
+ <details>
210
+ <summary><b>Formulas</b> with italic variables and Greek letters</summary>
211
+
212
+ <picture>
213
+ <source media="(prefers-color-scheme: dark)" srcset="docs/examples/formula-dark.svg">
214
+ <img src="https://raw.githubusercontent.com/BenBotsch/FigureKit/main/docs/examples/formula.svg" alt="Training loss per epoch with error bars and a fitted exponential decay, labelled L(t) = α e^(−t/τ) + β, with the fitted α, τ and β in the subtitle.">
215
+ </picture>
216
+
217
+ ```python
218
+ ax.plot(t, alpha * np.exp(-t / tau) + beta, color=theme.series[0])
219
+ figkit.error_bars(ax, epochs, loss, error, theme)
220
+ ax.text(14.6, 1.1, r"$L(t) = \alpha\,e^{-t/\tau} + \beta$", ha="right", va="center")
221
+ subtitle = rf"Mean of five seeds, fit $\alpha = {alpha}$, $\tau = {tau}$, $\beta = {beta}$"
222
+ figkit.title(ax, "Training loss", theme, subtitle=subtitle)
223
+ ```
224
+
225
+ Variables and Greek letters are set in the italic of `font.math`; `render` stops before writing
226
+ if a formula needs a glyph that no font has.
227
+
228
+ </details>
229
+
209
230
  <details>
210
231
  <summary><b>Social card</b> for Open Graph, 1200 x 630</summary>
211
232
 
@@ -323,6 +344,7 @@ and `status`.
323
344
  | --- | --- |
324
345
  | `default` | Theme whose files carry no suffix; every other theme writes `-<name>`. |
325
346
  | `pair` | Theme a page swaps with, such as light and dark. `figkit check` requires the file of the pair; a theme without one stands alone. |
347
+ | `font.math` | Fonts of formulas between dollar signs: `italic`, a family with an italic face for variables and Greek letters, by default DejaVu Sans, and `fallback`, the matplotlib font for other missing characters, `cm`, `stix` or `stixsans` (default). |
326
348
  | `font.files` | Glob patterns of font files, relative to the tokens file; without them the bundled fonts apply. matplotlib keeps one file per family in a process, so own font files need family names of their own. |
327
349
  | `css` | Maps custom properties of the website, `--color-text: light-dark(#111111, #eeeeee)`, to tokens such as `["ink"]` or `["pages", 0]`. `figkit check --css` compares the first colour with the default theme and the second with its pair. |
328
350
 
@@ -397,7 +419,7 @@ $ uv run figkit check --css ../Portfolio/src/styles/tokens.css
397
419
  | Languages | `Caption`, `language`, `localize`, `number` |
398
420
  | Style | `Theme`, `Typography`, `Style`, `StyleError`, `load_style`, `parse_style`, `DEFAULT`, `LIGHT`, `DARK`, `THEMES`, `TYPE`, `tokens`, `rc`, `register_fonts` |
399
421
  | Project | `Project`, `project`, `project_style` |
400
- | Checks | `check_text` and the `figkit check` command |
422
+ | Checks | `check_text`, `complete_glyphs` and the `figkit check` command |
401
423
 
402
424
  Importing figkit leaves the matplotlib backend alone; a batch job that only writes files can set
403
425
  `MPLBACKEND=Agg`.
@@ -162,7 +162,7 @@ for (i, j), count in np.ndenumerate(counts):
162
162
 
163
163
  <picture>
164
164
  <source media="(prefers-color-scheme: dark)" srcset="docs/examples/multiples-dark.svg">
165
- <img src="docs/examples/multiples.svg" alt="Three panels of learning curves, macro F1 against training images, each line with a shaded band; the middle one points out its plateau.">
165
+ <img src="docs/examples/multiples.svg" alt="Three panels of learning curves, macro F₁ against training images, each line with a shaded band; the middle one points out its plateau.">
166
166
  </picture>
167
167
 
168
168
  ```python
@@ -178,6 +178,27 @@ for points instead of lines.
178
178
 
179
179
  </details>
180
180
 
181
+ <details>
182
+ <summary><b>Formulas</b> with italic variables and Greek letters</summary>
183
+
184
+ <picture>
185
+ <source media="(prefers-color-scheme: dark)" srcset="docs/examples/formula-dark.svg">
186
+ <img src="docs/examples/formula.svg" alt="Training loss per epoch with error bars and a fitted exponential decay, labelled L(t) = α e^(−t/τ) + β, with the fitted α, τ and β in the subtitle.">
187
+ </picture>
188
+
189
+ ```python
190
+ ax.plot(t, alpha * np.exp(-t / tau) + beta, color=theme.series[0])
191
+ figkit.error_bars(ax, epochs, loss, error, theme)
192
+ ax.text(14.6, 1.1, r"$L(t) = \alpha\,e^{-t/\tau} + \beta$", ha="right", va="center")
193
+ subtitle = rf"Mean of five seeds, fit $\alpha = {alpha}$, $\tau = {tau}$, $\beta = {beta}$"
194
+ figkit.title(ax, "Training loss", theme, subtitle=subtitle)
195
+ ```
196
+
197
+ Variables and Greek letters are set in the italic of `font.math`; `render` stops before writing
198
+ if a formula needs a glyph that no font has.
199
+
200
+ </details>
201
+
181
202
  <details>
182
203
  <summary><b>Social card</b> for Open Graph, 1200 x 630</summary>
183
204
 
@@ -295,6 +316,7 @@ and `status`.
295
316
  | --- | --- |
296
317
  | `default` | Theme whose files carry no suffix; every other theme writes `-<name>`. |
297
318
  | `pair` | Theme a page swaps with, such as light and dark. `figkit check` requires the file of the pair; a theme without one stands alone. |
319
+ | `font.math` | Fonts of formulas between dollar signs: `italic`, a family with an italic face for variables and Greek letters, by default DejaVu Sans, and `fallback`, the matplotlib font for other missing characters, `cm`, `stix` or `stixsans` (default). |
298
320
  | `font.files` | Glob patterns of font files, relative to the tokens file; without them the bundled fonts apply. matplotlib keeps one file per family in a process, so own font files need family names of their own. |
299
321
  | `css` | Maps custom properties of the website, `--color-text: light-dark(#111111, #eeeeee)`, to tokens such as `["ink"]` or `["pages", 0]`. `figkit check --css` compares the first colour with the default theme and the second with its pair. |
300
322
 
@@ -369,7 +391,7 @@ $ uv run figkit check --css ../Portfolio/src/styles/tokens.css
369
391
  | Languages | `Caption`, `language`, `localize`, `number` |
370
392
  | Style | `Theme`, `Typography`, `Style`, `StyleError`, `load_style`, `parse_style`, `DEFAULT`, `LIGHT`, `DARK`, `THEMES`, `TYPE`, `tokens`, `rc`, `register_fonts` |
371
393
  | Project | `Project`, `project`, `project_style` |
372
- | Checks | `check_text` and the `figkit check` command |
394
+ | Checks | `check_text`, `complete_glyphs` and the `figkit check` command |
373
395
 
374
396
  Importing figkit leaves the matplotlib backend alone; a batch job that only writes files can set
375
397
  `MPLBACKEND=Agg`.