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

Bump doc dependencies and fix errors/warnings from docstrings #701

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sphinx==6.2.1
sphinx==7.2.6
pangeo-sphinx-book-theme==0.2
myst-nb==1.0.0
sphinx-copybutton==0.5.2
sphinx-togglebutton==0.3.2
sphinx-autodoc-typehints==1.23.0
sphinx-autodoc-typehints==2.0.0
sphinxext-opengraph==0.9.1
sphinx-design==0.5.0
-e .
5 changes: 3 additions & 2 deletions pangeo_forge_recipes/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ def _hash_path(path: str) -> str:

@dataclass
class FSSpecTarget(AbstractTarget):
"""Representation of a storage target for Pangeo Forge.
"""
Representation of a storage target for Pangeo Forge.

:param fs: The filesystem object we are writing to.
:param root_path: The path under which the target data will be stored.
:param fsspec_kwargs: The fsspec kwargs that can be reused as
`target_options` and `remote_options` for fsspec class instantiation
`target_options` and `remote_options` for fsspec class instantiation
"""

fs: fsspec.AbstractFileSystem
Expand Down
28 changes: 16 additions & 12 deletions pangeo_forge_recipes/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def expand(self, pcoll: beam.PCollection):

@dataclass
class PrepareZarrTarget(beam.PTransform):
"""From a singleton PCollection containing a dataset schema, initialize a
"""
From a singleton PCollection containing a dataset schema, initialize a
Zarr store with the correct variables, dimensions, attributes and chunking.
Note that the dimension coordinates will be initialized with dummy values.

Expand All @@ -349,12 +350,14 @@ class PrepareZarrTarget(beam.PTransform):
:param attrs: Extra group-level attributes to inject into the dataset.
:param encoding: Dictionary describing encoding for xarray.to_zarr()
:param consolidated_metadata: Bool controlling if xarray.to_zarr()
writes consolidated metadata. Default's to False. In StoreToZarr,
always default to unconsolidated. This leaves it up to the
user whether or not they want to consolidate with ConsolidateMetadata(). Also,
it prevents a broken/inconsistent state that could arise from metadata being
consolidated here, and then falling out of sync with coordinates if
ConsolidateDimensionCoordinates() is applied to the output of StoreToZarr().
writes consolidated metadata. Default's to False. In StoreToZarr,
always default to unconsolidated. This leaves it up to the
user whether or not they want to consolidate with
ConsolidateMetadata(). Also, it prevents a broken/inconsistent
state that could arise from metadata being consolidated here, and
then falling out of sync with coordinates if
ConsolidateDimensionCoordinates() is applied to the output of
StoreToZarr().
"""

target: str | FSSpecTarget
Expand Down Expand Up @@ -557,14 +560,15 @@ def expand(self, reference_lists: beam.PCollection) -> beam.PCollection:

@dataclass
class WriteReference(beam.PTransform, ZarrWriterMixin):
"""Store a singleton PCollection consisting of a ``kerchunk.combine.MultiZarrToZarr`` object.
"""
Store a singleton PCollection consisting of a ``kerchunk.combine.MultiZarrToZarr`` object.

:param store_name: Zarr store will be created with this name under ``target_root``.
:param concat_dims: Dimensions along which to concatenate inputs.
:param target_root: Root path the Zarr store will be created inside; ``store_name``
will be appended to this prefix to create a full path.
:param output_file_name: Name to give the output references file
(``.json`` or ``.parquet`` suffix).
over which they are accessed. e.g.: "s3", "gcp", "https", etc.
will be appended to this prefix to create a full path.
:param output_file_name: Name to give the output references file (``.json`` or ``.parquet``
suffix) over which they are accessed. e.g.: "s3", "gcp", "https", etc.
:param mzz_kwargs: Additional kwargs to pass to ``kerchunk.combine.MultiZarrToZarr``.
"""

Expand Down
Loading