Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Add support for transforms in the Scene add_new_* methods #3206

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

jp-dark
Copy link
Collaborator

@jp-dark jp-dark commented Oct 18, 2024

Add support for setting the transform when a PointCloud or MultiscaleImage is first added to a Scene.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.86%. Comparing base (89377d0) to head (caa07d8).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3206      +/-   ##
==========================================
+ Coverage   83.58%   83.86%   +0.27%     
==========================================
  Files          51       51              
  Lines        5422     5460      +38     
==========================================
+ Hits         4532     4579      +47     
+ Misses        890      881       -9     
Flag Coverage Δ
python 83.86% <96.66%> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 83.86% <96.66%> (+0.27%) ⬆️
libtiledbsoma ∅ <ø> (∅)

**kwargs,
),
uri,
)

# Store the metadata for the transform.
if transform is not None:
coll.metadata[f"soma_scene_registry_{key}"] = transform_to_json(transform)
Copy link
Member

Choose a reason for hiding this comment

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

Not in this PR, but one thing I'd like to do in the future is make it so that the user can't modify these metadata values directly.

In the C++ API, we throw an error if there is an attempt to modify these reserved metadata keys. BUT there is a way to bypass this by passing the force flag. Internally, we could use coll._handle.add_metadata(f"soma_scene_registry_{key}", transform_to_json(transform), force=True). This way we can still modify the metadata values as needed but the user cannot.

@jp-dark jp-dark merged commit 4e6bd02 into main Oct 22, 2024
11 checks passed
@jp-dark jp-dark deleted the dark/scene-add-methods-transforms/sc-57490 branch October 22, 2024 18:04
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.

2 participants