fastprocesses 0.22.2__tar.gz → 0.22.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/PKG-INFO +2 -2
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/README.md +1 -1
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/pyproject.toml +1 -1
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/base_process.py +5 -1
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/models.py +1 -4
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/output_schema_resolver.py +11 -1
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/worker/chord_tasks.py +2 -1
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/AUTHORS.md +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/__init__.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/api/__init__.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/api/manager.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/api/router.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/api/server.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/common.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/__init__.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/cache.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/config.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/exceptions.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/logging.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/output_protocol.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/outputs_handler.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/redis_connection.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/types.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/processes/__init__.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/processes/process_registry.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/py.typed +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/static/style.css +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/templates/landing.html +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/worker/__init__.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/worker/celery_app.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/worker/executors.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/worker/job_status.py +0 -0
- {fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/worker/pipeline.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastprocesses
|
|
3
|
-
Version: 0.22.
|
|
3
|
+
Version: 0.22.3
|
|
4
4
|
Summary: A library to create a FastAPI-based OGC API Processes wrapper around existing projects.
|
|
5
5
|
License-File: AUTHORS.md
|
|
6
6
|
Author: Stefan Schuhart
|
|
@@ -39,7 +39,7 @@ A library to create a FastAPI-based OGC API Processes wrapper around existing pr
|
|
|
39
39
|
|
|
40
40
|
AI helped to create this code.
|
|
41
41
|
|
|
42
|
-
## Version: 0.22.
|
|
42
|
+
## Version: 0.22.3
|
|
43
43
|
|
|
44
44
|
### Description
|
|
45
45
|
|
|
@@ -79,7 +79,7 @@ exclude = [
|
|
|
79
79
|
|
|
80
80
|
[tool.poetry]
|
|
81
81
|
name = "fastprocesses"
|
|
82
|
-
version = "0.22.
|
|
82
|
+
version = "0.22.3"
|
|
83
83
|
description = "A library to create a FastAPI-based OGC API Processes wrapper around existing projects."
|
|
84
84
|
authors = ["Stefan Schuhart <stefan.schuhart@gv.hamburg.de>"]
|
|
85
85
|
readme = "README.md"
|
|
@@ -470,6 +470,7 @@ class BaseParallelProcess(BaseProcess, ABC):
|
|
|
470
470
|
@abstractmethod
|
|
471
471
|
def merge_results(
|
|
472
472
|
self, results: List[Dict[str, Any]],
|
|
473
|
+
exec_body: Dict[str, Any],
|
|
473
474
|
job_progress_callback: JobProgressCallback | None = None,
|
|
474
475
|
) -> BaseProcessResult:
|
|
475
476
|
"""
|
|
@@ -479,6 +480,9 @@ class BaseParallelProcess(BaseProcess, ABC):
|
|
|
479
480
|
results: List of partial results. Each element is the ``dict``
|
|
480
481
|
produced by serialising the ``BaseModel`` returned from
|
|
481
482
|
``execute_single`` (i.e. the output of ``model.model_dump()``).
|
|
483
|
+
exec_body: The original ``exec_body`` dict passed to ``execute``.
|
|
484
|
+
Gives the merge step access to the raw inputs without requiring
|
|
485
|
+
them to be smuggled through partial results.
|
|
482
486
|
|
|
483
487
|
Returns:
|
|
484
488
|
A ``BaseProcessResult`` instance holding the final output values.
|
|
@@ -516,7 +520,7 @@ class BaseParallelProcess(BaseProcess, ABC):
|
|
|
516
520
|
return await p
|
|
517
521
|
partial = asyncio.run(_await())
|
|
518
522
|
raw_results.append(partial.model_dump(exclude_none=True))
|
|
519
|
-
return self.merge_results(raw_results)
|
|
523
|
+
return self.merge_results(raw_results, exec_body)
|
|
520
524
|
|
|
521
525
|
|
|
522
526
|
# ---------------------------------------------------------------------------
|
|
@@ -231,10 +231,7 @@ def deserialize_json(value: Any) -> Any:
|
|
|
231
231
|
|
|
232
232
|
class CalculationTask(BaseModel):
|
|
233
233
|
inputs: Annotated[Dict[str, Any], AfterValidator(deserialize_json)]
|
|
234
|
-
outputs:
|
|
235
|
-
Annotated[dict[str, OutputControl], AfterValidator(deserialize_json)]
|
|
236
|
-
| None
|
|
237
|
-
) = None
|
|
234
|
+
outputs: dict[str, OutputControl] | None = None
|
|
238
235
|
response: ResponseType = ResponseType.RAW
|
|
239
236
|
|
|
240
237
|
def _hash_dict(self):
|
{fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/core/output_schema_resolver.py
RENAMED
|
@@ -87,10 +87,20 @@ def _default_media_type(schema: Schema) -> str | None:
|
|
|
87
87
|
return preferred_media_type
|
|
88
88
|
|
|
89
89
|
# None of the preferred types matched — return whatever the schema advertises
|
|
90
|
-
|
|
90
|
+
advertised_media_type = next(
|
|
91
91
|
(media_type for media_type in candidate_media_types if media_type is not None),
|
|
92
92
|
None,
|
|
93
93
|
)
|
|
94
|
+
if advertised_media_type is not None:
|
|
95
|
+
return advertised_media_type
|
|
96
|
+
|
|
97
|
+
# OGC examples frequently describe JSON-native outputs (array/object/number
|
|
98
|
+
# etc.) without explicit contentMediaType/format hints. Treat these as
|
|
99
|
+
# application/json by default so resolver behavior matches spec examples.
|
|
100
|
+
if schema.oneOf is None:
|
|
101
|
+
return "application/json"
|
|
102
|
+
|
|
103
|
+
return None
|
|
94
104
|
|
|
95
105
|
|
|
96
106
|
def _is_binary(schema: Schema) -> bool:
|
|
@@ -185,7 +185,8 @@ def finalize_parallel(
|
|
|
185
185
|
update_job_status(
|
|
186
186
|
job_id, 95, "Merging parallel results.", JobStatusCode.RUNNING
|
|
187
187
|
)
|
|
188
|
-
|
|
188
|
+
exec_body: dict = original_input or {}
|
|
189
|
+
merge_result = process.merge_results(actual_results, exec_body)
|
|
189
190
|
merged = merge_result.model_dump(mode="json")
|
|
190
191
|
|
|
191
192
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastprocesses-0.22.2 → fastprocesses-0.22.3}/src/fastprocesses/processes/process_registry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|