Skip to content

Conversation

@mwcraig
Copy link
Member

@mwcraig mwcraig commented Jul 8, 2025

There are a couple of get methods, get_image_labels and get_catalog_names, that make sense as properties because they take no paramaters. In both cases the methods are changed to properties, and only user-provided labels and names are returned, i.e. None is never returned as a name or label.

@mwcraig mwcraig requested a review from Copilot July 8, 2025 17:27
@mwcraig mwcraig force-pushed the change-gets-to-properties branch from 7b4e285 to 5f31213 Compare July 8, 2025 17:37

This comment was marked as outdated.

@mwcraig mwcraig requested a review from Copilot July 8, 2025 17:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces parameterless getter methods with properties to more idiomatically expose image labels and catalog names, ensures None values are never returned, and updates related implementations and tests.

  • Converted abstract methods get_image_labels and get_catalog_names into @property-based image_labels and catalog_names returning tuples
  • Updated ImageViewerLogic to filter out None and copy docstrings from the interface
  • Refactored test suite to call the new properties and adjust assertions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/astro_image_display_api/interface_definition.py Replaced get_image_labels/get_catalog_names methods with @property signatures and tuple return types
src/astro_image_display_api/image_viewer_logic.py Added image_labels and catalog_names properties filtering out None keys and assigned interface docstrings
src/astro_image_display_api/api_test.py Updated tests to reference the new properties and modified assertions accordingly
Comments suppressed due to low confidence (1)

src/astro_image_display_api/api_test.py:80

  • [nitpick] The helper name _get_catalog_names_as_set still uses a “get_” prefix even though catalog_names is now a property; consider renaming it to _catalog_names_as_set for consistency.
    def _get_catalog_names_as_set(self):

@mwcraig mwcraig merged commit 79e13c1 into astropy:main Jul 8, 2025
7 checks passed
@mwcraig mwcraig deleted the change-gets-to-properties branch July 8, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant