psr-factory 5.0.0b2__py3-none-win_amd64.whl → 5.0.0b4__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 CHANGED
@@ -2,6 +2,6 @@
2
2
  # Unauthorized copying of this file, via any medium is strictly prohibited
3
3
  # Proprietary and confidential
4
4
 
5
- __version__ = "5.0.0b2"
5
+ __version__ = "5.0.0b4"
6
6
 
7
7
  from .api import *
psr/factory/factory.dll CHANGED
Binary file
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
- case_path = os.path.join(os.path.abspath(case_path), "")
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,34 +145,33 @@ 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:
158
- mpi_file_path = os.path.join(sddp_path_full, "mpd.hosts")
151
+ if major >= 18:
152
+ mpi_file_path = os.path.join(sddp_path_full, "mpd_sddp.hosts")
153
+ else:
154
+ mpi_file_path = os.path.join(sddp_path_full, "mpd.hosts")
159
155
  _write_mpi_settings(mpi_file_path, cluster_settings)
160
156
 
161
157
  if parallel_run:
162
158
  if os.name == 'nt':
163
- cmd = f'sddpar.exe --path="{sddp_path_full}" --mpipath="{mpi_path}" --pathdata="{case_path}" {extra_args}'
159
+ if major <= 17:
160
+ cmd = f'sddpar.exe --path="{sddp_path_full}" --mpipath="{mpi_path}" --pathdata="{case_path_last_slash}" {extra_args}'
161
+ else:
162
+ cmd = f'sddpar.exe --path="{sddp_path_full}" --mpipath="{mpi_path}" --pathdata="{case_path}" {extra_args}'
164
163
  else:
165
164
  # 17.3 and before uses one type of args, newer uses another
166
165
  if (major == 17 and minor <= 3) or major < 17:
167
- cmd = f'./sddpar --path="{case_path}" --mpipath="{mpi_path}" --habilitarhidra=1 {extra_args}'
166
+ cmd = f'./sddpar --path="{case_path_last_slash}" --mpipath="{mpi_path}" --habilitarhidra=1 {extra_args}'
168
167
  else:
169
- cmd = f'./sddpar --path="{sddp_path}" --mpipath="{mpi_path}" --habilitarhidra=1 --pathdata="{case_path}" {extra_args}'
168
+ cmd = f'./sddpar --path="{sddp_path}" --mpipath="{mpi_path}" --habilitarhidra=1 --pathdata="{case_path_last_slash}" {extra_args}'
169
+
170
170
  else:
171
171
  if os.name == 'nt':
172
- cmd = f'sddp.exe {mode_arg} -path "{case_path}" {extra_args}'
172
+ cmd = f'sddp.exe {mode_arg} -path "{case_path_last_slash}" {extra_args}'
173
173
  else:
174
- cmd = f'./sddp {mode_arg} -path "{case_path}" {extra_args}'
174
+ cmd = f'./sddp {mode_arg} -path "{case_path_last_slash}" {extra_args}'
175
175
 
176
176
  if os.name != "nt":
177
177
  os.environ["LD_LIBRARY_PATH"] = os.path.abspath(sddp_path_full)
@@ -193,16 +193,19 @@ def run_sddp_convert_fcf(case_path: Union[str, pathlib.Path], sddp_path: Union[s
193
193
  # TODO: generated file use \t as separator, has an empty column and its name depends on study stage type.
194
194
  run_sddp(case_path, sddp_path, **kwargs)
195
195
 
196
+ def _get_sddp_executable_parent_path(sddp_path: Union[str, pathlib.Path]) -> str:
197
+ if os.name == 'nt':
198
+ model_path = os.path.join(sddp_path, "models", "sddp")
199
+ if os.path.exists(model_path):
200
+ return model_path
201
+ else:
202
+ return os.path.join(sddp_path, "Oper")
203
+ return sddp_path
204
+
196
205
 
197
206
  def get_sddp_version(sddp_path: Union[str, pathlib.Path]) -> str:
198
207
  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
208
+ sddp_path_full = _get_sddp_executable_parent_path(sddp_path)
206
209
  if os.name == 'nt':
207
210
  command = [os.path.join(sddp_path_full, "sddp.exe"), "ver"]
208
211
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: psr-factory
3
- Version: 5.0.0b2
3
+ Version: 5.0.0b4
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.0b2)
32
+ PSR Factory (version 5.0.0b4)
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.0b2-py3-none-win_amd64.whl
53
+ pip install psr_factory-5.0.0b4-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=LOAdIPKWDzsDv5hMFpBFRS3mDya2Lof2c8WzWJj5jMg,218
14
+ psr/factory/__init__.py,sha256=qKa77RFVnEjpqYdie5kJFmB3E6IfcIFkb8K1ZVSQATQ,218
15
15
  psr/factory/api.py,sha256=N5153ZJmZjzLQ0AvRZnSlTu6UmHBQqbYw0UQ69sZHkE,98705
16
- psr/factory/factory.dll,sha256=hdQZdi-XPBsig31tXaddifWA135jfr9lzqnchHxAPiI,18108240
16
+ psr/factory/factory.dll,sha256=cfqlk9jWmq9jNS77zKONDLEFYFqMaAdJR_6_V4wRPok,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=-IyLfl9t-QM0zOlXf-BfHeLwN7Y7RaS6mMUkwduD_T8,5317968
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=EYSmdbAzPs1_cAneAR7b3m5RjyFU5YH8_MyYqVzijoc,26572
31
+ psr/runner/runner.py,sha256=esfZbyxN_32p_ufZi7azZwmUKE3fTMrXyoyFkuZX3dI,26938
32
32
  psr/runner/version.py,sha256=mch2Y8anSXGMn9w72Z78PhSRhOyn55EwaoLAYhY4McE,194
33
- psr_factory-5.0.0b2.dist-info/licenses/LICENSE.txt,sha256=N6mqZK2Ft3iXGHj-by_MHC_dJo9qwn0URjakEPys3H4,1089
34
- psr_factory-5.0.0b2.dist-info/METADATA,sha256=BhUPjURqDFo5K_rLjSABpx0L2Zr4uPQv8rNS7MDMldU,2542
35
- psr_factory-5.0.0b2.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
36
- psr_factory-5.0.0b2.dist-info/top_level.txt,sha256=Jb393O96WQk3b5D1gMcrZBLKJJgZpzNjTPoldUi00ck,4
37
- psr_factory-5.0.0b2.dist-info/RECORD,,
33
+ psr_factory-5.0.0b4.dist-info/licenses/LICENSE.txt,sha256=N6mqZK2Ft3iXGHj-by_MHC_dJo9qwn0URjakEPys3H4,1089
34
+ psr_factory-5.0.0b4.dist-info/METADATA,sha256=izHzpBZGI-rL1zWcKVR7ufPGju-9-aYL0R7bO6UrfWc,2542
35
+ psr_factory-5.0.0b4.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
36
+ psr_factory-5.0.0b4.dist-info/top_level.txt,sha256=Jb393O96WQk3b5D1gMcrZBLKJJgZpzNjTPoldUi00ck,4
37
+ psr_factory-5.0.0b4.dist-info/RECORD,,