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

datatree accessor to multiscale spatial image #81

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

giovp
Copy link
Contributor

@giovp giovp commented Oct 10, 2023

This is a quick try to use the xarray accessors as suggested in #80 , changes are minimal.
As suggested a MultiscaleSpatialImage can be identified with:

isinstance(i, DataTree) and hasattr(i, 'msi')

or

isinstance(i, DataTree) and isinstance(i.msi, MultiscaleSpatialImage)

wdyt @thewtex ?

p.s. tests pass locally...

Copy link
Contributor

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

@giovp awesome!!

I will work on fixing unrelated CI failures in another PR.

@@ -24,17 +27,16 @@ class MultiscaleSpatialImage(DataTree):
scale2
"""

def __init__(
def __init__(self, xarray_obj: DataTree):
self._obj = xarray_obj
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps something more specific than _obj, _dt, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to _dt

@thewtex
Copy link
Contributor

thewtex commented Oct 11, 2023

ci is green on main -- please rebase

@giovp giovp marked this pull request as ready for review October 14, 2023 15:31
@giovp giovp requested a review from thewtex October 14, 2023 15:32
Copy link
Contributor

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +30 to +31
assert isinstance(multiscale.msi, MultiscaleSpatialImage)
multiscale.msi.to_zarr(store, compute=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@thewtex thewtex merged commit 0f3d295 into spatial-image:main Oct 17, 2023
13 checks passed
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