Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c567329

Browse files
committed
Fix issue w/ invalid context settings (fixes #348)
1 parent f6cc8b9 commit c567329

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎WHATSNEW.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ Bug fixes
247247
`~proplot.colors.DiscreteColormap` incorrectly samples the color list (:issue:`299`).
248248
* Fix issue where `~proplot.axes.Axes.legend` ignores the user-input `fontsize`
249249
(:issue:`331`).
250+
* Fix issue where passing invalid rc setting to ``.format`` results in persistent
251+
invalid `rc` state requiring restarting the session/configurator (:issue:`348`).
250252
* Fix issue where ``proplotrc`` settings are ignored if a subsequent line contains
251253
an overlapping meta-setting (:issue:`333`).
252254
* Fix issue where setting :rcraw:`legend.facecolor` or :rcraw:`legend.edgecolor` to

‎proplot/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,11 @@ def __enter__(self):
790790
rc_new = context.rc_new # used for context-based _get_item_context
791791
rc_old = context.rc_old # used to re-apply settings without copying whole dict
792792
for key, value in kwargs.items():
793-
kw_proplot, kw_matplotlib = self._get_item_dicts(key, value)
793+
try: # TODO: consider moving setting validation to .context()
794+
kw_proplot, kw_matplotlib = self._get_setting_dicts(key, value)
795+
except ValueError as error:
796+
self.__exit__()
797+
raise error
794798
for rc_dict, kw_new in zip(
795799
(rc_proplot, rc_matplotlib),
796800
(kw_proplot, kw_matplotlib),

0 commit comments

Comments
 (0)