ImageAPITest#

class astro_image_display_api.api_test.ImageAPITest[source]#

Bases: object

Methods Summary

catalog(wcs)

A catalog fixture that returns an empty table with the expected columns.

data()

setup()

Subclasses MUST define image_widget_class -- doing so as a class variable does the trick.

test_adding_catalog_as_world(data, wcs)

test_all_methods_accept_additional_kwargs(...)

Make sure all methods accept additional keyword arguments that are not defined in the protocol.

test_catalog_conversion_uses_single_image_wcs(data)

test_catalog_has_style_after_loading(catalog)

test_catalog_info_preserved_after_load(catalog)

test_cuts(data)

test_empty_viewer_image_operations_raise()

test_every_method_attribute_has_docstring()

Check that every method and attribute in the protocol has a docstring.

test_fov_anisotropic_pixel_scale(shape)

test_fov_initialization_from_image(data, ...)

test_fov_sky_to_pixel_honors_quantity_unit(data)

test_fov_wcs_with_arcsec_cunit(data)

test_get_catalog_empty_on_fresh_viewer()

test_get_catalog_renames_columns(catalog)

test_get_catalog_returns_copy(catalog)

test_get_catalog_style_with_multiple_labels_raises_error(catalog)

test_get_image(data)

test_get_viewport_default_uses_requested_image_wcs(...)

test_get_viewport_no_sky_or_pixel(data, wcs, ...)

test_get_viewport_sky_or_pixel(data, wcs)

test_get_viewport_with_wcs_set_pixel_or_world(...)

test_get_viewport_with_wcs_set_return_world(...)

test_image_labels(data)

test_initial_center_is_image_center(data, ...)

test_load(data, tmp_path, load_type)

test_load_catalog_does_not_modify_input_catalog(catalog)

test_load_catalog_multiple_same_label(catalog)

test_load_catalog_pixel_only_with_multiple_images(data)

test_load_catalog_with_no_style_has_a_style(catalog)

test_load_catalog_with_skycoord_no_wcs(...)

test_load_catalog_with_style_sets_style(catalog)

test_load_catalog_with_use_skycoord_no_skycoord_no_wcs(...)

test_load_catalog_with_xy_and_wcs(catalog, ...)

test_load_get_catalog_custom_column_names(catalog)

test_load_get_single_catalog_with_without_label(...)

test_load_multiple_catalogs(catalog)

test_parameter_names_match_interface()

Check that every method has the parameter names, in the order, that the interface defines.

test_remove_all_catalogs_restores_fresh_state(catalog)

test_remove_catalog()

test_remove_catalog_does_not_accept_list()

test_remove_catalogs_name_all()

test_save(tmp_path)

test_save_overwrite(tmp_path)

test_set_catalog_style_before_catalog_data_raises_error()

test_set_colormap_errors(data)

test_set_cuts_stretch_preserves_viewport(...)

test_set_get_catalog_style_no_labels(catalog)

test_set_get_catalog_style_preserves_extra_keywords(catalog)

test_set_get_catalog_style_with_single_label(catalog)

test_set_get_center_world(data, wcs)

test_set_get_center_xy(data)

test_set_get_colormap(data)

test_set_get_fov_pixel(data)

test_set_get_fov_world(data, wcs)

test_set_get_viewport_errors(data, wcs)

test_set_get_viewport_errors_because_no_wcs(data)

test_set_get_viewport_no_image_label(data)

test_set_get_viewport_single_label(data)

test_stretch(data)

test_stretch_cuts_are_set_after_loading_image(data)

test_stretch_cuts_errors(data)

test_stretch_cuts_labels(data)

test_unknown_catalog_label_raises_and_does_not_pollute(catalog)

test_unlabeled_catalog_loads_share_one_default_label(catalog)

test_unlabeled_image_loads_share_one_default_label(data)

test_viewport_is_defined_after_loading_image(...)

test_viewport_round_trips(data, wcs)

wcs()

Methods Documentation

catalog(wcs: WCS) Table[source]#

A catalog fixture that returns an empty table with the expected columns.

data()[source]#
setup()[source]#

Subclasses MUST define image_widget_class – doing so as a class variable does the trick.

test_adding_catalog_as_world(data, wcs)[source]#
test_all_methods_accept_additional_kwargs(data, catalog, tmp_path)[source]#

Make sure all methods accept additional keyword arguments that are not defined in the protocol.

