widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.6k stars 104 forks source link

Bug in patching of rcParams #606

Open astrofrog opened 2 weeks ago

astrofrog commented 2 weeks ago

I'm running into the following failure over in glue-jupyter:

/usr/lib/python3.11/contextlib.py:137: in __enter__
    return next(self.gen)
../../.tox/py311-test-visual/lib/python3.11/site-packages/pytest_mpl/plugin.py:318: in switch_backend
    prev_backend = matplotlib.get_backend().lower()
../../.tox/py311-test-visual/lib/python3.11/site-packages/matplotlib/__init__.py:1275: in get_backend
    return rcParams['backend']
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RcParamsScoped({'_internal.classic_mode': True,
                'agg.path.chunksize': 0,
                'animation.bi...          'ytick.minor.visible': False,
                'ytick.minor.width': 0.5,
                'ytick.right': True})
key = 'backend'

    def __getitem__(self, key):
>       return self._get_context_dict().__getitem__(key)
E       KeyError: 'backend'

basically it seems the backend key is missing from the patched rcParams.

maartenbreddels commented 1 week ago

Hi Tom,

I have trouble reproducing this. Do you have more details for me?

cheers,

Maarten