Context
Agent.py:942-943 mutates matplotlib's and seaborn's global
rcParams from inside create_visualizations. That means every
other matplotlib consumer in the same Python process inherits
the "default + husl" look — and re-instantiating the agent
silently reverts the user's style. The fix is to scope the
mutation to the chart-rendering block.
What to change
In Agent.py:create_visualizations, wrap the _save calls (or
the per-chart plt.subplots / plt.figure blocks) with
plt.style.context(...). The two-line setup at lines 942-943
becomes a single with plt.style.context('default'): sns.set_palette("husl")
block scoped to the rendering loop, or you can drop the
set_palette entirely if the default husl is acceptable.
How to verify
- Import matplotlib in a separate script, change the user's
rcParams to a custom style, then call
agent.create_visualizations(df, "f.csv"). After the call,
the custom rcParams must still be in effect.
python -m unittest discover -s tests -v is green; specifically
the CreateVisualizationsGuardTests continue to produce the
expected chart types.
Skill: matplotlib, scoping.
Estimated effort: S.
Context
Agent.py:942-943mutates matplotlib's and seaborn's globalrcParams from inside
create_visualizations. That means everyother matplotlib consumer in the same Python process inherits
the "default + husl" look — and re-instantiating the agent
silently reverts the user's style. The fix is to scope the
mutation to the chart-rendering block.
What to change
In
Agent.py:create_visualizations, wrap the_savecalls (orthe per-chart
plt.subplots/plt.figureblocks) withplt.style.context(...). The two-line setup at lines 942-943becomes a single
with plt.style.context('default'): sns.set_palette("husl")block scoped to the rendering loop, or you can drop the
set_paletteentirely if the default husl is acceptable.How to verify
rcParams to a custom style, then call
agent.create_visualizations(df, "f.csv"). After the call,the custom rcParams must still be in effect.
python -m unittest discover -s tests -vis green; specificallythe
CreateVisualizationsGuardTestscontinue to produce theexpected chart types.
Skill: matplotlib, scoping.
Estimated effort: S.