Skip to content

Commit 90af0d4

Browse files
committed
Changes when figure_kwargs is defined for cleaner conditional logic
1 parent c207167 commit 90af0d4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

fastplotlib/widgets/image.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ def __init__(
357357
"""
358358
self._names = None
359359

360+
if figure_kwargs is None:
361+
figure_kwargs = dict()
362+
360363
# output context
361364
self._output = None
362365

@@ -368,9 +371,8 @@ def __init__(
368371
if all([_is_arraylike(d) for d in data]):
369372
# Grid computations
370373
if figure_shape is None:
371-
if figure_kwargs is not None:
372-
if "shape" in figure_kwargs:
373-
figure_shape = figure_kwargs["shape"]
374+
if "shape" in figure_kwargs:
375+
figure_shape = figure_kwargs["shape"]
374376
else:
375377
figure_shape = calculate_figure_shape(len(data))
376378

@@ -508,8 +510,6 @@ def __init__(
508510
)
509511

510512
figure_kwargs_default = {"controller_ids": "sync"}
511-
if figure_kwargs is None:
512-
figure_kwargs = dict()
513513

514514
# update the default kwargs with any user-specified kwargs
515515
# user specified kwargs will overwrite the defaults

0 commit comments

Comments
 (0)