xopr.xarray_accessor.xopr_accessor

 1import xarray as xr
 2
 3from xopr.opr_tools import generate_citation
 4from xopr.xarray_accessor.formatting_html import dataset_repr
 5
 6
 7@xr.register_dataset_accessor("xopr")
 8class XoprAccessor:
 9    def __init__(self, xarray_obj):
10        self._obj = xarray_obj
11
12    def _repr_html_(self):
13        return dataset_repr(self._obj)
14
15    @property
16    def citation(self) -> str:
17        """
18        Generate a citation string for the dataset based on its attributes.
19        """
20
21        return generate_citation(self._obj)
@xr.register_dataset_accessor('xopr')
class XoprAccessor:
 8@xr.register_dataset_accessor("xopr")
 9class XoprAccessor:
10    def __init__(self, xarray_obj):
11        self._obj = xarray_obj
12
13    def _repr_html_(self):
14        return dataset_repr(self._obj)
15
16    @property
17    def citation(self) -> str:
18        """
19        Generate a citation string for the dataset based on its attributes.
20        """
21
22        return generate_citation(self._obj)
XoprAccessor(xarray_obj)
10    def __init__(self, xarray_obj):
11        self._obj = xarray_obj
citation: str
16    @property
17    def citation(self) -> str:
18        """
19        Generate a citation string for the dataset based on its attributes.
20        """
21
22        return generate_citation(self._obj)

Generate a citation string for the dataset based on its attributes.