Skip to content

Commit 61f62b1

Browse files
author
Jon Duckworth
authored
Merge pull request #342 from volaya/remove_types_docstrings
Removed type information from docstrings
2 parents 8b9884e + d5f61f8 commit 61f62b1

31 files changed

+389
-389
lines changed

pystac/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def read_file(href: str) -> STACObject:
7979
This is a convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`
8080
8181
Args:
82-
href (str): The HREF to read the object from.
82+
href : The HREF to read the object from.
8383
8484
Returns:
8585
The specific STACObject implementation class that is represented
@@ -104,10 +104,10 @@ def write_file(
104104
Convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`
105105
106106
Args:
107-
obj (STACObject): The STACObject to save.
108-
include_self_link (bool): If this is true, include the 'self' link with this object.
107+
obj : The STACObject to save.
108+
include_self_link : If this is true, include the 'self' link with this object.
109109
Otherwise, leave out the self link.
110-
dest_href (str): Optional HREF to save the file to. If None, the object will be saved
110+
dest_href : Optional HREF to save the file to. If None, the object will be saved
111111
to the object's self href.
112112
"""
113113
obj.save_object(include_self_link=include_self_link, dest_href=dest_href)
@@ -128,10 +128,10 @@ def read_dict(
128128
This is a convenience method for :meth:`pystac.serialization.stac_object_from_dict`
129129
130130
Args:
131-
d (dict): The dict to parse.
132-
href (str): Optional href that is the file location of the object being
131+
d : The dict to parse.
132+
href : Optional href that is the file location of the object being
133133
parsed.
134-
root (Catalog or Collection): Optional root of the catalog for this object.
134+
root : Optional root of the catalog for this object.
135135
If provided, the root's resolved object cache can be used to search for
136136
previously resolved instances of the STAC object.
137137
stac_io: Optional StacIO instance to use for reading. If None, the

pystac/asset.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ class Asset:
1414
can be downloaded or streamed.
1515
1616
Args:
17-
href (str): Link to the asset object. Relative and absolute links are both
17+
href : Link to the asset object. Relative and absolute links are both
1818
allowed.
19-
title (str): Optional displayed title for clients and users.
20-
description (str): A description of the Asset providing additional details,
19+
title : Optional displayed title for clients and users.
20+
description : A description of the Asset providing additional details,
2121
such as how it was processed or created. CommonMark 0.29 syntax MAY be used
2222
for rich text representation.
23-
media_type (str): Optional description of the media type. Registered Media Types
23+
media_type : Optional description of the media type. Registered Media Types
2424
are preferred. See :class:`~pystac.MediaType` for common media types.
25-
roles ([str]): Optional, Semantic roles (i.e. thumbnail, overview,
25+
roles : Optional, Semantic roles (i.e. thumbnail, overview,
2626
data, metadata) of the asset.
27-
properties (dict): Optional, additional properties for this asset. This is used
27+
properties : Optional, additional properties for this asset. This is used
2828
by extensions as a way to serialize and deserialize properties on asset
2929
object JSON.
3030
3131
Attributes:
32-
href (str): Link to the asset object. Relative and absolute links are both
32+
href : Link to the asset object. Relative and absolute links are both
3333
allowed.
34-
title (str): Optional displayed title for clients and users.
35-
description (str): A description of the Asset providing additional details,
34+
title : Optional displayed title for clients and users.
35+
description : A description of the Asset providing additional details,
3636
such as how it was processed or created. CommonMark 0.29 syntax MAY be
3737
used for rich text representation.
38-
media_type (str): Optional description of the media type. Registered Media Types
38+
media_type : Optional description of the media type. Registered Media Types
3939
are preferred. See :class:`~pystac.MediaType` for common media types.
40-
properties (dict): Optional, additional properties for this asset. This is used
40+
properties : Optional, additional properties for this asset. This is used
4141
by extensions as a way to serialize and deserialize properties on asset
4242
object JSON.
4343
owner: The Item or Collection this asset belongs to, or None if it has no owner.

pystac/cache.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class ResolvedObjectCache:
5050
them with their copies.
5151
5252
Args:
53-
id_keys_to_objects (Dict[str, STACObject]): Existing cache of
53+
id_keys_to_objects : Existing cache of
5454
a key made up of the STACObject and it's parents IDs mapped
5555
to the cached STACObject.
56-
hrefs_to_objects (Dict[str, STACObject]): STAC Object HREFs matched to
56+
hrefs_to_objects : STAC Object HREFs matched to
5757
their cached object.
58-
ids_to_collections (Dict[str, Collection]): Map of collection IDs
58+
ids_to_collections : Map of collection IDs
5959
to collections.
6060
"""
6161

