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 12
12
- Use [ uv] ( https://github.com/astral-sh/uv ) for development dependencies and docs ([ #1439 ] ( https://github.com/stac-utils/pystac/pull/1439 ) )
13
13
- 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)
14
14
- 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 ) )
15
18
16
19
### Fixed
17
20
18
21
- 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 ) )
19
23
20
24
## [ v1.11.0] - 2024-09-26
21
25
Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ def sar(self) -> SarExtension[Item]:
180
180
def sat (self ) -> SatExtension [Item ]:
181
181
return SatExtension .ext (self .stac_object )
182
182
183
+ @property
184
+ def sci (self ) -> ScientificExtension [Item ]:
185
+ return ScientificExtension .ext (self .stac_object )
186
+
183
187
@property
184
188
def storage (self ) -> StorageExtension [Item ]:
185
189
return StorageExtension .ext (self .stac_object )
Original file line number Diff line number Diff line change 7
7
8
8
import pystac
9
9
from pystac import ExtensionTypeError
10
+ from pystac .errors import ExtensionNotImplemented
10
11
from pystac .extensions import scientific
11
12
from pystac .extensions .scientific import (
12
13
Publication ,
@@ -494,3 +495,26 @@ def test_summaries_adds_uri(self) -> None:
494
495
self .assertNotIn (
495
496
ScientificExtension .get_schema_uri (), collection .stac_extensions
496
497
)
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