psr-factory 5.0.0b2__py3-none-win_amd64.whl → 5.0.0b3__py3-none-win_amd64.whl
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.
- psr/factory/__init__.py +1 -1
- psr/factory/factory.dll +0 -0
- psr/factory/libcurl-x64.dll +0 -0
- psr/runner/runner.py +21 -21
- {psr_factory-5.0.0b2.dist-info → psr_factory-5.0.0b3.dist-info}/METADATA +3 -3
- {psr_factory-5.0.0b2.dist-info → psr_factory-5.0.0b3.dist-info}/RECORD +9 -9
- {psr_factory-5.0.0b2.dist-info → psr_factory-5.0.0b3.dist-info}/WHEEL +0 -0
- {psr_factory-5.0.0b2.dist-info → psr_factory-5.0.0b3.dist-info}/licenses/LICENSE.txt +0 -0
- {psr_factory-5.0.0b2.dist-info → psr_factory-5.0.0b3.dist-info}/top_level.txt +0 -0
psr/factory/__init__.py
CHANGED
psr/factory/factory.dll
CHANGED
Binary file
|
psr/factory/libcurl-x64.dll
CHANGED
Binary file
|
psr/runner/runner.py
CHANGED
@@ -135,8 +135,9 @@ def run_sddp(case_path: Union[str, pathlib.Path], sddp_path: Union[str, pathlib.
|
|
135
135
|
exec_mode = kwargs.get("_mode", None)
|
136
136
|
mpi_path = kwargs.get("mpi_path", __default_mpi_path)
|
137
137
|
|
138
|
+
sddp_path_full = _get_sddp_executable_parent_path(sddp_path)
|
138
139
|
# Append last / if missing.
|
139
|
-
|
140
|
+
case_path_last_slash = os.path.join(os.path.abspath(case_path), "")
|
140
141
|
|
141
142
|
mode_arg = exec_mode if exec_mode is not None else ""
|
142
143
|
# Disable parallel run in check mode.
|
@@ -144,14 +145,6 @@ def run_sddp(case_path: Union[str, pathlib.Path], sddp_path: Union[str, pathlib.
|
|
144
145
|
|
145
146
|
major, minor, patch, tag = _get_semver_version(get_sddp_version(sddp_path))
|
146
147
|
|
147
|
-
if os.name == 'nt':
|
148
|
-
if major >= 18:
|
149
|
-
sddp_path_full = os.path.join(sddp_path, r"sddp\Oper")
|
150
|
-
else:
|
151
|
-
sddp_path_full = os.path.join(sddp_path, "Oper")
|
152
|
-
|
153
|
-
else:
|
154
|
-
sddp_path_full = sddp_path
|
155
148
|
with change_cwd(sddp_path_full):
|
156
149
|
# Write MPI settings if required
|
157
150
|
if parallel_run and cluster_settings is not None:
|
@@ -160,18 +153,22 @@ def run_sddp(case_path: Union[str, pathlib.Path], sddp_path: Union[str, pathlib.
|
|
160
153
|
|
161
154
|
if parallel_run:
|
162
155
|
if os.name == 'nt':
|
163
|
-
|
156
|
+
if major <= 17:
|
157
|
+
cmd = f'sddpar.exe --path="{sddp_path_full}" --mpipath="{mpi_path}" --pathdata="{case_path_last_slash}" {extra_args}'
|
158
|
+
else:
|
159
|
+
cmd = f'sddpar.exe --path="{sddp_path_full}" --mpipath="{mpi_path}" --pathdata="{case_path}" {extra_args}'
|
164
160
|
else:
|
165
161
|
# 17.3 and before uses one type of args, newer uses another
|
166
162
|
if (major == 17 and minor <= 3) or major < 17:
|
167
|
-
cmd = f'./sddpar --path="{
|
163
|
+
cmd = f'./sddpar --path="{case_path_last_slash}" --mpipath="{mpi_path}" --habilitarhidra=1 {extra_args}'
|
168
164
|
else:
|
169
|
-
cmd = f'./sddpar --path="{sddp_path}" --mpipath="{mpi_path}" --habilitarhidra=1 --pathdata="{
|
165
|
+
cmd = f'./sddpar --path="{sddp_path}" --mpipath="{mpi_path}" --habilitarhidra=1 --pathdata="{case_path_last_slash}" {extra_args}'
|
166
|
+
|
170
167
|
else:
|
171
168
|
if os.name == 'nt':
|
172
|
-
cmd = f'sddp.exe {mode_arg} -path "{
|
169
|
+
cmd = f'sddp.exe {mode_arg} -path "{case_path_last_slash}" {extra_args}'
|
173
170
|
else:
|
174
|
-
cmd = f'./sddp {mode_arg} -path "{
|
171
|
+
cmd = f'./sddp {mode_arg} -path "{case_path_last_slash}" {extra_args}'
|
175
172
|
|
176
173
|
if os.name != "nt":
|
177
174
|
os.environ["LD_LIBRARY_PATH"] = os.path.abspath(sddp_path_full)
|
@@ -193,16 +190,19 @@ def run_sddp_convert_fcf(case_path: Union[str, pathlib.Path], sddp_path: Union[s
|
|
193
190
|
# TODO: generated file use \t as separator, has an empty column and its name depends on study stage type.
|
194
191
|
run_sddp(case_path, sddp_path, **kwargs)
|
195
192
|
|
193
|
+
def _get_sddp_executable_parent_path(sddp_path: Union[str, pathlib.Path]) -> str:
|
194
|
+
if os.name == 'nt':
|
195
|
+
model_path = os.path.join(sddp_path, "models", "sddp")
|
196
|
+
if os.path.exists(model_path):
|
197
|
+
return model_path
|
198
|
+
else:
|
199
|
+
return os.path.join(sddp_path, "Oper")
|
200
|
+
return sddp_path
|
201
|
+
|
196
202
|
|
197
203
|
def get_sddp_version(sddp_path: Union[str, pathlib.Path]) -> str:
|
198
204
|
sddp_path = str(sddp_path)
|
199
|
-
|
200
|
-
if os.name == 'nt' and "18" in sddp_path:
|
201
|
-
sddp_path_full = os.path.join(sddp_path, "sddp/Oper")
|
202
|
-
elif os.name == 'nt':
|
203
|
-
sddp_path_full = os.path.join(sddp_path, "Oper")
|
204
|
-
else:
|
205
|
-
sddp_path_full = sddp_path
|
205
|
+
sddp_path_full = _get_sddp_executable_parent_path(sddp_path)
|
206
206
|
if os.name == 'nt':
|
207
207
|
command = [os.path.join(sddp_path_full, "sddp.exe"), "ver"]
|
208
208
|
else:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: psr-factory
|
3
|
-
Version: 5.0.
|
3
|
+
Version: 5.0.0b3
|
4
4
|
Summary: PSR database management module.
|
5
5
|
Author-email: "PSR Inc." <psrfactory@psr-inc.com>
|
6
6
|
License-Expression: MIT
|
@@ -29,7 +29,7 @@ Requires-Dist: boto3
|
|
29
29
|
Requires-Dist: botocore
|
30
30
|
Dynamic: license-file
|
31
31
|
|
32
|
-
PSR Factory (version 5.0.
|
32
|
+
PSR Factory (version 5.0.0b3)
|
33
33
|
============================
|
34
34
|
|
35
35
|
Factory is a library that helps to manage SDDP cases.
|
@@ -50,7 +50,7 @@ pip install psr-factory
|
|
50
50
|
Or, if the package directly from the wheel (whl) file:
|
51
51
|
|
52
52
|
```bash
|
53
|
-
pip install psr_factory-5.0.
|
53
|
+
pip install psr_factory-5.0.0b3-py3-none-win_amd64.whl
|
54
54
|
```
|
55
55
|
|
56
56
|
Factory will be available to all Python scripts in your system after importing it:
|
@@ -11,13 +11,13 @@ psr/cloud/status.py,sha256=vcI4B9S6wCt9maT5NNrVwYaEgGIvy6kkC1UVpJjYbtw,3607
|
|
11
11
|
psr/cloud/tempfile.py,sha256=1IOeye0eKWnmBynK5K5FMWiTaEVhn4GbQ8_y0THEva0,3893
|
12
12
|
psr/cloud/version.py,sha256=Wxm5oXHAe8U9QoQpN5WIlzAhFR9bGfvIITFeq8QPBLw,192
|
13
13
|
psr/cloud/xml.py,sha256=ac2lyflOQm8khPvJn0zmI26I4sfUDY6A_OTsxzbMQEs,1896
|
14
|
-
psr/factory/__init__.py,sha256=
|
14
|
+
psr/factory/__init__.py,sha256=0EluoySuofSZkEjHf7CXkaG8L2UefWn50Jo3OeoYRMs,218
|
15
15
|
psr/factory/api.py,sha256=N5153ZJmZjzLQ0AvRZnSlTu6UmHBQqbYw0UQ69sZHkE,98705
|
16
|
-
psr/factory/factory.dll,sha256
|
16
|
+
psr/factory/factory.dll,sha256=-lr-yNzGhobUYO04IgzKhNihcBKh8qc6-5F9GY8ak-Y,18232656
|
17
17
|
psr/factory/factory.pmd,sha256=gZnS1mnb1iA1XtNA1JfALM9rKdFLFBbwAJHF2_PxKAk,243405
|
18
18
|
psr/factory/factory.pmk,sha256=3xDhU0fpUz6dSn29E8GkXEmCOSadnq7cJPcNPbEyFfI,579203
|
19
19
|
psr/factory/factorylib.py,sha256=xnhCFTo4DpU0e5oHtIWMmc-kk6ThtNAUI3cxpDXrBKE,27497
|
20
|
-
psr/factory/libcurl-x64.dll,sha256
|
20
|
+
psr/factory/libcurl-x64.dll,sha256=Bx50eR62eK_p8DMmNlfV_mNNfxmEn5n6v78wOCPWGv8,5317968
|
21
21
|
psr/factory/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
psr/factory/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
psr/factory/samples/sddp_case01.py,sha256=jo71p9NN7dtRqMT76TEbD4S4Lut7p4ejbpu6SoSwg0Y,5034
|
@@ -28,10 +28,10 @@ psr/psrfcommon/__init__.py,sha256=WXR560XQllIjtFpWd0jiJEbUAQIyh5-6lwj-42_J95c,20
|
|
28
28
|
psr/psrfcommon/psrfcommon.py,sha256=NABM5ahvyfSizDC9c0Vu9dVK1pD_vOzIGFHL1oz2E1o,1464
|
29
29
|
psr/psrfcommon/tempfile.py,sha256=5S13wa2DCLYTUdwbLm_KMBRnDRJ0WDlu8GO2BmZoNdg,3939
|
30
30
|
psr/runner/__init__.py,sha256=kI9HDX-B_LMQJUHHylFHas2rNpWfNNa0pZXoIvX_Alw,230
|
31
|
-
psr/runner/runner.py,sha256=
|
31
|
+
psr/runner/runner.py,sha256=xUHGAyw2iCClcpIrmhAadBBsHVwt9ebc4oa0M4uQu8s,26806
|
32
32
|
psr/runner/version.py,sha256=mch2Y8anSXGMn9w72Z78PhSRhOyn55EwaoLAYhY4McE,194
|
33
|
-
psr_factory-5.0.
|
34
|
-
psr_factory-5.0.
|
35
|
-
psr_factory-5.0.
|
36
|
-
psr_factory-5.0.
|
37
|
-
psr_factory-5.0.
|
33
|
+
psr_factory-5.0.0b3.dist-info/licenses/LICENSE.txt,sha256=N6mqZK2Ft3iXGHj-by_MHC_dJo9qwn0URjakEPys3H4,1089
|
34
|
+
psr_factory-5.0.0b3.dist-info/METADATA,sha256=j3kfosSsVtO3PigpS0ofDzsRqfWPT25py0cCQspSMBE,2542
|
35
|
+
psr_factory-5.0.0b3.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
|
36
|
+
psr_factory-5.0.0b3.dist-info/top_level.txt,sha256=Jb393O96WQk3b5D1gMcrZBLKJJgZpzNjTPoldUi00ck,4
|
37
|
+
psr_factory-5.0.0b3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|