16
16
)
17
17
18
18
import pystac
19
- from pystac .extensions import item_assets
20
19
from pystac .extensions .base import (
21
20
ExtensionManagementMixin ,
22
21
PropertiesExtension ,
27
26
from pystac .serialization .identify import STACJSONDescription , STACVersionID
28
27
from pystac .utils import get_required , map_opt
29
28
30
- T = TypeVar ("T" , pystac .Item , pystac .Asset , item_assets . AssetDefinition , RasterBand )
29
+ T = TypeVar ("T" , pystac .Item , pystac .Asset , pystac . ItemAssetDefinition , RasterBand )
31
30
32
31
SCHEMA_URI_PATTERN : str = (
33
32
"https://stac-extensions.github.io/classification/v{version}/schema.json"
@@ -492,7 +491,7 @@ class ClassificationExtension(
492
491
"""An abstract class that can be used to extend the properties of
493
492
:class:`~pystac.Item`, :class:`~pystac.Asset`,
494
493
:class:`~pystac.extension.raster.RasterBand`, or
495
- :class:`~pystac.extension.item_assets.AssetDefinition ` with properties from the
494
+ :class:`~pystac.ItemAssetDefinition ` with properties from the
496
495
:stac-ext:`Classification Extension <classification>`. This class is generic
497
496
over the type of STAC object being extended.
498
497
@@ -602,7 +601,7 @@ def ext(cls, obj: T, add_if_missing: bool = False) -> ClassificationExtension[T]
602
601
603
602
This extension can be applied to instances of :class:`~pystac.Item`,
604
603
:class:`~pystac.Asset`,
605
- :class:`~pystac.extensions.item_assets.AssetDefinition `, or
604
+ :class:`~pystac.ItemAssetDefinition `, or
606
605
:class:`~pystac.extension.raster.RasterBand`.
607
606
608
607
Raises:
@@ -614,7 +613,7 @@ def ext(cls, obj: T, add_if_missing: bool = False) -> ClassificationExtension[T]
614
613
elif isinstance (obj , pystac .Asset ):
615
614
cls .ensure_owner_has_extension (obj , add_if_missing )
616
615
return cast (ClassificationExtension [T ], AssetClassificationExtension (obj ))
617
- elif isinstance (obj , item_assets . AssetDefinition ):
616
+ elif isinstance (obj , pystac . ItemAssetDefinition ):
618
617
cls .ensure_owner_has_extension (obj , add_if_missing )
619
618
return cast (
620
619
ClassificationExtension [T ], ItemAssetsClassificationExtension (obj )
@@ -665,17 +664,19 @@ def __repr__(self) -> str:
665
664
666
665
667
666
class ItemAssetsClassificationExtension (
668
- ClassificationExtension [item_assets . AssetDefinition ]
667
+ ClassificationExtension [pystac . ItemAssetDefinition ]
669
668
):
670
669
properties : dict [str , Any ]
671
- asset_defn : item_assets . AssetDefinition
670
+ asset_defn : pystac . ItemAssetDefinition
672
671
673
- def __init__ (self , item_asset : item_assets . AssetDefinition ):
672
+ def __init__ (self , item_asset : pystac . ItemAssetDefinition ):
674
673
self .asset_defn = item_asset
675
674
self .properties = item_asset .properties
676
675
677
676
def __repr__ (self ) -> str :
678
- return f"<ItemAssetsClassificationExtension AssetDefinition={ self .asset_defn } "
677
+ return (
678
+ f"<ItemAssetsClassificationExtension ItemAssetDefinition={ self .asset_defn } "
679
+ )
679
680
680
681
681
682
class RasterBandClassificationExtension (ClassificationExtension [RasterBand ]):
0 commit comments