Skip to content

Removed type information from docstrings #342

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

Merged
merged 1 commit into from
May 20, 2021
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
14 changes: 7 additions & 7 deletions pystac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def read_file(href: str) -> STACObject:
This is a convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`

Args:
href (str): The HREF to read the object from.
href : The HREF to read the object from.

Returns:
The specific STACObject implementation class that is represented
Expand All @@ -104,10 +104,10 @@ def write_file(
Convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`

Args:
obj (STACObject): The STACObject to save.
include_self_link (bool): If this is true, include the 'self' link with this object.
obj : The STACObject to save.
include_self_link : If this is true, include the 'self' link with this object.
Otherwise, leave out the self link.
dest_href (str): Optional HREF to save the file to. If None, the object will be saved
dest_href : Optional HREF to save the file to. If None, the object will be saved
to the object's self href.
"""
obj.save_object(include_self_link=include_self_link, dest_href=dest_href)
Expand All @@ -128,10 +128,10 @@ def read_dict(
This is a convenience method for :meth:`pystac.serialization.stac_object_from_dict`

Args:
d (dict): The dict to parse.
href (str): Optional href that is the file location of the object being
d : The dict to parse.
href : Optional href that is the file location of the object being
parsed.
root (Catalog or Collection): Optional root of the catalog for this object.
root : Optional root of the catalog for this object.
If provided, the root's resolved object cache can be used to search for
previously resolved instances of the STAC object.
stac_io: Optional StacIO instance to use for reading. If None, the
Expand Down
22 changes: 11 additions & 11 deletions pystac/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class Asset:
can be downloaded or streamed.

Args:
href (str): Link to the asset object. Relative and absolute links are both
href : Link to the asset object. Relative and absolute links are both
allowed.
title (str): Optional displayed title for clients and users.
description (str): A description of the Asset providing additional details,
title : Optional displayed title for clients and users.
description : A description of the Asset providing additional details,
such as how it was processed or created. CommonMark 0.29 syntax MAY be used
for rich text representation.
media_type (str): Optional description of the media type. Registered Media Types
media_type : Optional description of the media type. Registered Media Types
are preferred. See :class:`~pystac.MediaType` for common media types.
roles ([str]): Optional, Semantic roles (i.e. thumbnail, overview,
roles : Optional, Semantic roles (i.e. thumbnail, overview,
data, metadata) of the asset.
properties (dict): Optional, additional properties for this asset. This is used
properties : Optional, additional properties for this asset. This is used
by extensions as a way to serialize and deserialize properties on asset
object JSON.

Attributes:
href (str): Link to the asset object. Relative and absolute links are both
href : Link to the asset object. Relative and absolute links are both
allowed.
title (str): Optional displayed title for clients and users.
description (str): A description of the Asset providing additional details,
title : Optional displayed title for clients and users.
description : A description of the Asset providing additional details,
such as how it was processed or created. CommonMark 0.29 syntax MAY be
used for rich text representation.
media_type (str): Optional description of the media type. Registered Media Types
media_type : Optional description of the media type. Registered Media Types
are preferred. See :class:`~pystac.MediaType` for common media types.
properties (dict): Optional, additional properties for this asset. This is used
properties : Optional, additional properties for this asset. This is used
by extensions as a way to serialize and deserialize properties on asset
object JSON.
owner: The Item or Collection this asset belongs to, or None if it has no owner.
Expand Down
22 changes: 11 additions & 11 deletions pystac/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class ResolvedObjectCache:
them with their copies.

Args:
id_keys_to_objects (Dict[str, STACObject]): Existing cache of
id_keys_to_objects : Existing cache of
a key made up of the STACObject and it's parents IDs mapped
to the cached STACObject.
hrefs_to_objects (Dict[str, STACObject]): STAC Object HREFs matched to
hrefs_to_objects : STAC Object HREFs matched to
their cached object.
ids_to_collections (Dict[str, Collection]): Map of collection IDs
ids_to_collections : Map of collection IDs
to collections.
"""

Expand All @@ -76,7 +76,7 @@ def get_or_cache(self, obj: "STACObject_Type") -> "STACObject_Type":
none exists, sets the cached object to the given object.

Args:
obj (STACObject): The given object who's cache key will be checked
obj : The given object who's cache key will be checked
against the cache.

Returns:
Expand All @@ -101,7 +101,7 @@ def get(self, obj: "STACObject_Type") -> Optional["STACObject_Type"]:
"""Get the cached object that has the same cache key as the given object.

Args:
obj (STACObject): The given object who's cache key will be checked against
obj : The given object who's cache key will be checked against
the cache.

Returns:
Expand All @@ -118,7 +118,7 @@ def get_by_href(self, href: str) -> Optional["STACObject_Type"]:
"""Gets the cached object at href.

