Skip to main content

figure-gate

CI PyPI conda-forge Docs

Two scripts that read a built matplotlib figure and report which gates it fails. audit(fig) returns (ok, rows), 20 rows, one per gate, each a (label, status, detail) triple where status is True, False, or "warn". check(colors) gates a palette the same way in 5 rows and returns the same shape. Every threshold is a module-level constant you can read and change.

There is also an Agent Skill wrapper that applies the same checks when Claude Code builds a figure.

git clone https://github.com/narenp12/figure-gate && cd figure-gate
python skill/scripts/check_palette.py "#E69F00,#56B4E9,#009E73" --pairs all
python skill/scripts/check_figure.py     # self-test on a broken figure

Validation loss against training epoch for three optimisers over 12 epochs. All three fall; the Bayesian run reaches 0.05 by epoch 6, while the baseline is still at 0.25 at epoch 12.

python examples/demo.py builds that figure and audits it, and python examples/gallery.py covers the harder forms. Writing those seven found six defects in the checks themselves.

Documentation

Everything below the quickstart lives on the docs site:

  • Getting started: install or vendor, the two settings that need your document's values, and the code to call.
  • The gates: what each row measures, its threshold, and what a passing run does not mean.
  • The style guide: the measurement behind each threshold, and the rules tried and reverted.
  • Choosing a form: the decision no styling rule rescues.
  • API reference: signatures and defaults, generated from the scripts when the site builds.
uv add figure-gate          # or: conda install -c conda-forge figure-gate

Where this sits

Prescriptive style sheets already exist and are good: SciencePlots and LovelyPlots for journal looks, tueplots and mpl_sizes for exact conference sizing. Accessibility tooling exists too: matplotalt generates alt text, Chart4Blind converts a chart image into an accessible one, contrast reporters check colors in isolation.

Each of those acts before or beside the figure. None of them reads the built result and reports what it fails, which is the only thing here, so a style sheet and this are complementary: set defaults with one, verify them with the other.

Contributing

New gates are welcome at the bar the project holds itself to: a test proving the gate fails on a figure with that defect, a test proving it does not over-fire on the nearest legitimate case, and a note naming the real failure that motivated it. See CONTRIBUTING.md and SECURITY.md.

License

MIT, see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figure_gate-0.6.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

figure_gate-0.6.0-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file figure_gate-0.6.0.tar.gz.

File metadata

  • Download URL: figure_gate-0.6.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for figure_gate-0.6.0.tar.gz
Algorithm Hash digest
SHA256 dd404271c004dc73c31120ad4cffb0e8a19af98acf807ccb5605453aee71c663
MD5 b22c04ea3494d5f905b213f94deccf25
BLAKE2b-256 405f6ad8f827e493bb0d2fa9bbb9237bda4f6902901a728171f11fff217302cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for figure_gate-0.6.0.tar.gz:

Publisher: release.yml on narenp12/figure-gate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file figure_gate-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: figure_gate-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for figure_gate-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fe75ddcb6103aeecb7388d07fe1c719a422da9925baf8f12a1ade0f908ef06a
MD5 afc855cfbafe4bf687dd24b342acbc4c
BLAKE2b-256 7f564c59fc885d24a185dfd51b95b0a0fb3f05afb9aaf4038508c929f9a69a4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for figure_gate-0.6.0-py3-none-any.whl:

Publisher: release.yml on narenp12/figure-gate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.8.0

2 files

0.7.0

2 files

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page