From 992702f317bb2bb414c58e09f96b25d0ed676128 Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Sat, 28 Jul 2018 04:04:30 -0700 Subject: [PATCH] misc --- ovgenpy/config.py | 2 ++ ovgenpy/renderer.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ovgenpy/config.py b/ovgenpy/config.py index 0fdae17..d418745 100644 --- a/ovgenpy/config.py +++ b/ovgenpy/config.py @@ -2,6 +2,7 @@ from io import StringIO from typing import ClassVar from ovgenpy.utils.keyword_dataclasses import dataclass, fields +# from dataclasses import dataclass, fields from ruamel.yaml import yaml_object, YAML @@ -92,6 +93,7 @@ class _ConfigMixin: value = getattr(self, key) typ = field.type + # FIXME crashes on generics, https://github.com/Stewori/pytypes ? if not isinstance(value, typ): name = type(self).__name__ raise OvgenError(f'{name}.{key} was supplied {repr(value)}, should be of type {typ.__name__}') diff --git a/ovgenpy/renderer.py b/ovgenpy/renderer.py index f15c127..ca14a36 100644 --- a/ovgenpy/renderer.py +++ b/ovgenpy/renderer.py @@ -94,7 +94,8 @@ class MatplotlibRenderer: # Create Axes # https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots.html if self.fig: - plt.close(self.fig) # FIXME + raise Exception("I don't currently expect to call set_layout() twice") + plt.close(self.fig) axes2d: np.ndarray['Axes'] self.fig, axes2d = plt.subplots(