Args:
href (str): The href to use as the key for the cached object.
href : The href to use as the key for the cached object.

Returns:
STACObject or None: Returns the STACObject if cached, otherwise None.
Expand All @@ -129,7 +129,7 @@ def get_collection_by_id(self, id: str) -> Optional["Collection_Type"]:
"""Retrieved a cached Collection by its ID.

Args:
id (str): The ID of the collection.
id : The ID of the collection.

Returns:
Collection or None: Returns the collection if there is one cached
Expand All @@ -141,7 +141,7 @@ def cache(self, obj: "STACObject_Type") -> None:
"""Set the given object into the cache.

Args:
obj (STACObject): The object to cache
obj : The object to cache
"""
key, is_href = get_cache_key(obj)
if is_href:
Expand All @@ -156,7 +156,7 @@ def remove(self, obj: "STACObject_Type") -> None:
"""Removes any cached object that matches the given object's cache key.

Args:
obj (STACObject): The object to remove
obj : The object to remove
"""
key, is_href = get_cache_key(obj)

Expand Down Expand Up @@ -194,9 +194,9 @@ def merge(
in the first will be cached in the resulting merged ResolvedObjectCache.

Args:
first (ResolvedObjectCache): The first cache to merge. This cache will be
first : The first cache to merge. This cache will be
the preferred cache for objects in the case of ID conflicts.
second (ResolvedObjectCache): The second cache to merge.
second : The second cache to merge.

Returns:
ResolvedObjectCache: The resulting merged cache.
Expand Down
76 changes: 38 additions & 38 deletions pystac/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def determine_type(cls, stac_json: Dict[str, Any]) -> Optional["CatalogType"]:
Only applies to Catalogs or Collections

Args:
stac_json (dict): The STAC JSON dict to determine the catalog type
stac_json : The STAC JSON dict to determine the catalog type

Returns:
Optional[CatalogType]: The catalog type of the catalog or collection.
Expand Down Expand Up @@ -102,28 +102,28 @@ class Catalog(STACObject):
as well as :class:`~pystac.Item` s.

Args:
id (str): Identifier for the catalog. Must be unique within the STAC.
description (str): Detailed multi-line description to fully explain the catalog.
id : Identifier for the catalog. Must be unique within the STAC.
description : Detailed multi-line description to fully explain the catalog.
`CommonMark 0.28 syntax <http://commonmark.org/>`_ MAY be used for rich text
representation.
title (str or None): Optional short descriptive one-line title for the catalog.
stac_extensions (List[str]): Optional list of extensions the Catalog implements.
href (str or None): Optional HREF for this catalog, which be set as the
title : Optional short descriptive one-line title for the catalog.
stac_extensions : Optional list of extensions the Catalog implements.
href : Optional HREF for this catalog, which be set as the
catalog's self link's HREF.
catalog_type (str or None): Optional catalog type for this catalog. Must
catalog_type : Optional catalog type for this catalog. Must
be one of the values in :class`~pystac.CatalogType`.

Attributes:
id (str): Identifier for the catalog.
description (str): Detailed multi-line description to fully explain the catalog.
title (str or None): Optional short descriptive one-line title for the catalog.
stac_extensions (List[str] or None): Optional list of extensions the Catalog
id : Identifier for the catalog.
description : Detailed multi-line description to fully explain the catalog.
title : Optional short descriptive one-line title for the catalog.
stac_extensions : Optional list of extensions the Catalog
implements.
extra_fields (dict or None): Extra fields that are part of the top-level JSON
extra_fields : Extra fields that are part of the top-level JSON
properties of the Catalog.
links (List[Link]): A list of :class:`~pystac.Link` objects representing
links : A list of :class:`~pystac.Link` objects representing
all links associated with this Catalog.
catalog_type (str): The catalog type. Defaults to ABSOLUTE_PUBLISHED
catalog_type : The catalog type. Defaults to ABSOLUTE_PUBLISHED
"""

