Skip to content

Commit 582c837

Browse files
committed
add accessor
1 parent bc3c098 commit 582c837

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/spatialdata_plot/_accessor.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import spatialdata as sd
2+
from xarray.core.extensions import _register_accessor
3+
4+
5+
def register_spatial_data_accessor(name: str) -> sd.SpatialData:
6+
"""Hijacks xarray _register_accessor to register a SpatialData accessor.
7+
8+
Parameters
9+
----------
10+
name : str
11+
Name under which the accessor should be registered. A warning is issued
12+
if this name conflicts with a preexisting attribute.
13+
14+
See Also
15+
--------
16+
register_dataset_accessor
17+
"""
18+
return _register_accessor(name, sd.SpatialData)

0 commit comments

Comments
 (0)