psr-factory 5.0.0b8__py3-none-win_amd64.whl → 5.0.0b9__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.0b8"
5
+ __version__ = "5.0.0b9"
6
6
 
7
7
  from .api import *
psr/factory/api.py CHANGED
@@ -173,6 +173,18 @@ def build_version() -> str:
173
173
  return _version_short()
174
174
 
175
175
 
176
+ def diagnostics() -> str:
177
+ """Run diagnostics and returns the results as text.
178
+ Use for troubleshoot and debug purposes."""
179
+ _check_loaded()
180
+ size = 1000
181
+ buffer = ctypes.create_string_buffer(size)
182
+ status = factorylib.lib.psrd_diagnostics(buffer, size)
183
+ if status == 0:
184
+ return _from_c_str(buffer.value)
185
+ return ""
186
+
187
+
176
188
  def get_log_level() -> LogLevel:
177
189
  """Get log level."""
178
190
  _check_loaded()
psr/factory/factory.dll CHANGED
Binary file
psr/runner/runner.py CHANGED
@@ -125,7 +125,6 @@ def _write_mpi_settings(mpi_file_path: Union[str, pathlib.Path], cluster_setting
125
125
 
126
126
  def run_sddp(case_path: Union[str, pathlib.Path], sddp_path: Union[str, pathlib.Path], **kwargs):
127
127
  case_path = os.path.abspath(str(case_path))
128
-
129
128
  sddp_path = str(sddp_path)
130
129
  parallel_run = kwargs.get("parallel_run", True)
131
130
  cluster_settings: Optional[Union[int, bool, Dict[str, int]]] = kwargs.get("cluster_settings", False)
@@ -202,6 +201,15 @@ def _get_sddp_executable_parent_path(sddp_path: Union[str, pathlib.Path]) -> str
202
201
  return os.path.join(sddp_path, "Oper")
203
202
  return sddp_path
204
203
 
204
+ def _get_optgen_executable_parent_path(optgen_path: Union[str, pathlib.Path]) -> str:
205
+ if os.name == 'nt':
206
+ model_path = os.path.join(optgen_path, "models", "optgen", "Model")
207
+ if os.path.exists(model_path):
208
+ return model_path
209
+ else:
210
+ return os.path.join(optgen_path, "Model")
211
+ return optgen_path
212
+
205
213
 
206
214
  def get_sddp_version(sddp_path: Union[str, pathlib.Path]) -> str:
207
215
  sddp_path = str(sddp_path)
@@ -261,14 +269,14 @@ def run_optgen(case_path: Union[str, pathlib.Path], optgen_path: Union[str, path
261
269
  case_path = os.path.abspath(str(case_path)).replace("\\", "/") + "/"
262
270
  optgen_path = str(optgen_path)
263
271
  sddp_path = str(sddp_path)
264
- sddp_full_path = os.path.join(sddp_path, "Oper")
265
- optgen_path = os.path.join(optgen_path, "Model")
272
+ sddp_path_full = _get_sddp_executable_parent_path(sddp_path)
273
+ optgen_path_full = _get_optgen_executable_parent_path(optgen_path)
266
274
  exec_mode = kwargs.get("_mode", None)
267
275
 
268
276
  mode_arg = exec_mode if exec_mode is not None else ""
269
277
 
270
- with change_cwd(optgen_path):
271
- cmd = f'optgen {mode_arg} -optgdat="{case_path}" -sddpexe="{sddp_full_path}" -sddpmpi="{__default_mpi_path}"'
278
+ with change_cwd(optgen_path_full):
279
+ cmd = f'optgen {mode_arg} -optgdat="{case_path}" -sddpexe="{sddp_path_full}" -sddpmpi="{__default_mpi_path}"'
272
280
  exec_cmd(cmd, **kwargs)
273
281
 
274
282
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: psr-factory
3
- Version: 5.0.0b8
3
+ Version: 5.0.0b9
4
4
  Summary: PSR database management module.
5
5
  Author-email: "PSR Inc." <psrfactory@psr-inc.com>
6
6
  License-Expression: MIT
@@ -11,9 +11,9 @@ 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=EsBrm1qjh8fLCvMYqr2mSudt-o-pxj9syxhXDmmAqVc,218
15
- psr/factory/api.py,sha256=N5153ZJmZjzLQ0AvRZnSlTu6UmHBQqbYw0UQ69sZHkE,98705
16
- psr/factory/factory.dll,sha256=22lMjOUSQelOSr5vOzJZdRHNCAJb7kI0jLAvtvWaPSs,18287440
14
+ psr/factory/__init__.py,sha256=qfmU1P3t5sL5hYAD1IxAxqaMWB50rj3Sp0xixY1iTyE,218
15
+ psr/factory/api.py,sha256=JYl-tI_py_7mxEU4rUw_t4ObzVUr_nd8lnYQBGZnxLU,99066
16
+ psr/factory/factory.dll,sha256=Q4Y9EDcPcQzb300AIbQwOF3WJiz-RyB2UiQq9FYDuzM,18287440
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
@@ -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=esfZbyxN_32p_ufZi7azZwmUKE3fTMrXyoyFkuZX3dI,26938
31
+ psr/runner/runner.py,sha256=5Ak_sQyBKho8zb3H0hCH97a1HKTiC3ga-Jji-i3COsc,27327
32
32
  psr/runner/version.py,sha256=mch2Y8anSXGMn9w72Z78PhSRhOyn55EwaoLAYhY4McE,194
33
- psr_factory-5.0.0b8.dist-info/licenses/LICENSE.txt,sha256=N6mqZK2Ft3iXGHj-by_MHC_dJo9qwn0URjakEPys3H4,1089
34
- psr_factory-5.0.0b8.dist-info/METADATA,sha256=ijR7X_ZVQf0RZdkQGxAphpIrSE-C_wx_fuOP9hJ-IXo,3308
35
- psr_factory-5.0.0b8.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
36
- psr_factory-5.0.0b8.dist-info/top_level.txt,sha256=Jb393O96WQk3b5D1gMcrZBLKJJgZpzNjTPoldUi00ck,4
37
- psr_factory-5.0.0b8.dist-info/RECORD,,
33
+ psr_factory-5.0.0b9.dist-info/licenses/LICENSE.txt,sha256=N6mqZK2Ft3iXGHj-by_MHC_dJo9qwn0URjakEPys3H4,1089
34
+ psr_factory-5.0.0b9.dist-info/METADATA,sha256=hYpRVKc5TEdxQYIv4tB1H7zE2T-79ejalXp-uGyL5nc,3308
35
+ psr_factory-5.0.0b9.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
36
+ psr_factory-5.0.0b9.dist-info/top_level.txt,sha256=Jb393O96WQk3b5D1gMcrZBLKJJgZpzNjTPoldUi00ck,4
37
+ psr_factory-5.0.0b9.dist-info/RECORD,,