Skip to content

Commit

Permalink
Merge pull request #337 from jenshnielsen/fix_gridding_selector
Browse files Browse the repository at this point in the history
Fix gridding selector
  • Loading branch information
jenshnielsen committed Oct 20, 2022
2 parents fdd9c6d + ec8a4d6 commit 3d7b204
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plottr/node/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand All @@ -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

Expand Down

0 comments on commit 3d7b204

Please sign in to comment.