PyGeoModel 1.0.5__tar.gz → 1.0.6__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.5 → pygeomodel-1.0.6}/PKG-INFO +2 -2
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/PyGeoModel.egg-info/PKG-INFO +2 -2
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/README.md +1 -1
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/__init__.py +1 -1
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/config.py +4 -1
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/results.py +1 -1
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/setup.py +1 -1
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/tests/test_core_api.py +26 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/LICENSE +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/MANIFEST.in +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/PyGeoModel.egg-info/SOURCES.txt +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/PyGeoModel.egg-info/dependency_links.txt +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/PyGeoModel.egg-info/requires.txt +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/PyGeoModel.egg-info/top_level.txt +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/__init__.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/base.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/constants.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openModel.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openUtils/__init__.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openUtils/exceptions.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openUtils/http_client.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openUtils/mdlUtils.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openUtils/parameterValidator.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/ogmsServer2/openUtils/stateManager.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/client.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/consensus.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/context.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/data/__init__.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/data/computeModel.json +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/data/modelContext.txt +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/modeler.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/models.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/notebook.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/qa.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/pygeomodel/recommendation.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/scripts.py +0 -0
- {pygeomodel-1.0.5 → pygeomodel-1.0.6}/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.6
|
|
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
|
|
@@ -91,7 +91,7 @@ result = modeler.invoke(
|
|
|
91
91
|
result.to_json("execution_record.json")
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
OpenGMS execution
|
|
94
|
+
OpenGMS execution uses the bundled public demo token by default. For stable or private use, configure your own OpenGMS token:
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
export OGMS_TOKEN="your-token"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyGeoModel
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.6
|
|
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
|
|
@@ -91,7 +91,7 @@ result = modeler.invoke(
|
|
|
91
91
|
result.to_json("execution_record.json")
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
OpenGMS execution
|
|
94
|
+
OpenGMS execution uses the bundled public demo token by default. For stable or private use, configure your own OpenGMS token:
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
export OGMS_TOKEN="your-token"
|
|
@@ -45,7 +45,7 @@ result = modeler.invoke(
|
|
|
45
45
|
result.to_json("execution_record.json")
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
OpenGMS execution
|
|
48
|
+
OpenGMS execution uses the bundled public demo token by default. For stable or private use, configure your own OpenGMS token:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
export OGMS_TOKEN="your-token"
|
|
@@ -8,6 +8,9 @@ from dataclasses import dataclass
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
PUBLIC_DEMO_OGMS_TOKEN = '6U3O1Sy5696I5ryJFaYCYVjcIV7rhd1MKK0QGX9A7zafogi8xTdvejl6ISUP1lEs'
|
|
12
|
+
|
|
13
|
+
|
|
11
14
|
@dataclass(frozen=True)
|
|
12
15
|
class OpenGMSConfig:
|
|
13
16
|
token: str | None = None
|
|
@@ -31,7 +34,7 @@ def get_opengms_config() -> OpenGMSConfig:
|
|
|
31
34
|
local = _load_local_api_keys()
|
|
32
35
|
opengms = local.get("opengms", {})
|
|
33
36
|
return OpenGMSConfig(
|
|
34
|
-
token=os.environ.get("OGMS_TOKEN") or opengms.get("token") or opengms.get("api_key"),
|
|
37
|
+
token=os.environ.get("OGMS_TOKEN") or opengms.get("token") or opengms.get("api_key") or PUBLIC_DEMO_OGMS_TOKEN,
|
|
35
38
|
portal_url=os.environ.get("OGMS_BASE_PORTAL_URL", opengms.get("portal_url", OpenGMSConfig.portal_url)),
|
|
36
39
|
manager_url=os.environ.get("OGMS_BASE_MANAGER_URL", opengms.get("manager_url", OpenGMSConfig.manager_url)),
|
|
37
40
|
data_url=os.environ.get("OGMS_BASE_DATA_URL", opengms.get("data_url", OpenGMSConfig.data_url)),
|
|
@@ -29,7 +29,7 @@ class TaskResult:
|
|
|
29
29
|
params: dict[str, Any] = field(default_factory=dict)
|
|
30
30
|
uploaded_inputs: dict[str, Any] = field(default_factory=dict)
|
|
31
31
|
endpoint: str | None = None
|
|
32
|
-
pygeomodel_version: str = "1.0.
|
|
32
|
+
pygeomodel_version: str = "1.0.6"
|
|
33
33
|
execution_time: float | None = None
|
|
34
34
|
created_at: float = field(default_factory=time.time)
|
|
35
35
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
2
3
|
import tempfile
|
|
3
4
|
import unittest
|
|
4
5
|
from pathlib import Path
|
|
@@ -297,6 +298,31 @@ class CoreApiTests(unittest.TestCase):
|
|
|
297
298
|
qa_path = qa.to_json(tmpdir / "qa.json")
|
|
298
299
|
self.assertEqual(json.loads(Path(qa_path).read_text())["answer"], "a")
|
|
299
300
|
|
|
301
|
+
def test_opengms_config_uses_public_demo_token_as_fallback(self):
|
|
302
|
+
import pygeomodel.config as config_module
|
|
303
|
+
|
|
304
|
+
original_loader = config_module._load_local_api_keys
|
|
305
|
+
original_env = os.environ.get("OGMS_TOKEN")
|
|
306
|
+
try:
|
|
307
|
+
config_module._load_local_api_keys = lambda: {}
|
|
308
|
+
os.environ.pop("OGMS_TOKEN", None)
|
|
309
|
+
self.assertEqual(
|
|
310
|
+
config_module.get_opengms_config().token,
|
|
311
|
+
config_module.PUBLIC_DEMO_OGMS_TOKEN,
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
config_module._load_local_api_keys = lambda: {"opengms": {"token": "local-token"}}
|
|
315
|
+
self.assertEqual(config_module.get_opengms_config().token, "local-token")
|
|
316
|
+
|
|
317
|
+
os.environ["OGMS_TOKEN"] = "env-token"
|
|
318
|
+
self.assertEqual(config_module.get_opengms_config().token, "env-token")
|
|
319
|
+
finally:
|
|
320
|
+
config_module._load_local_api_keys = original_loader
|
|
321
|
+
if original_env is None:
|
|
322
|
+
os.environ.pop("OGMS_TOKEN", None)
|
|
323
|
+
else:
|
|
324
|
+
os.environ["OGMS_TOKEN"] = original_env
|
|
325
|
+
|
|
300
326
|
def test_recommendation_result_has_notebook_rich_display(self):
|
|
301
327
|
from pygeomodel import RecommendationResult
|
|
302
328
|
|
|
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
|