File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1212- Use [ uv] ( https://github.com/astral-sh/uv ) for development dependencies and docs ([ #1439 ] ( https://github.com/stac-utils/pystac/pull/1439 ) )
1313- Correctly detect absolute file path ref on windows, reflecting change in python 3.13 ([ #1475 ] ( https://github.com/stac-utils/pystac/pull/14750 ) ) (only effects python 3.13)
1414- Deprecated ` ItemAssetExtension ` ([ #1476 ] ( https://github.com/stac-utils/pystac/pull/1476 ) )
15+ - Update Projection Extension to version 2 - proj: epsg -> proj: code ([ #1287 ] ( https://github.com/stac-utils/pystac/pull/1287 ) )
16+ - Update migrate code to handle license changes in STAC spec 1.1.0 ([ #1491 ] ( https://github.com/stac-utils/pystac/pull/1491 ) )
17+ - Allow links to have ` file:// ` prefix - but don't write them that way by default ([ #1489 ] ( https://github.com/stac-utils/pystac/pull/1489 ) )
1518
1619### Fixed
1720
1821- Use ` application/geo+json ` for ` item ` links ([ #1495 ] ( https://github.com/stac-utils/pystac/pull/1495 ) )
22+ - Includes the scientific extension in Item's ext interface ([ #1496 ] ( https://github.com/stac-utils/pystac/pull/1496 ) )
1923
2024## [ v1.11.0] - 2024-09-26
2125
Original file line number Diff line number Diff line change @@ -187,6 +187,10 @@ def sar(self) -> SarExtension[Item]:
187187 def sat (self ) -> SatExtension [Item ]:
188188 return SatExtension .ext (self .stac_object )
189189
190+ @property
191+ def sci (self ) -> ScientificExtension [Item ]:
192+ return ScientificExtension .ext (self .stac_object )
193+
190194 @property
191195 def storage (self ) -> StorageExtension [Item ]:
192196 return StorageExtension .ext (self .stac_object )
Original file line number Diff line number Diff line change 77
88import pystac
99from pystac import ExtensionTypeError
10+ from pystac .errors import ExtensionNotImplemented
1011from pystac .extensions import scientific
1112from pystac .extensions .scientific import (
1213 Publication ,
@@ -494,3 +495,26 @@ def test_summaries_adds_uri(self) -> None:
494495 self .assertNotIn (
495496 ScientificExtension .get_schema_uri (), collection .stac_extensions
496497 )
498+
499+
500+ @pytest .fixture
501+ def ext_item () -> pystac .Item :
502+ path = TestCases .get_path ("data-files/scientific/item.json" )
503+ return pystac .Item .from_file (path )
504+
505+
506+ def test_ext_syntax (ext_item : pystac .Item ) -> None :
507+ assert ext_item .ext .sci .doi == "10.5061/dryad.s2v81.2/27.2"
508+
509+
510+ def test_ext_syntax_remove (ext_item : pystac .Item ) -> None :
511+ ext_item .ext .remove ("sci" )
512+ assert ext_item .ext .has ("sci" ) is False
513+ with pytest .raises (ExtensionNotImplemented ):
514+ ext_item .ext .sci
515+
516+
517+ def test_ext_syntax_add (item : pystac .Item ) -> None :
518+ item .ext .add ("sci" )
519+ assert item .ext .has ("sci" ) is True
520+ assert isinstance (item .ext .sci , ScientificExtension )
You can’t perform that action at this time.
0 commit comments