Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 4.45 KB

File metadata and controls

61 lines (40 loc) · 4.45 KB

Changelog

All notable changes to the ssci-plots Skill are documented here.

The format is based on Keep a Changelog.

v2.0.1 (Phase 7 polish, 2026-05-17)

Skill enhancements (backward compatible)

  • _italicize_key now emits a UserWarning when an unrecognized key looks like a statistical symbol (contains digit, caret, underscore, or non-ASCII char) before falling through to plain text. Plain English words pass silent.
  • add_panel_labels default fontsize fallback changed from 14 pt → 12 pt to align with D-R2-2 and majority APA-journal convention. Explicit fontsize=14 and preset overrides (psych_science 18 pt, nature 9 pt) preserved unchanged.

Documentation

  • SKILL.md §6 Quality Checklist + §7 Troubleshooting now warn against fig.text(..., "*Note.* ...") embedding (APA §7.28 / SSCI-Plots §9 violation; use format_apa_figure_text(note_text=...) instead).

Example fixes

  • 18 figure gallery unified to tol_muted palette + alpha SSOT + uppercase panel labels + APA §9-compliant Note handling. See A7R1-A7R9 reports in phase_7_polish/.

[Wave 1] – 2026-05

Breaking / Behavioral Changes

These changes alter user-visible output for the listed helpers. They are documented as bug fixes, not breaking API changes — signatures remain unchanged — but downstream code that pattern-matches the affected output strings (regex on "ns", parsing rendered Markdown) will need adjustment.

  • p_to_stars(p) — non-significant return value changed from "ns" to "n.s." (with periods). This unifies the output with add_significance_bracket, which already emitted "n.s.". The dotted form is the conventional APA 7 style. Code that compared the return string to "ns" literal must be updated to "n.s.".

  • format_apa_figure_text(...) — probability-level lines (e.g. *p < .05. **p < .01. ***p < .001.) now insert a zero-width space (U+200B) between consecutive asterisks. The change fixes Markdown rendering where ** was previously interpreted as bold emphasis, producing visually garbled output (bold p < .05.bold p < .01.). The zero-width space is invisible in rendered text. Disable via zwsp=False if a downstream pipeline strips zero-width characters; the rendered output is otherwise identical.

  • add_panel_labels(axes, style=None, fontsize=None, ...) — default values for style and fontsize changed from 'upper' / 14 to None. When the value is None, the helper reads the active journal preset's _ACTIVE_PRESET['panel_label_case'] and panel_label_size and falls back to the previous defaults only when no preset is active. The change implements the Phase 4 D10 bug 2 fix: apply_style(journal='nature') now produces lowercase a/b/c panel labels at 9 pt automatically, instead of always emitting uppercase A/B/C at 14 pt. To restore the old behavior on a single call, pass style='upper' and fontsize=14 explicitly.

Advisory Warnings (new)

  • get_palette(n, 'tol_light') with n >= 4 now emits a UserWarning advising that tol_light is fill-only with low luminance contrast and not recommended for line / marker plots. Prefer tol_bright or tol_muted for line / scatter figures; reserve tol_light for stacked bars, choropleth fills, or table backgrounds.

  • get_palette(n, palette_name) with n >= 5 for any baseline_risky CVD-grade palette (nature_npg, science_aaas, nejm, lancet, jama, bmj, economics, uk_gov_af, economist_chart) now emits a UserWarning advising the user to pair with redundant marker shapes / hatching / line styles so the figure remains interpretable under all three CVD types and in grayscale.

To silence either warning in a specific code path:

import warnings
with warnings.catch_warnings():
    warnings.simplefilter('ignore', UserWarning)
    colors = get_palette(5, 'nature_npg')

Documentation Notes

  • The bbc_bbplot palette description in references/color-system.md §2.8.8 now warns that teal and green tones may converge under tritanopia; pair with markers for 4+ colors.

  • The add_panel_labels description in SKILL.md now correctly states that Science uses uppercase A/B/C (the prior text incorrectly attributed parentheses to Science).

  • The public-helper count is 27 (was incorrectly documented as 24 in several places). The correct breakdown: 2 entry + 7 palette + 3 save / spine / legend + 3 APA + 2 sig / effect + 2 inline / ref + 1 panel labels + 7 multipanel.