Skip to content

Commit e15c7c0

Browse files
committed
Rename method for identifying dict type
1 parent 4ebc660 commit e15c7c0

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

pystac/catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ def from_dict(
911911
info = identify_stac_object(d)
912912
d = migrate_to_latest(d, info)
913913

914-
if not cls.identify_dict(d):
914+
if not cls.dict_matches_object_type(d):
915915
raise STACTypeError(f"{d} does not represent a {cls.__name__} instance")
916916

917917
catalog_type = CatalogType.determine_type(d)
@@ -964,5 +964,5 @@ def from_file(cls, href: str, stac_io: Optional[pystac.StacIO] = None) -> "Catal
964964
return result
965965

966966
@classmethod
967-
def identify_dict(cls, d: Dict[str, Any]) -> bool:
967+
def dict_matches_object_type(cls, d: Dict[str, Any]) -> bool:
968968
return identify_stac_object_type(d) == STACObjectType.CATALOG

pystac/collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def from_dict(
592592
info = identify_stac_object(d)
593593
d = migrate_to_latest(d, info)
594594

595-
if not cls.identify_dict(d):
595+
if not cls.dict_matches_object_type(d):
596596
raise STACTypeError(f"{d} does not represent a {cls.__name__} instance")
597597

598598
catalog_type = CatalogType.determine_type(d)
@@ -685,5 +685,5 @@ def from_file(
685685
return result
686686

687687
@classmethod
688-
def identify_dict(cls, d: Dict[str, Any]) -> bool:
688+
def dict_matches_object_type(cls, d: Dict[str, Any]) -> bool:
689689
return identify_stac_object_type(d) == STACObjectType.COLLECTION

pystac/item.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ def from_dict(
920920
info = identify_stac_object(d)
921921
d = migrate_to_latest(d, info)
922922

923-
if not cls.identify_dict(d):
923+
if not cls.dict_matches_object_type(d):
924924
raise pystac.STACTypeError(
925925
f"{d} does not represent a {cls.__name__} instance"
926926
)
@@ -990,5 +990,5 @@ def from_file(cls, href: str, stac_io: Optional[pystac.StacIO] = None) -> "Item"
990990
return result
991991

992992
@classmethod
993-
def identify_dict(cls, d: Dict[str, Any]) -> bool:
993+
def dict_matches_object_type(cls, d: Dict[str, Any]) -> bool:
994994
return identify_stac_object_type(d) == STACObjectType.ITEM

pystac/stac_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def from_dict(
515515

516516
@classmethod
517517
@abstractmethod
518-
def identify_dict(cls, d: Dict[str, Any]) -> bool:
518+
def dict_matches_object_type(cls, d: Dict[str, Any]) -> bool:
519519
"""Returns a boolean indicating whether the given dictionary represents a valid
520520
instance of this :class:`~STACObject` sub-class.
521521

0 commit comments

Comments
 (0)