Skip to content

Commit

Permalink
rename accessory to accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasprobst committed May 1, 2024
1 parent 6880a44 commit 02fccfb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion h5rdmtoolbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from .wrapper import jsonld
from .wrapper.lazy import lazy
from .wrapper.h5attr import Attribute
from .wrapper.accessory import register_special_dataset
from .wrapper.accessor import register_special_dataset
import json

name = 'h5rdmtoolbox'
Expand Down
4 changes: 2 additions & 2 deletions h5rdmtoolbox/extensions/magnitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Dict, Optional

from h5rdmtoolbox.protocols import H5TbxDataset
from h5rdmtoolbox.wrapper.accessory import Accessory, register_special_dataset
from h5rdmtoolbox.wrapper.accessor import Accessor, register_special_dataset


class MagnitudeInterface:
Expand Down Expand Up @@ -50,7 +50,7 @@ def sel(self, method=None, **coords):

@register_special_dataset("Magnitude", "Group")
@register_special_dataset("Magnitude", "File")
class Magnitude(Accessory):
class Magnitude(Accessor):
def __call__(self, *datasets, name: Optional[str] = None, keep_attrs: bool = False) -> MagnitudeInterface:
if len(datasets) < 2:
raise ValueError('Please provide at least two datasets to compute magnitude')
Expand Down
4 changes: 2 additions & 2 deletions h5rdmtoolbox/extensions/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from h5rdmtoolbox import get_ureg
from h5rdmtoolbox.protocols import H5TbxDataset
from h5rdmtoolbox.wrapper.accessory import Accessory, register_special_dataset
from h5rdmtoolbox.wrapper.accessor import Accessor, register_special_dataset

NORM_DELIMITER = '/'

Expand Down Expand Up @@ -91,7 +91,7 @@ def __call__(self,


@register_special_dataset("normalize", "Dataset")
class ToUnitsAccessory(Accessory):
class ToUnitsAccessor(Accessor):
"""Accessor to await selected data to be converted to a new units"""

def __call__(self,
Expand Down
4 changes: 2 additions & 2 deletions h5rdmtoolbox/extensions/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from h5rdmtoolbox import get_ureg
from h5rdmtoolbox.protocols import H5TbxDataset
from h5rdmtoolbox.wrapper.accessory import Accessory, register_special_dataset
from h5rdmtoolbox.wrapper.accessor import Accessor, register_special_dataset


class ToUnitsInterface:
Expand Down Expand Up @@ -38,7 +38,7 @@ def __getitem__(self, *args, **kwargs):


@register_special_dataset("to_units", "Dataset")
class ToUnitsAccessory(Accessory):
class ToUnitsAccessor(Accessor):
"""Accessor to await selected data to be converted to a new units"""

def __call__(self, dataset_unit: Optional[str] = None, **coord_units) -> ToUnitsInterface:
Expand Down
4 changes: 2 additions & 2 deletions h5rdmtoolbox/extensions/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Dict, Optional

from h5rdmtoolbox.protocols import H5TbxDataset
from h5rdmtoolbox.wrapper.accessory import Accessory, register_special_dataset
from h5rdmtoolbox.wrapper.accessor import Accessor, register_special_dataset
from . import magnitude # automatically make magnitude available


Expand All @@ -25,7 +25,7 @@ def __getitem__(self, item) -> xr.Dataset:

@register_special_dataset("Vector", "Group")
@register_special_dataset("Vector", "File")
class Vector(Accessory):
class Vector(Accessor):
def __call__(self,
*args,
**kwargs) -> VectorInterface:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def decorator(accessor):
return decorator


class Accessory:
class Accessor:
"""Base class for all special datasets"""

def __init__(self, obj: H5TbxHLObject):
Expand Down

0 comments on commit 02fccfb

Please sign in to comment.