PyGeoModel 1.0.9__tar.gz → 1.0.11__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.
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/PKG-INFO +14 -10
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/PyGeoModel.egg-info/PKG-INFO +14 -10
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/README.md +13 -9
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/__init__.py +1 -1
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/models.py +8 -2
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/results.py +5 -20
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/setup.py +1 -1
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/tests/test_core_api.py +4 -3
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/LICENSE +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/MANIFEST.in +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/PyGeoModel.egg-info/SOURCES.txt +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/PyGeoModel.egg-info/dependency_links.txt +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/PyGeoModel.egg-info/requires.txt +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/PyGeoModel.egg-info/top_level.txt +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/__init__.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/base.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/constants.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openModel.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openUtils/__init__.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openUtils/exceptions.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openUtils/http_client.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openUtils/mdlUtils.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openUtils/parameterValidator.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/ogmsServer2/openUtils/stateManager.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/client.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/config.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/consensus.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/context.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/data/__init__.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/data/computeModel.json +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/data/modelContext.txt +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/modeler.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/notebook.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/qa.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/pygeomodel/recommendation.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/scripts.py +0 -0
- {pygeomodel-1.0.9 → pygeomodel-1.0.11}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyGeoModel
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.11
|
|
4
4
|
Summary: A Python package for integrating OpenGMS geographic model services.
|
|
5
5
|
Home-page: https://github.com/MpLebron/PyGeoModel
|
|
6
6
|
Author: Peilong Ma
|
|
@@ -45,7 +45,7 @@ Dynamic: summary
|
|
|
45
45
|
|
|
46
46
|
# PyGeoModel
|
|
47
47
|
|
|
48
|
-
PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation,
|
|
48
|
+
PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation, and result management. For exploratory notebook-based analysis, PyGeoModel also provides an optional Jupyter interface built on the same core API.
|
|
49
49
|
|
|
50
50
|
## Installation
|
|
51
51
|
|
|
@@ -81,23 +81,25 @@ result = modeler.invoke(
|
|
|
81
81
|
"Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
|
|
82
82
|
params={
|
|
83
83
|
"system_efficiency": 0.8,
|
|
84
|
-
"start_time":
|
|
85
|
-
"end_time":
|
|
84
|
+
"start_time": "2018-01",
|
|
85
|
+
"end_time": "2018-12",
|
|
86
86
|
"roof_vector_path": "data/rooftops.zip",
|
|
87
87
|
},
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
result.
|
|
90
|
+
saved_files = result.save(output_dir="data/result/live_run")
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
The model configuration is recorded directly in the Python cell through the explicit `params` dictionary, while `TaskResult.save()` stores the downloadable model outputs for subsequent analysis.
|
|
94
|
+
|
|
93
95
|
## Notebook Interface
|
|
94
96
|
|
|
95
97
|
```python
|
|
96
98
|
modeler.show_models()
|
|
97
|
-
modeler.invoke_model("
|
|
99
|
+
modeler.invoke_model("Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model")
|
|
98
100
|
```
|
|
99
101
|
|
|
100
|
-
The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same `search_models()`, `get_model()`, and `invoke()` functions as the programmatic API so GUI operations can be converted into Python
|
|
102
|
+
The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same `search_models()`, `get_model()`, and `invoke()` functions as the programmatic API so GUI operations can be converted into explicit Python parameters and saved model outputs when needed.
|
|
101
103
|
|
|
102
104
|
## Recommendation and Q&A Records
|
|
103
105
|
|
|
@@ -105,12 +107,14 @@ The notebook interface renders model search, metadata inspection, parameter entr
|
|
|
105
107
|
recommendation = modeler.suggest_model(return_result=True)
|
|
106
108
|
recommendation.to_json("recommendation_record.json")
|
|
107
109
|
|
|
108
|
-
answer = modeler.ask_model(
|
|
109
|
-
|
|
110
|
+
answer = modeler.ask_model(
|
|
111
|
+
"Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
|
|
112
|
+
"What input data are required?",
|
|
113
|
+
)
|
|
110
114
|
```
|
|
111
115
|
|
|
112
116
|
The recommendation service automatically builds notebook/data context and calls the configured recommendation workflow. Q&A uses OpenGMS model metadata and an OpenAI-compatible web-enabled model. The main notebook workflow is designed to run out of the box for demonstration use.
|
|
113
117
|
|
|
114
118
|
## Relation to OpenGMS
|
|
115
119
|
|
|
116
|
-
OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result
|
|
120
|
+
OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result management to Python and notebook workflows.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyGeoModel
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.11
|
|
4
4
|
Summary: A Python package for integrating OpenGMS geographic model services.
|
|
5
5
|
Home-page: https://github.com/MpLebron/PyGeoModel
|
|
6
6
|
Author: Peilong Ma
|
|
@@ -45,7 +45,7 @@ Dynamic: summary
|
|
|
45
45
|
|
|
46
46
|
# PyGeoModel
|
|
47
47
|
|
|
48
|
-
PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation,
|
|
48
|
+
PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation, and result management. For exploratory notebook-based analysis, PyGeoModel also provides an optional Jupyter interface built on the same core API.
|
|
49
49
|
|
|
50
50
|
## Installation
|
|
51
51
|
|
|
@@ -81,23 +81,25 @@ result = modeler.invoke(
|
|
|
81
81
|
"Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
|
|
82
82
|
params={
|
|
83
83
|
"system_efficiency": 0.8,
|
|
84
|
-
"start_time":
|
|
85
|
-
"end_time":
|
|
84
|
+
"start_time": "2018-01",
|
|
85
|
+
"end_time": "2018-12",
|
|
86
86
|
"roof_vector_path": "data/rooftops.zip",
|
|
87
87
|
},
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
result.
|
|
90
|
+
saved_files = result.save(output_dir="data/result/live_run")
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
The model configuration is recorded directly in the Python cell through the explicit `params` dictionary, while `TaskResult.save()` stores the downloadable model outputs for subsequent analysis.
|
|
94
|
+
|
|
93
95
|
## Notebook Interface
|
|
94
96
|
|
|
95
97
|
```python
|
|
96
98
|
modeler.show_models()
|
|
97
|
-
modeler.invoke_model("
|
|
99
|
+
modeler.invoke_model("Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model")
|
|
98
100
|
```
|
|
99
101
|
|
|
100
|
-
The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same `search_models()`, `get_model()`, and `invoke()` functions as the programmatic API so GUI operations can be converted into Python
|
|
102
|
+
The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same `search_models()`, `get_model()`, and `invoke()` functions as the programmatic API so GUI operations can be converted into explicit Python parameters and saved model outputs when needed.
|
|
101
103
|
|
|
102
104
|
## Recommendation and Q&A Records
|
|
103
105
|
|
|
@@ -105,12 +107,14 @@ The notebook interface renders model search, metadata inspection, parameter entr
|
|
|
105
107
|
recommendation = modeler.suggest_model(return_result=True)
|
|
106
108
|
recommendation.to_json("recommendation_record.json")
|
|
107
109
|
|
|
108
|
-
answer = modeler.ask_model(
|
|
109
|
-
|
|
110
|
+
answer = modeler.ask_model(
|
|
111
|
+
"Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
|
|
112
|
+
"What input data are required?",
|
|
113
|
+
)
|
|
110
114
|
```
|
|
111
115
|
|
|
112
116
|
The recommendation service automatically builds notebook/data context and calls the configured recommendation workflow. Q&A uses OpenGMS model metadata and an OpenAI-compatible web-enabled model. The main notebook workflow is designed to run out of the box for demonstration use.
|
|
113
117
|
|
|
114
118
|
## Relation to OpenGMS
|
|
115
119
|
|
|
116
|
-
OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result
|
|
120
|
+
OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result management to Python and notebook workflows.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PyGeoModel
|
|
2
2
|
|
|
3
|
-
PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation,
|
|
3
|
+
PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation, and result management. For exploratory notebook-based analysis, PyGeoModel also provides an optional Jupyter interface built on the same core API.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -36,23 +36,25 @@ result = modeler.invoke(
|
|
|
36
36
|
"Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
|
|
37
37
|
params={
|
|
38
38
|
"system_efficiency": 0.8,
|
|
39
|
-
"start_time":
|
|
40
|
-
"end_time":
|
|
39
|
+
"start_time": "2018-01",
|
|
40
|
+
"end_time": "2018-12",
|
|
41
41
|
"roof_vector_path": "data/rooftops.zip",
|
|
42
42
|
},
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
result.
|
|
45
|
+
saved_files = result.save(output_dir="data/result/live_run")
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
The model configuration is recorded directly in the Python cell through the explicit `params` dictionary, while `TaskResult.save()` stores the downloadable model outputs for subsequent analysis.
|
|
49
|
+
|
|
48
50
|
## Notebook Interface
|
|
49
51
|
|
|
50
52
|
```python
|
|
51
53
|
modeler.show_models()
|
|
52
|
-
modeler.invoke_model("
|
|
54
|
+
modeler.invoke_model("Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model")
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same `search_models()`, `get_model()`, and `invoke()` functions as the programmatic API so GUI operations can be converted into Python
|
|
57
|
+
The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same `search_models()`, `get_model()`, and `invoke()` functions as the programmatic API so GUI operations can be converted into explicit Python parameters and saved model outputs when needed.
|
|
56
58
|
|
|
57
59
|
## Recommendation and Q&A Records
|
|
58
60
|
|
|
@@ -60,12 +62,14 @@ The notebook interface renders model search, metadata inspection, parameter entr
|
|
|
60
62
|
recommendation = modeler.suggest_model(return_result=True)
|
|
61
63
|
recommendation.to_json("recommendation_record.json")
|
|
62
64
|
|
|
63
|
-
answer = modeler.ask_model(
|
|
64
|
-
|
|
65
|
+
answer = modeler.ask_model(
|
|
66
|
+
"Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
|
|
67
|
+
"What input data are required?",
|
|
68
|
+
)
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
The recommendation service automatically builds notebook/data context and calls the configured recommendation workflow. Q&A uses OpenGMS model metadata and an OpenAI-compatible web-enabled model. The main notebook workflow is designed to run out of the box for demonstration use.
|
|
68
72
|
|
|
69
73
|
## Relation to OpenGMS
|
|
70
74
|
|
|
71
|
-
OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result
|
|
75
|
+
OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result management to Python and notebook workflows.
|
|
@@ -201,9 +201,15 @@ class ModelService:
|
|
|
201
201
|
return str(value)
|
|
202
202
|
dtype = (item.data_type or "").upper()
|
|
203
203
|
if dtype in {"REAL", "DOUBLE", "FLOAT"}:
|
|
204
|
-
|
|
204
|
+
try:
|
|
205
|
+
return float(value)
|
|
206
|
+
except (TypeError, ValueError):
|
|
207
|
+
return value
|
|
205
208
|
if dtype in {"INT", "INTEGER"}:
|
|
206
|
-
|
|
209
|
+
try:
|
|
210
|
+
return int(value)
|
|
211
|
+
except (TypeError, ValueError):
|
|
212
|
+
return value
|
|
207
213
|
if dtype in {"BOOL", "BOOLEAN"}:
|
|
208
214
|
if isinstance(value, str):
|
|
209
215
|
return value.strip().lower() in {"true", "1", "yes", "y"}
|
|
@@ -30,7 +30,7 @@ class TaskResult:
|
|
|
30
30
|
params: dict[str, Any] = field(default_factory=dict)
|
|
31
31
|
uploaded_inputs: dict[str, Any] = field(default_factory=dict)
|
|
32
32
|
endpoint: str | None = None
|
|
33
|
-
pygeomodel_version: str = "1.0.
|
|
33
|
+
pygeomodel_version: str = "1.0.10"
|
|
34
34
|
execution_time: float | None = None
|
|
35
35
|
record_path: str | None = None
|
|
36
36
|
created_at: float = field(default_factory=time.time)
|
|
@@ -52,12 +52,12 @@ class TaskResult:
|
|
|
52
52
|
self,
|
|
53
53
|
output_dir: str | Path | None = None,
|
|
54
54
|
record_path: str | Path | None = None,
|
|
55
|
-
) ->
|
|
55
|
+
) -> list[str]:
|
|
56
56
|
if output_dir is not None:
|
|
57
57
|
self.download(output_dir)
|
|
58
58
|
if record_path is not None:
|
|
59
59
|
self.to_json(record_path)
|
|
60
|
-
return self
|
|
60
|
+
return self.downloaded_outputs
|
|
61
61
|
|
|
62
62
|
def _repr_markdown_(self) -> str:
|
|
63
63
|
return f"Model run: {self.model_name}\n\nStatus: {self.status}\n\nTask ID: {self.task_id or 'Not returned'}"
|
|
@@ -583,20 +583,6 @@ def _recommendation_to_html(result: RecommendationResult) -> str:
|
|
|
583
583
|
line-height: 1.4;
|
|
584
584
|
white-space: nowrap;
|
|
585
585
|
}}
|
|
586
|
-
.pygeomodel-rec-badge {{
|
|
587
|
-
display: inline-block;
|
|
588
|
-
margin-top: 6px;
|
|
589
|
-
border-radius: 999px;
|
|
590
|
-
border: 1px solid #bfdbfe;
|
|
591
|
-
background: #dbeafe;
|
|
592
|
-
color: #1d4ed8;
|
|
593
|
-
padding: 2px 7px;
|
|
594
|
-
font-size: 11px;
|
|
595
|
-
font-weight: 700;
|
|
596
|
-
line-height: 1.4;
|
|
597
|
-
text-transform: none;
|
|
598
|
-
letter-spacing: 0;
|
|
599
|
-
}}
|
|
600
586
|
.pygeomodel-rec-name {{
|
|
601
587
|
color: #0f172a;
|
|
602
588
|
font-size: 13px;
|
|
@@ -704,13 +690,12 @@ def _recommendation_candidate_row(candidate: dict[str, Any]) -> str:
|
|
|
704
690
|
rank = html.escape(str(candidate.get("rank") or ""))
|
|
705
691
|
is_primary = bool(candidate.get("is_primary"))
|
|
706
692
|
primary_class = " primary" if is_primary else ""
|
|
707
|
-
|
|
693
|
+
rank_label = f"★ Rank {rank}" if is_primary else f"Rank {rank}"
|
|
708
694
|
|
|
709
695
|
return f"""
|
|
710
696
|
<div class="pygeomodel-rec-row{primary_class}">
|
|
711
697
|
<div class="pygeomodel-rec-rank">
|
|
712
|
-
|
|
713
|
-
{badge}
|
|
698
|
+
{rank_label}
|
|
714
699
|
</div>
|
|
715
700
|
<div>
|
|
716
701
|
<div class="pygeomodel-rec-name">{name}</div>
|
|
@@ -356,7 +356,7 @@ class CoreApiTests(unittest.TestCase):
|
|
|
356
356
|
finally:
|
|
357
357
|
client_module.download_output_files = original_downloader
|
|
358
358
|
|
|
359
|
-
self.
|
|
359
|
+
self.assertEqual(returned, [str(tmpdir / "outputs" / "SolarCalculation-roofSloar.zip")])
|
|
360
360
|
self.assertEqual(
|
|
361
361
|
result.downloaded_outputs,
|
|
362
362
|
[str(tmpdir / "outputs" / "SolarCalculation-roofSloar.zip")],
|
|
@@ -389,7 +389,7 @@ class CoreApiTests(unittest.TestCase):
|
|
|
389
389
|
finally:
|
|
390
390
|
client_module.download_output_files = original_downloader
|
|
391
391
|
|
|
392
|
-
self.
|
|
392
|
+
self.assertEqual(returned, [str(tmpdir / "outputs" / "SolarCalculation-roofSloar.zip")])
|
|
393
393
|
self.assertEqual(
|
|
394
394
|
result.downloaded_outputs,
|
|
395
395
|
[str(tmpdir / "outputs" / "SolarCalculation-roofSloar.zip")],
|
|
@@ -540,7 +540,8 @@ class CoreApiTests(unittest.TestCase):
|
|
|
540
540
|
|
|
541
541
|
html = result._repr_html_()
|
|
542
542
|
|
|
543
|
-
self.assertIn("
|
|
543
|
+
self.assertIn("★ Rank 1", html)
|
|
544
|
+
self.assertNotIn("Recommended</span>", html)
|
|
544
545
|
self.assertIn("Solar Potential Analysis Model", html)
|
|
545
546
|
self.assertIn("Rooftop Suitability Model", html)
|
|
546
547
|
self.assertIn("Relevant Data", html)
|
|
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
|
|
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
|