Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90af0d4

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

File tree

1 file changed

+5
-5
lines changed
Filter options

1 file changed

+5
-5
lines changed

‎fastplotlib/widgets/image.py

Copy file name to clipboardExpand all lines: fastplotlib/widgets/image.py
+5-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.