Skip to content

Commit 58caaaa

Browse files
committed
suggested init params handling from Patrick
1 parent e92f323 commit 58caaaa

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/ipyaladin/widget.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,12 @@ def __init__(self, *args: any, **init_options: any) -> None:
221221
# https://github.com/jupyter-widgets/ipywidgets/blob/main/python/ipywidgets/ipywidgets/widgets/domwidget.py
222222
for key in ["layout", "tabbable", "tooltip"]:
223223
init_options.pop(key, None)
224-
if "north_pole_orientation" not in init_options:
225-
init_options["north_pole_orientation"] = init_options.get("rotation", 0)
226-
else:
227-
init_options["rotation"] = init_options["north_pole_orientation"]
224+
init_options["north_pole_orientation"] = init_options.get(
225+
"north_pole_orientation", init_options.get("rotation", 0)
226+
)
228227
# some init options are properties here
229228
self.height = init_options.get("height", self._height)
230-
self.rotation = init_options.get("rotation", self._rotation)
229+
self.rotation = init_options.get("north_pole_orientation", self._rotation)
231230
self.target = init_options.get("target", self._target)
232231
self.fov = init_options.get("fov", self._fov)
233232
# apply different default options from Aladin-Lite

0 commit comments

Comments
 (0)