test_catalog_conversion_uses_single_image_wcs(data)[source]#
test_catalog_has_style_after_loading(catalog)[source]#
test_catalog_info_preserved_after_load(catalog)[source]#
test_cuts(data)[source]#
test_empty_viewer_image_operations_raise()[source]#
test_every_method_attribute_has_docstring()[source]#

Check that every method and attribute in the protocol has a docstring.

test_fov_anisotropic_pixel_scale(shape)[source]#
test_fov_initialization_from_image(data, wcs, world)[source]#
test_fov_sky_to_pixel_honors_quantity_unit(data)[source]#
test_fov_wcs_with_arcsec_cunit(data)[source]#
test_get_catalog_empty_on_fresh_viewer()[source]#
test_get_catalog_renames_columns(catalog)[source]#
test_get_catalog_returns_copy(catalog)[source]#
test_get_catalog_style_with_multiple_labels_raises_error(catalog)[source]#
test_get_image(data)[source]#
test_get_viewport_default_uses_requested_image_wcs(data, wcs, load_order)[source]#
test_get_viewport_no_sky_or_pixel(data, wcs, sky_or_pixel)[source]#
test_get_viewport_sky_or_pixel(data, wcs)[source]#
test_get_viewport_with_wcs_set_pixel_or_world(data, wcs)[source]#
test_get_viewport_with_wcs_set_return_world(data, wcs)[source]#
test_image_labels(data)[source]#
test_initial_center_is_image_center(data, wcs, world)[source]#
test_load(data, tmp_path, load_type)[source]#
test_load_catalog_does_not_modify_input_catalog(catalog)[source]#
test_load_catalog_multiple_same_label(catalog)[source]#
test_load_catalog_pixel_only_with_multiple_images(data)[source]#
test_load_catalog_with_no_style_has_a_style(catalog)[source]#
test_load_catalog_with_skycoord_no_wcs(catalog, data)[source]#
test_load_catalog_with_style_sets_style(catalog)[source]#
test_load_catalog_with_use_skycoord_no_skycoord_no_wcs(catalog, data)[source]#
test_load_catalog_with_xy_and_wcs(catalog, data, wcs)[source]#
test_load_get_catalog_custom_column_names(catalog)[source]#
test_load_get_single_catalog_with_without_label(catalog, catalog_label)[source]#
test_load_multiple_catalogs(catalog)[source]#
test_parameter_names_match_interface()[source]#

Check that every method has the parameter names, in the order, that the interface defines.

The parameter names are part of the documented API – users call these methods by keyword – and because every method also accepts **kwargs, a wrongly named implementation parameter does not raise a TypeError but silently swallows the keyword argument. That makes signature inspection, not calling, the only reliable check.

test_remove_all_catalogs_restores_fresh_state(catalog)[source]#
test_remove_catalog()[source]#
test_remove_catalog_does_not_accept_list()[source]#
test_remove_catalogs_name_all()[source]#
test_save(tmp_path)[source]#
test_save_overwrite(tmp_path)[source]#
test_set_catalog_style_before_catalog_data_raises_error()[source]#
test_set_colormap_errors(data)[source]#
test_set_cuts_stretch_preserves_viewport(data, set_method, value)[source]#
test_set_get_catalog_style_no_labels(catalog)[source]#
test_set_get_catalog_style_preserves_extra_keywords(catalog)[source]#
test_set_get_catalog_style_with_single_label(catalog)[source]#
test_set_get_center_world(data, wcs)[source]#
test_set_get_center_xy(data)[source]#
test_set_get_colormap(data)[source]#
test_set_get_fov_pixel(data)[source]#
test_set_get_fov_world(data, wcs)[source]#
test_set_get_viewport_errors(data, wcs)[source]#
test_set_get_viewport_errors_because_no_wcs(data)[source]#
test_set_get_viewport_no_image_label(data)[source]#
test_set_get_viewport_single_label(data)[source]#
test_stretch(data)[source]#
test_stretch_cuts_are_set_after_loading_image(data)[source]#
test_stretch_cuts_errors(data)[source]#
test_stretch_cuts_labels(data)[source]#
test_unknown_catalog_label_raises_and_does_not_pollute(catalog)[source]#
test_unlabeled_catalog_loads_share_one_default_label(catalog)[source]#
test_unlabeled_image_loads_share_one_default_label(data)[source]#
test_viewport_is_defined_after_loading_image(tmp_path, data, wcs, world)[source]#
test_viewport_round_trips(data, wcs)[source]#
wcs()[source]#