@@ -79,8 +79,8 @@ def _assert_empty_catalog_table(self, table):
79
79
assert len (table ) == 0
80
80
assert sorted (table .colnames ) == sorted (["x" , "y" , "coord" ])
81
81
82
- def _get_catalog_names_as_set (self ):
83
- marks = self .image .catalog_names
82
+ def _get_catalog_labels_as_set (self ):
83
+ marks = self .image .catalog_labels
84
84
return set (marks )
85
85
86
86
@pytest .mark .parametrize ("load_type" , ["fits" , "nddata" , "array" ])
@@ -362,7 +362,7 @@ def test_set_catalog_style_before_catalog_data_raises_error(self):
362
362
with pytest .raises (
363
363
ValueError , match = "Must load a catalog before setting a catalog style"
364
364
):
365
- self .image .set_catalog_style (color = "red" , shape = "x " , size = 10 )
365
+ self .image .set_catalog_style (color = "red" , shape = "circle " , size = 10 )
366
366
367
367
def test_set_get_catalog_style_no_labels (self , catalog ):
368
368
# Check that getting without setting returns a dict that contains
@@ -376,7 +376,7 @@ def test_set_get_catalog_style_no_labels(self, catalog):
376
376
# Add some data before setting a style
377
377
self .image .load_catalog (catalog )
378
378
# Check that setting a marker style works
379
- marker_settings = dict (color = "red" , shape = "x " , size = 10 )
379
+ marker_settings = dict (color = "red" , shape = "crosshair " , size = 10 )
380
380
self .image .set_catalog_style (** marker_settings .copy ())
381
381
382
382
retrieved_style = self .image .get_catalog_style ()
@@ -421,7 +421,7 @@ def test_set_get_catalog_style_preserves_extra_keywords(self, catalog):
421
421
# The only required keywords are color, shape, and size.
422
422
# Add some extra keyword to the style.
423
423
style = dict (
424
- color = "blue" , shape = "x " , size = 10 , extra_kw = "extra_value" , alpha = 0.5
424
+ color = "blue" , shape = "circle " , size = 10 , extra_kw = "extra_value" , alpha = 0.5
425
425
)
426
426
self .image .set_catalog_style (** style .copy ())
427
427
@@ -489,7 +489,7 @@ def test_load_multiple_catalogs(self, catalog):
489
489
catalog_label = "test2" ,
490
490
)
491
491
492
- assert sorted (self .image .catalog_names ) == ["test1" , "test2" ]
492
+ assert sorted (self .image .catalog_labels ) == ["test1" , "test2" ]
493
493
494
494
# No guarantee markers will come back in the same order, so sort them.
495
495
t1 = self .image .get_catalog (catalog_label = "test1" )
@@ -513,7 +513,7 @@ def test_load_multiple_catalogs(self, catalog):
513
513
# other one without a label.
514
514
self .image .remove_catalog (catalog_label = "test1" )
515
515
# Make sure test1 is really gone.
516
- assert self .image .catalog_names == ("test2" ,)
516
+ assert self .image .catalog_labels == ("test2" ,)
517
517
518
518
# Get without a catalog
519
519
t2 = self .image .get_catalog ()
@@ -534,7 +534,7 @@ def test_load_catalog_multiple_same_label(self, catalog):
534
534
self .image .load_catalog (catalog , catalog_label = "test1" )
535
535
536
536
retrieved_catalog = self .image .get_catalog (catalog_label = "test1" )
537
- assert len (retrieved_catalog ) == 2 * len (catalog )
537
+ assert len (retrieved_catalog ) == len (catalog )
538
538
539
539
def test_load_catalog_with_skycoord_no_wcs (self , catalog , data ):
540
540
# Check that loading a catalog with skycoord but no x/y and
@@ -543,13 +543,10 @@ def test_load_catalog_with_skycoord_no_wcs(self, catalog, data):
543
543
544
544
# Remove x/y columns from the catalog
545
545
del catalog ["x" , "y" ]
546
- self .image .load_catalog (catalog )
547
- # Retrieve the catalog and check that the x and y columns are None
548
- retrieved_catalog = self .image .get_catalog ()
549
- assert "x" in retrieved_catalog .colnames
550
- assert "y" in retrieved_catalog .colnames
551
- assert all (rc is None for rc in retrieved_catalog ["x" ])
552
- assert all (rc is None for rc in retrieved_catalog ["y" ])
546
+ with pytest .raises (
547
+ ValueError , match = "Cannot use pixel coordinates without pixel columns"
548
+ ):
549
+ self .image .load_catalog (catalog )
553
550
554
551
def test_load_catalog_with_use_skycoord_no_skycoord_no_wcs (self , catalog , data ):
555
552
# Check that loading a catalog with use_skycoord=True but no
@@ -605,7 +602,7 @@ def test_load_catalog_with_no_style_has_a_style(self, catalog):
605
602
def test_load_catalog_with_style_sets_style (self , catalog ):
606
603
# Check that loading a catalog with a style sets the style
607
604
# for that catalog.
608
- style = dict (color = "blue" , shape = "x " , size = 10 )
605
+ style = dict (color = "blue" , shape = "square " , size = 10 )
609
606
self .image .load_catalog (
610
607
catalog , catalog_label = "test1" , catalog_style = style .copy ()
611
608
)
0 commit comments