Skip to content

Commit 608b523

Browse files
committed
Merge branch 'master' into hv_issue719-job-manager-threaded-job-start
2 parents cd26f5a + 6bb1232 commit 608b523

File tree

7 files changed

+449
-316
lines changed

7 files changed

+449
-316
lines changed

.github/workflows/unittests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
- "3.10"
2727
- "3.11"
2828
- "3.12"
29+
- "3.13"
2930
# Additional special cases (see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-adding-configurations)
3031
include:
3132
- os: "windows-latest"

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Official support for Python 3.13 (include Python 3.13 in unit test matrix on GitHub Actions) ([#653](https://github.com/Open-EO/openeo-python-client/issues/653))
13+
1214
### Changed
1315

1416
### Removed
1517

1618
### Fixed
1719

20+
- `STACAPIJobDatabase.item_from()` use "datetime" from series instead of always taking "now" ([#797](https://github.com/Open-EO/openeo-python-client/issues/797))
21+
- Fix Python 3.13 compatibility issue in `openeo.extra.spectral_indices` ([#799](https://github.com/Open-EO/openeo-python-client/issues/799))
22+
1823

1924
## [0.43.0] - 2025-07-02
2025

openeo/extra/job_management/stac_job_db.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,10 @@ def item_from(self, series: pd.Series) -> pystac.Item:
136136
item_dict.setdefault("links", [])
137137
item_dict.setdefault("properties", series_dict)
138138

139-
dt = series_dict.get("datetime", None)
140-
if dt and item_dict["properties"].get("datetime", None) is None:
141-
dt_str = pystac.utils.datetime_to_str(dt) if isinstance(dt, datetime.datetime) else dt
142-
item_dict["properties"]["datetime"] = dt_str
143-
144-
else:
145-
item_dict["properties"]["datetime"] = pystac.utils.datetime_to_str(datetime.datetime.now())
139+
dt = item_dict["properties"].get("datetime", datetime.datetime.now(tz=datetime.timezone.utc))
140+
if isinstance(dt, datetime.datetime):
141+
dt = pystac.utils.datetime_to_str(dt)
142+
item_dict["properties"]["datetime"] = dt
146143

147144
if self.has_geometry:
148145
item_dict["geometry"] = series[self.geometry_column]

openeo/extra/spectral_indices/spectral_indices.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def load_indices() -> Dict[str, dict]:
2626
# and provide an alternative mechanism to work with custom indices
2727
"resources/extra-indices-dict.json",
2828
]:
29-
with importlib_resources.files("openeo.extra.spectral_indices") / path as resource_path:
30-
data = json.loads(resource_path.read_text(encoding="utf8"))
31-
overwrites = set(specs.keys()).intersection(data["SpectralIndices"].keys())
32-
if overwrites:
33-
raise RuntimeError(f"Duplicate spectral indices: {overwrites} from {path}")
34-
specs.update(data["SpectralIndices"])
29+
resource = importlib_resources.files("openeo.extra.spectral_indices") / path
30+
data = json.loads(resource.read_text(encoding="utf8"))
31+
overwrites = set(specs.keys()).intersection(data["SpectralIndices"].keys())
32+
if overwrites:
33+
raise RuntimeError(f"Duplicate spectral indices: {overwrites} from {path}")
34+
specs.update(data["SpectralIndices"])
3535

3636
return specs
3737

@@ -40,10 +40,10 @@ def load_indices() -> Dict[str, dict]:
4040
def load_constants() -> Dict[str, float]:
4141
"""Load constants defined by Awesome Spectral Indices."""
4242
# TODO: encapsulate all this json loading in a single Awesome Spectral Indices registry class?
43-
with importlib_resources.files(
44-
"openeo.extra.spectral_indices"
45-
) / "resources/awesome-spectral-indices/constants.json" as resource_path:
46-
data = json.loads(resource_path.read_text(encoding="utf8"))
43+
resource = (
44+
importlib_resources.files("openeo.extra.spectral_indices") / "resources/awesome-spectral-indices/constants.json"
45+
)
46+
data = json.loads(resource.read_text(encoding="utf8"))
4747

4848
return {k: v["default"] for k, v in data.items() if isinstance(v["default"], (int, float))}
4949

@@ -52,10 +52,10 @@ def load_constants() -> Dict[str, float]:
5252
def _load_bands() -> Dict[str, dict]:
5353
"""Load band name mapping defined by Awesome Spectral Indices."""
5454
# TODO: encapsulate all this json loading in a single Awesome Spectral Indices registry class?
55-
with importlib_resources.files(
56-
"openeo.extra.spectral_indices"
57-
) / "resources/awesome-spectral-indices/bands.json" as resource_path:
58-
data = json.loads(resource_path.read_text(encoding="utf8"))
55+
resource = (
56+
importlib_resources.files("openeo.extra.spectral_indices") / "resources/awesome-spectral-indices/bands.json"
57+
)
58+
data = json.loads(resource.read_text(encoding="utf8"))
5959
return data
6060

6161

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"Programming Language :: Python :: 3.10",
103103
"Programming Language :: Python :: 3.11",
104104
"Programming Language :: Python :: 3.12",
105+
"Programming Language :: Python :: 3.13",
105106
"License :: OSI Approved :: Apache Software License",
106107
"Development Status :: 5 - Production/Stable",
107108
"Operating System :: OS Independent",

0 commit comments

Comments
 (0)