From ec8a4d6c7e968fc85e439ba68f528c28c443ee0e Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Thu, 20 Oct 2022 15:37:10 +0200 Subject: [PATCH] Fix gridding selector --- plottr/node/grid.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plottr/node/grid.py b/plottr/node/grid.py index 8401103d..4d45d371 100644 --- a/plottr/node/grid.py +++ b/plottr/node/grid.py @@ -423,7 +423,7 @@ def grid(self) -> Tuple[GridOption, Dict[str, Any]]: @grid.setter @updateOption('grid') - def grid(self, val: Tuple[GridOption, Dict[str, Any]]) -> None: + def grid(self, val: Tuple[GridOption, Optional[Dict[str, Any]]]) -> None: """set the grid option. does some elementary type checking, but should probably be refined a bit.""" @@ -434,11 +434,13 @@ def grid(self, val: Tuple[GridOption, Dict[str, Any]]) -> None: if method not in GridOption: raise ValueError(f"Invalid grid method specification.") + if opts is None: + opts = {} if not isinstance(opts, dict): - raise ValueError(f"Invalid grid options specification.") + raise ValueError(f"Invalid grid options specification {opts}.") - self._grid = val + self._grid = method, opts # Processing