Skip to content

Conversation

@izkgao
Copy link

@izkgao izkgao commented May 5, 2025

This PR implements the colorblending module that adds support for creating and manipulating color blended images in CARTA.

Required before this can be moved out of draft:

  • Add code examples in documentation
  • Add basic tests

@izkgao izkgao requested a review from Copilot May 5, 2025 04:23
Copy link

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 introduces a new ColorBlending module to support multi-image blending in CARTA. Key changes include updates to image activation logic with a try/except branch for CARTA version handling and the addition of a new ColormapSet enum in constants.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
carta/image.py Reorders imports and updates the make_active method to handle version differences.
carta/constants.py Adds the ColormapSet enum to support color blending functionality.
Files not reviewed (1)
  • docs/source/quickstart.rst: Language not supported

try:
# Before CARTA 5.0.0
self.session.call_action("setActiveFrameById", self.image_id)
except CartaActionFailed:
Copy link

Copilot AI May 5, 2025

Choose a reason for hiding this comment

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

Consider logging the exception in the except block (lines 258-260) to capture details when falling back from 'setActiveFrameById' to 'setActiveImageByFileId', which can help with debugging version-specific issues.

Suggested change
except CartaActionFailed:
except CartaActionFailed as e:
# Log the exception details for debugging
logging.error("Failed to set active frame by ID. Falling back to set active image by file ID.", exc_info=True)

Copilot uses AI. Check for mistakes.
@izkgao izkgao marked this pull request as ready for review September 10, 2025 08:19
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