@@ -76,7 +76,7 @@ def get_or_cache(self, obj: "STACObject_Type") -> "STACObject_Type":
7676
none exists, sets the cached object to the given object.
7777
7878
Args:
79-
obj (STACObject): The given object who's cache key will be checked
79+
obj : The given object who's cache key will be checked
8080
against the cache.
8181
8282
Returns:
@@ -101,7 +101,7 @@ def get(self, obj: "STACObject_Type") -> Optional["STACObject_Type"]:
101101
"""Get the cached object that has the same cache key as the given object.
102102
103103
Args:
104-
obj (STACObject): The given object who's cache key will be checked against
104+
obj : The given object who's cache key will be checked against
105105
the cache.
106106
107107
Returns:
@@ -118,7 +118,7 @@ def get_by_href(self, href: str) -> Optional["STACObject_Type"]:
118118
"""Gets the cached object at href.
119119
120120
Args:
121-
href (str): The href to use as the key for the cached object.
121+
href : The href to use as the key for the cached object.
122122
123123
Returns:
124124
STACObject or None: Returns the STACObject if cached, otherwise None.
@@ -129,7 +129,7 @@ def get_collection_by_id(self, id: str) -> Optional["Collection_Type"]:
129129
"""Retrieved a cached Collection by its ID.
130130
131131
Args:
132-
id (str): The ID of the collection.
132+
id : The ID of the collection.
133133
134134
Returns:
135135
Collection or None: Returns the collection if there is one cached
@@ -141,7 +141,7 @@ def cache(self, obj: "STACObject_Type") -> None:
141141
"""Set the given object into the cache.
142142
143143
Args:
144-
obj (STACObject): The object to cache
144+
obj : The object to cache
145145
"""
146146
key, is_href = get_cache_key(obj)
147147
if is_href:
@@ -156,7 +156,7 @@ def remove(self, obj: "STACObject_Type") -> None:
156156
"""Removes any cached object that matches the given object's cache key.
157157
158158
Args:
159-
obj (STACObject): The object to remove
159+
obj : The object to remove
160160
"""
161161
key, is_href = get_cache_key(obj)
162162

@@ -194,9 +194,9 @@ def merge(
194194
in the first will be cached in the resulting merged ResolvedObjectCache.
195195
196196
Args:
197-
first (ResolvedObjectCache): The first cache to merge. This cache will be
197+
first : The first cache to merge. This cache will be
198198
the preferred cache for objects in the case of ID conflicts.
199-
second (ResolvedObjectCache): The second cache to merge.
199+
second : The second cache to merge.
200200
201201
Returns:
202202
ResolvedObjectCache: The resulting merged cache.

pystac/catalog.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def determine_type(cls, stac_json: Dict[str, Any]) -> Optional["CatalogType"]:
6868
Only applies to Catalogs or Collections
6969
7070
Args:
71-
stac_json (dict): The STAC JSON dict to determine the catalog type
71+
stac_json : The STAC JSON dict to determine the catalog type
7272
7373
Returns:
7474
Optional[CatalogType]: The catalog type of the catalog or collection.
@@ -102,28 +102,28 @@ class Catalog(STACObject):
102102
as well as :class:`~pystac.Item` s.
103103
104104
Args:
105-
id (str): Identifier for the catalog. Must be unique within the STAC.
106-
description (str): Detailed multi-line description to fully explain the catalog.
105+
id : Identifier for the catalog. Must be unique within the STAC.
106+
description : Detailed multi-line description to fully explain the catalog.
107107
`CommonMark 0.28 syntax <http://commonmark.org/>`_ MAY be used for rich text
108108
representation.
109-
title (str or None): Optional short descriptive one-line title for the catalog.
110-
stac_extensions (List[str]): Optional list of extensions the Catalog implements.
111-
href (str or None): Optional HREF for this catalog, which be set as the
109+
title : Optional short descriptive one-line title for the catalog.
110+
stac_extensions : Optional list of extensions the Catalog implements.
111+
href : Optional HREF for this catalog, which be set as the
112112
catalog's self link's HREF.
113-
catalog_type (str or None): Optional catalog type for this catalog. Must
113+
catalog_type : Optional catalog type for this catalog. Must
114114
be one of the values in :class`~pystac.CatalogType`.
115115
116116
Attributes:
117-
id (str): Identifier for the catalog.
118-
description (str): Detailed multi-line description to fully explain the catalog.
119-
title (str or None): Optional short descriptive one-line title for the catalog.
120-
stac_extensions (List[str] or None): Optional list of extensions the Catalog
117+
id : Identifier for the catalog.
118+
description : Detailed multi-line description to fully explain the catalog.
119+
title : Optional short descriptive one-line title for the catalog.
120+
stac_extensions : Optional list of extensions the Catalog
121121
implements.
122-
extra_fields (dict or None): Extra fields that are part of the top-level JSON
122+
extra_fields : Extra fields that are part of the top-level JSON
123123
properties of the Catalog.
124-
links (List[Link]): A list of :class:`~pystac.Link` objects representing
124+
links : A list of :class:`~pystac.Link` objects representing
125125
all links associated with this Catalog.
126-
catalog_type (str): The catalog type. Defaults to ABSOLUTE_PUBLISHED
126+
catalog_type : The catalog type. Defaults to ABSOLUTE_PUBLISHED
127127
"""
128128

