Skip to content

Overlay settings store was renamed in the frontend.#163

Open
confluence wants to merge 2 commits intodevfrom
confluence/fix-overlay-rename
Open

Overlay settings store was renamed in the frontend.#163
confluence wants to merge 2 commits intodevfrom
confluence/fix-overlay-rename

Conversation

@confluence
Copy link
Copy Markdown
Collaborator

@Jordatious hit this bug while trying to set the centre (which requires the overlay number formats):

File "/Users/jcollier/work/scripts/python/create-carta-regions.py", line 187, in overlay_ellipses
    img.set_center(center[0],center[1])
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/validation.py", line 958, in newfunc
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/image.py", line 395, in set_center
    number_format_x, number_format_y = self.session.wcs.numbers.format
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/wcs_overlay.py", line 688, in format
    format_x = self.get_value("formatTypeX")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/util.py", line 191, in get_value
    return self.session.get_value(f"{self._base_path}.{path}", return_path=return_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/session.py", line 293, in get_value
    return self.call_action("fetchParameter", macro, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/session.py", line 267, in call_action
    return self._protocol.request_scripting_action(self.session_id, path, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcollier/opt/anaconda3/envs/carta-python/lib/python3.12/site-packages/carta/protocol.py", line 335, in request_scripting_action
    raise CartaActionFailed(f"{carta_action_description} failed: {response_data.get('message', 'No error message received.')}")
carta.util.CartaActionFailed: CARTA scripting action .fetchParameter called with parameters (Macro('overlayStore.numbers', 'formatTypeX'),) failed: TypeError: Cannot read properties of undefined (reading 'numbers')

This affects recent versions, but 5.0.0-beta.1 works. I found that this frontend commit renamed the overlayStore property to overlaySettings, which breaks the paths of all global WCS overlay actions. This PR updates the name.

@Jordatious does this fix your issue?

@confluence confluence requested review from Jordatious and izkgao April 15, 2026 08:58
@confluence confluence self-assigned this Apr 15, 2026
@Jordatious
Copy link
Copy Markdown

Indeed it does! Thanks so much! 💨

Comment thread carta/wcs_overlay.py Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

setViewDimension has been moved to appStore.setImageViewDimensions so should be changed to self.session.call_action("setImageViewDimensions", width, height). This requires changes in tests as well.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This function should maybe be moved to the session object in the wrapper as well, but that's outside the scope of this PR.

@confluence confluence requested a review from izkgao April 15, 2026 10:20
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.

3 participants