Reframed from "consolidate plot styles" — per-repo (and per-paper) plot styles are fine. The actual problem is an import-time side effect.
shear_psf_leakage/plot_style.py sets mpl.rcParams[...] at module top level, and leakage.py does from .plot_style import *. So importing shear_psf_leakage.leakage / run_scale / run_object silently mutates global matplotlib rcParams. sp_validation's cosmo_val imports exactly these:
cosmo_val/core.py → from shear_psf_leakage import run_object, run_scale
cosmo_val/psf_systematics.py → from shear_psf_leakage import leakage
…so sp_validation inherits shear_psf_leakage's plot style just by importing it — annoying in practice. (sp_validation/src/sp_validation/plots.py does the same import-time mutation within its own package.)
Fix (not style unification): move the rcParams-setting out of module top level into an explicit set_plot_style() that callers invoke when they want it. Importing a library should never change global matplotlib state; each repo/paper keeps whatever style it likes and applies it on purpose.
— Claude on behalf of Cail
Reframed from "consolidate plot styles" — per-repo (and per-paper) plot styles are fine. The actual problem is an import-time side effect.
shear_psf_leakage/plot_style.pysetsmpl.rcParams[...]at module top level, andleakage.pydoesfrom .plot_style import *. So importingshear_psf_leakage.leakage/run_scale/run_objectsilently mutates global matplotlib rcParams. sp_validation'scosmo_valimports exactly these:cosmo_val/core.py→from shear_psf_leakage import run_object, run_scalecosmo_val/psf_systematics.py→from shear_psf_leakage import leakage…so sp_validation inherits shear_psf_leakage's plot style just by importing it — annoying in practice. (
sp_validation/src/sp_validation/plots.pydoes the same import-time mutation within its own package.)Fix (not style unification): move the rcParams-setting out of module top level into an explicit
set_plot_style()that callers invoke when they want it. Importing a library should never change global matplotlib state; each repo/paper keeps whatever style it likes and applies it on purpose.— Claude on behalf of Cail