from pathlib import Path


def guess_zarr_path(path):
    """Guess whether string path is part of a zarr hierarchy.

    Parameters
    ----------
    path : str
        Path to a file or directory.

    Returns
    -------
    bool
        Whether path is for zarr.
    >>> guess_zarr_path('dataset.zarr')
    True
    >>> guess_zarr_path('dataset.zarr/path/to/array')
    True
    >>> guess_zarr_path('dataset.zarr/component.png')
    True
    """
    return any(part.endswith(".zarr") for part in Path(path).parts)