129129
STAC_OBJECT_TYPE = pystac.STACObjectType.CATALOG
@@ -197,9 +197,9 @@ def add_child(
197197
this Catalog's root.
198198
199199
Args:
200-
child (Catalog or Collection): The child to add.
201-
title (str): Optional title to give to the :class:`~pystac.Link`
202-
strategy (HrefLayoutStrategy): The layout strategy to use for setting the
200+
child : The child to add.
201+
title : Optional title to give to the :class:`~pystac.Link`
202+
strategy : The layout strategy to use for setting the
203203
self href of the child.
204204
"""
205205

@@ -229,7 +229,7 @@ def add_children(
229229
this Catalog's root.
230230
231231
Args:
232-
children (Iterable[Catalog or Collection]): The children to add.
232+
children : The children to add.
233233
"""
234234
for child in children:
235235
self.add_child(child)
@@ -245,8 +245,8 @@ def add_item(
245245
this Catalog's root.
246246
247247
Args:
248-
item (Item): The item to add.
249-
title (str): Optional title to give to the :class:`~pystac.Link`
248+
item : The item to add.
249+
title : Optional title to give to the :class:`~pystac.Link`
250250
"""
251251

252252
# Prevent typo confusion
@@ -273,7 +273,7 @@ def add_items(self, items: Iterable["Item_Type"]) -> None:
273273
this Catalog's root.
274274
275275
Args:
276-
items (Iterable[Item]): The items to add.
276+
items : The items to add.
277277
"""
278278
for item in items:
279279
self.add_item(item)
@@ -284,8 +284,8 @@ def get_child(
284284
"""Gets the child of this catalog with the given ID, if it exists.
285285
286286
Args:
287-
id (str): The ID of the child to find.
288-
recursive (bool): If True, search this catalog and all children for the
287+
id : The ID of the child to find.
288+
recursive : If True, search this catalog and all children for the
289289
item; otherwise, only search the children of this catalog. Defaults
290290
to False.
291291
@@ -336,7 +336,7 @@ def remove_child(self, child_id: str) -> None:
336336
"""Removes an child from this catalog.
337337
338338
Args:
339-
child_id (str): The ID of the child to remove.
339+
child_id : The ID of the child to remove.
340340
"""
341341
new_links: List[pystac.Link] = []
342342
root = self.get_root()
@@ -357,8 +357,8 @@ def get_item(self, id: str, recursive: bool = False) -> Optional["Item_Type"]:
357357
"""Returns an item with a given ID.
358358
359359
Args:
360-
id (str): The ID of the item to find.
361-
recursive (bool): If True, search this catalog and all children for the
360+
id : The ID of the item to find.
361+
recursive : If True, search this catalog and all children for the
362362
item; otherwise, only search the items of this catalog. Defaults
363363
to False.
364364
@@ -400,7 +400,7 @@ def remove_item(self, item_id: str) -> None:
400400
"""Removes an item from this catalog.
401401
402402
Args:
403-
item_id (str): The ID of the item to remove.
403+
item_id : The ID of the item to remove.
404404
"""
405405
new_links: List[pystac.Link] = []
406406
root = self.get_root()
@@ -515,13 +515,13 @@ def normalize_and_save(
515515
in sequence.
516516
517517
Args:
518-
root_href (str): The absolute HREF that all links will be normalized
518+
root_href : The absolute HREF that all links will be normalized
519519
against.
520-
catalog_type (str): The catalog type that dictates the structure of
520+
catalog_type : The catalog type that dictates the structure of
521521
the catalog to save. Use a member of :class:`~pystac.CatalogType`.
522522
Defaults to the root catalog.catalog_type or the current catalog
523523
catalog_type if there is no root catalog.
524-
strategy (HrefLayoutStrategy): The layout strategy to use in setting the
524+
strategy : The layout strategy to use in setting the
525525
HREFS for this catalog. Defaults to
526526
:class:`~pystac.layout.BestPracticesLayoutStrategy`
527527
"""
@@ -538,8 +538,8 @@ def normalize_hrefs(
538538
This method mutates the entire catalog tree.
539539
540540
Args:
541-
root_href (str): The absolute HREF that all links will be normalized against.
542-
strategy (HrefLayoutStrategy): The layout strategy to use in setting the HREFS
541+
root_href : The absolute HREF that all links will be normalized against.
542+
strategy : The layout strategy to use in setting the HREFS
543543
for this catalog. Defaults to :class:`~pystac.layout.BestPracticesLayoutStrategy`
544544
545545
See:
@@ -611,12 +611,12 @@ def generate_subcatalogs(
611611
and organize the items based on template values.
612612
613613
Args:
614-
template (str): A template string that
614+
template : A template string that
615615
can be consumed by a :class:`~pystac.layout.LayoutTemplate`
616-
defaults (dict): Default values for the template variables
616+
defaults : Default values for the template variables
617617
that will be used if the property cannot be found on
618618
the item.
619-
parent_ids (List[str]): Optional list of the parent catalogs'
619+
parent_ids : Optional list of the parent catalogs'
620620
identifiers. If the bottom-most subcatalogs already match the
621621
template, no subcatalog is added.
622622
@@ -683,7 +683,7 @@ def save(self, catalog_type: Optional[CatalogType] = None) -> None:
683683
self link HREF.
684684
685685
Args:
686-
catalog_type (str): The catalog type that dictates the structure of
686+
catalog_type : The catalog type that dictates the structure of
687687
the catalog to save. Use a member of :class:`~pystac.CatalogType`.
688688
If not supplied, the catalog_type of this catalog will be used.
689689
If that attribute is not set, an exception will be raised.
@@ -783,7 +783,7 @@ def map_items(
783783
item_mapper function.
784784
785785
Args:
786-
item_mapper (Callable): A function that takes in an item, and returns
786+
item_mapper : A function that takes in an item, and returns
787787
either an item or list of items. The item that is passed into the
788788
item_mapper is a copy, so the method can mutate it safely.
789789
@@ -829,7 +829,7 @@ def map_assets(
829829
through the asset_mapper function.
830830
831831
Args:
832-
asset_mapper (Callable): A function that takes in an key and an Asset, and
832+
asset_mapper : A function that takes in an key and an Asset, and
833833
returns either an Asset, a (key, Asset), or a dictionary of Assets with
834834
unique keys. The Asset that is passed into the item_mapper is a copy,
835835
so the method can mutate it safely.

0 commit comments

Comments
 (0)