PyGeoModel 1.0.12__tar.gz → 1.0.14__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.12 → pygeomodel-1.0.14}/MANIFEST.in +1 -1
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/PKG-INFO +1 -1
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/PyGeoModel.egg-info/PKG-INFO +1 -1
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/PyGeoModel.egg-info/SOURCES.txt +2 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/__init__.py +1 -1
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/client.py +23 -1
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/config.py +7 -7
- pygeomodel-1.0.14/pygeomodel/data/description_translations_en.json +5228 -0
- pygeomodel-1.0.14/pygeomodel/data/modellist_2070.csv +2072 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/modeler.py +115 -5
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/models.py +20 -3
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/notebook.py +33 -15
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/results.py +1 -1
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/setup.py +2 -2
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/tests/test_core_api.py +164 -7
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/LICENSE +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/PyGeoModel.egg-info/dependency_links.txt +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/PyGeoModel.egg-info/requires.txt +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/PyGeoModel.egg-info/top_level.txt +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/README.md +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/__init__.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/base.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/constants.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openModel.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openUtils/__init__.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openUtils/exceptions.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openUtils/http_client.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openUtils/mdlUtils.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openUtils/parameterValidator.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/ogmsServer2/openUtils/stateManager.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/consensus.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/context.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/data/__init__.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/data/computeModel.json +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/data/modelContext.txt +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/qa.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/pygeomodel/recommendation.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/scripts.py +0 -0
- {pygeomodel-1.0.12 → pygeomodel-1.0.14}/setup.cfg +0 -0
|
@@ -31,5 +31,7 @@ pygeomodel/recommendation.py
|
|
|
31
31
|
pygeomodel/results.py
|
|
32
32
|
pygeomodel/data/__init__.py
|
|
33
33
|
pygeomodel/data/computeModel.json
|
|
34
|
+
pygeomodel/data/description_translations_en.json
|
|
34
35
|
pygeomodel/data/modelContext.txt
|
|
36
|
+
pygeomodel/data/modellist_2070.csv
|
|
35
37
|
tests/test_core_api.py
|
|
@@ -5,13 +5,18 @@ from __future__ import annotations
|
|
|
5
5
|
import time
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from typing import Any
|
|
8
|
-
from urllib.parse import quote
|
|
8
|
+
from urllib.parse import quote, urlparse, urlunparse
|
|
9
9
|
|
|
10
10
|
import requests
|
|
11
11
|
|
|
12
12
|
from .config import OpenGMSConfig, get_opengms_config
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
PUBLIC_DATA_DOWNLOAD_HOST = "geomodeling.njnu.edu.cn"
|
|
16
|
+
PUBLIC_DATA_DOWNLOAD_PREFIX = "/dataTransferServer"
|
|
17
|
+
INTERNAL_DATA_DOWNLOAD_HOSTS = {"221.224.35.86:38083"}
|
|
18
|
+
|
|
19
|
+
|
|
15
20
|
class OpenGMSClient:
|
|
16
21
|
"""Thin client around OpenGMS model-service endpoints."""
|
|
17
22
|
|
|
@@ -105,6 +110,7 @@ def download_output_files(outputs: list[dict[str, Any]], output_dir: str | Path)
|
|
|
105
110
|
url = output.get("url")
|
|
106
111
|
if not url:
|
|
107
112
|
continue
|
|
113
|
+
url = normalize_download_url(url)
|
|
108
114
|
suffix = output.get("suffix") or "dat"
|
|
109
115
|
tag = output.get("tag") or output.get("event") or f"output_{index + 1}"
|
|
110
116
|
target = output_path / f"{tag}.{suffix}"
|
|
@@ -113,3 +119,19 @@ def download_output_files(outputs: list[dict[str, Any]], output_dir: str | Path)
|
|
|
113
119
|
target.write_bytes(response.content)
|
|
114
120
|
downloaded.append(str(target))
|
|
115
121
|
return downloaded
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def normalize_download_url(url: str) -> str:
|
|
125
|
+
parsed = urlparse(url)
|
|
126
|
+
if parsed.netloc in INTERNAL_DATA_DOWNLOAD_HOSTS and parsed.path.startswith("/data/"):
|
|
127
|
+
return urlunparse(
|
|
128
|
+
(
|
|
129
|
+
"https",
|
|
130
|
+
PUBLIC_DATA_DOWNLOAD_HOST,
|
|
131
|
+
f"{PUBLIC_DATA_DOWNLOAD_PREFIX}{parsed.path}",
|
|
132
|
+
"",
|
|
133
|
+
parsed.query,
|
|
134
|
+
parsed.fragment,
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
return url
|
|
@@ -52,13 +52,13 @@ def get_llm_config() -> LLMConfig:
|
|
|
52
52
|
dify = local.get("dify", {})
|
|
53
53
|
consensus = local.get("consensus", {})
|
|
54
54
|
return LLMConfig(
|
|
55
|
-
openai_api_key=os.environ.get("
|
|
56
|
-
openai_base_url=os.environ.get("
|
|
57
|
-
openai_model=os.environ.get("
|
|
58
|
-
dify_api_key=os.environ.get("
|
|
59
|
-
dify_base_url=os.environ.get("
|
|
60
|
-
consensus_api_key=consensus.get("api_key") or os.environ.get("
|
|
61
|
-
consensus_base_url=consensus.get("base_url") or os.environ.get("
|
|
55
|
+
openai_api_key=os.environ.get("PYGEOMODEL_OPENAI_API_KEY") or openai.get("api_key") or PUBLIC_DEMO_OPENAI_API_KEY,
|
|
56
|
+
openai_base_url=os.environ.get("PYGEOMODEL_OPENAI_BASE_URL") or openai.get("base_url") or PUBLIC_DEMO_OPENAI_BASE_URL,
|
|
57
|
+
openai_model=os.environ.get("PYGEOMODEL_OPENAI_MODEL") or openai.get("model") or PUBLIC_DEMO_OPENAI_MODEL,
|
|
58
|
+
dify_api_key=os.environ.get("PYGEOMODEL_DIFY_API_KEY") or dify.get("api_key") or PUBLIC_DEMO_DIFY_API_KEY,
|
|
59
|
+
dify_base_url=os.environ.get("PYGEOMODEL_DIFY_BASE_URL") or dify.get("base_url") or PUBLIC_DEMO_DIFY_BASE_URL,
|
|
60
|
+
consensus_api_key=consensus.get("api_key") or os.environ.get("PYGEOMODEL_CONSENSUS_API_KEY"),
|
|
61
|
+
consensus_base_url=consensus.get("base_url") or os.environ.get("PYGEOMODEL_CONSENSUS_BASE_URL") or LLMConfig.consensus_base_url,
|
|
62
62
|
)
|
|
63
63
|
|
|
64
64
|
|