Skip to content

Commit 1157f21

Browse files
committed
Fix test for preservation of catalog style keywords
1 parent dc95628 commit 1157f21

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/astro_image_display_api/dummy_viewer.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,20 +181,17 @@ def set_catalog_style(
181181
**kwargs
182182
Additional keyword arguments to pass to the marker style.
183183
"""
184-
shape = shape
185-
color = color
186-
size = size
187-
188184
catalog_label = self._resolve_catalog_label(catalog_label)
189185

190186
if self._catalogs[catalog_label].data is None:
191187
raise ValueError("Must load a catalog before setting a catalog style.")
192188

193-
self._catalogs[catalog_label].style = {
194-
"shape": shape,
195-
"color": color,
196-
"size": size,
197-
}
189+
self._catalogs[catalog_label].style = dict(
190+
shape=shape,
191+
color=color,
192+
size=size,
193+
**kwargs
194+
)
198195

199196
# Methods for loading data
200197
def load_fits(self, file: str | os.PathLike) -> None:

src/astro_image_display_api/widget_api_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ def test_get_catalog_style_with_multiple_labels_raises_error(self, catalog):
190190
with pytest.raises(ValueError, match='Multiple catalog styles'):
191191
self.image.get_catalog_style()
192192

193-
def set_get_caralog_style_preserves_extra_keywords(self, catalog):
193+
def test_set_get_catalog_style_preserves_extra_keywords(self, catalog):
194194
# Check that setting a catalog style with extra keywords preserves
195195
# those keywords.
196196
self.image.load_catalog(catalog)
197197
# The only required keywords are color, shape, and size.
198198
# Add some extra keyword to the style.
199199
style = dict(color='blue', shape='x', size=10, extra_kw='extra_value', alpha=0.5)
200-
self.image.set_catalog_style(**style)
200+
self.image.set_catalog_style(**style.copy())
201201

202202
retrieved_style = self.image.get_catalog_style()
203203
del retrieved_style['catalog_label'] # Remove the label

0 commit comments

Comments
 (0)