STAC_OBJECT_TYPE = pystac.STACObjectType.CATALOG
Expand Down Expand Up @@ -197,9 +197,9 @@ def add_child(
this Catalog's root.

Args:
child (Catalog or Collection): The child to add.
title (str): Optional title to give to the :class:`~pystac.Link`
strategy (HrefLayoutStrategy): The layout strategy to use for setting the
child : The child to add.
title : Optional title to give to the :class:`~pystac.Link`
strategy : The layout strategy to use for setting the
self href of the child.
"""

Expand Down Expand Up @@ -229,7 +229,7 @@ def add_children(
this Catalog's root.

Args:
children (Iterable[Catalog or Collection]): The children to add.
children : The children to add.
"""
for child in children:
self.add_child(child)
Expand All @@ -245,8 +245,8 @@ def add_item(
this Catalog's root.

Args:
item (Item): The item to add.
title (str): Optional title to give to the :class:`~pystac.Link`
item : The item to add.
title : Optional title to give to the :class:`~pystac.Link`
"""

# Prevent typo confusion
Expand All @@ -273,7 +273,7 @@ def add_items(self, items: Iterable["Item_Type"]) -> None:
this Catalog's root.

Args:
items (Iterable[Item]): The items to add.
items : The items to add.
"""
for item in items:
self.add_item(item)
Expand All @@ -284,8 +284,8 @@ def get_child(
"""Gets the child of this catalog with the given ID, if it exists.

Args:
id (str): The ID of the child to find.
recursive (bool): If True, search this catalog and all children for the
id : The ID of the child to find.
recursive : If True, search this catalog and all children for the
item; otherwise, only search the children of this catalog. Defaults
to False.

Expand Down Expand Up @@ -336,7 +336,7 @@ def remove_child(self, child_id: str) -> None:
"""Removes an child from this catalog.

Args:
child_id (str): The ID of the child to remove.
child_id : The ID of the child to remove.
"""
new_links: List[pystac.Link] = []
root = self.get_root()
Expand All @@ -357,8 +357,8 @@ def get_item(self, id: str, recursive: bool = False) -> Optional["Item_Type"]:
"""Returns an item with a given ID.

Args:
id (str): The ID of the item to find.
recursive (bool): If True, search this catalog and all children for the
id : The ID of the item to find.
recursive : If True, search this catalog and all children for the
item; otherwise, only search the items of this catalog. Defaults
to False.

Expand Down Expand Up @@ -400,7 +400,7 @@ def remove_item(self, item_id: str) -> None:
"""Removes an item from this catalog.

Args:
item_id (str): The ID of the item to remove.
item_id : The ID of the item to remove.
"""
new_links: List[pystac.Link] = []
root = self.get_root()
Expand Down Expand Up @@ -515,13 +515,13 @@ def normalize_and_save(
in sequence.

Args:
root_href (str): The absolute HREF that all links will be normalized
root_href : The absolute HREF that all links will be normalized
against.
catalog_type (str): The catalog type that dictates the structure of
catalog_type : The catalog type that dictates the structure of
the catalog to save. Use a member of :class:`~pystac.CatalogType`.
Defaults to the root catalog.catalog_type or the current catalog
catalog_type if there is no root catalog.
strategy (HrefLayoutStrategy): The layout strategy to use in setting the
strategy : The layout strategy to use in setting the
HREFS for this catalog. Defaults to
:class:`~pystac.layout.BestPracticesLayoutStrategy`
"""
Expand All @@ -538,8 +538,8 @@ def normalize_hrefs(
This method mutates the entire catalog tree.

Args:
root_href (str): The absolute HREF that all links will be normalized against.
strategy (HrefLayoutStrategy): The layout strategy to use in setting the HREFS
root_href : The absolute HREF that all links will be normalized against.
strategy : The layout strategy to use in setting the HREFS
for this catalog. Defaults to :class:`~pystac.layout.BestPracticesLayoutStrategy`

See:
Expand Down Expand Up @@ -611,12 +611,12 @@ def generate_subcatalogs(
and organize the items based on template values.

Args:
template (str): A template string that
template : A template string that
can be consumed by a :class:`~pystac.layout.LayoutTemplate`
defaults (dict): Default values for the template variables
defaults : Default values for the template variables
that will be used if the property cannot be found on
the item.
parent_ids (List[str]): Optional list of the parent catalogs'
parent_ids : Optional list of the parent catalogs'
identifiers. If the bottom-most subcatalogs already match the
template, no subcatalog is added.

Expand Down Expand Up @@ -683,7 +683,7 @@ def save(self, catalog_type: Optional[CatalogType] = None) -> None:
self link HREF.

Args:
catalog_type (str): The catalog type that dictates the structure of
catalog_type : The catalog type that dictates the structure of
the catalog to save. Use a member of :class:`~pystac.CatalogType`.
If not supplied, the catalog_type of this catalog will be used.
If that attribute is not set, an exception will be raised.
Expand Down Expand Up @@ -783,7 +783,7 @@ def map_items(
item_mapper function.

Args:
item_mapper (Callable): A function that takes in an item, and returns
item_mapper : A function that takes in an item, and returns
either an item or list of items. The item that is passed into the
item_mapper is a copy, so the method can mutate it safely.

Expand Down Expand Up @@ -829,7 +829,7 @@ def map_assets(
through the asset_mapper function.

Args:
asset_mapper (Callable): A function that takes in an key and an Asset, and
asset_mapper : A function that takes in an key and an Asset, and
returns either an Asset, a (key, Asset), or a dictionary of Assets with
unique keys. The Asset that is passed into the item_mapper is a copy,
so the method can mutate it safely.
Expand Down
Loading