rtc-tools 2.7.0a1__py3-none-any.whl → 2.7.0a2__py3-none-any.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.

Potentially problematic release.


This version of rtc-tools might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rtc-tools
3
- Version: 2.7.0a1
3
+ Version: 2.7.0a2
4
4
  Summary: Toolbox for control and optimization of water systems.
5
5
  Home-page: https://oss.deltares.nl/web/rtc-tools/home
6
6
  Author: Deltares
@@ -1,5 +1,5 @@
1
1
  rtctools/__init__.py,sha256=91hvS2-ryd2Pvw0COpsUzTwJwSnTZ035REiej-1hNI4,107
2
- rtctools/_version.py,sha256=My52FWqz9UB3_PwxQjfVCPUkHjej_S48gNc1rsNpaKc,499
2
+ rtctools/_version.py,sha256=khi7aLWt95iU8AN9lfjGJYvYFy3VrtunF5V_MRtL7tI,499
3
3
  rtctools/rtctoolsapp.py,sha256=UnkuiJhv0crEEVs8H6PYvMuc2y_q6V_xLuyKEgXj9GM,4200
4
4
  rtctools/util.py,sha256=PaeKfDUA174ODZbY5fZjCTf-F-TdhW7yEuP189Ro190,9075
5
5
  rtctools/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -41,10 +41,10 @@ rtctools/simulation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
41
41
  rtctools/simulation/csv_mixin.py,sha256=rGDUFPsqGHmF0_dWdXeWzWzMpkPmwCNweTBVrwSh31g,6704
42
42
  rtctools/simulation/io_mixin.py,sha256=SJasNGI--OQ9Y-Z61oeeaGCxSrNddYz4AOVfJYbmf74,6209
43
43
  rtctools/simulation/pi_mixin.py,sha256=vcizArZsOn7tGlSFCsUmkjmRFA1A1kMNqUllLlkVc9Y,9831
44
- rtctools/simulation/simulation_problem.py,sha256=wGRIOm4AHAy75R7cbqeA13-Qy1ED3RY3Yc5Hvtmv6PY,48541
45
- rtc_tools-2.7.0a1.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
46
- rtc_tools-2.7.0a1.dist-info/METADATA,sha256=p33wEk1F8t8jCHyV1bUe5R4JcedANOtp-9NsTH1mWBc,1494
47
- rtc_tools-2.7.0a1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
48
- rtc_tools-2.7.0a1.dist-info/entry_points.txt,sha256=-x622IB_l1duw2M6t6syfQ4yzOiQTp0IZxKGcYRgWgk,151
49
- rtc_tools-2.7.0a1.dist-info/top_level.txt,sha256=pnBrb58PFPd1kp1dqa-JHU7R55h3alDNJIJnF3Jf9Dw,9
50
- rtc_tools-2.7.0a1.dist-info/RECORD,,
44
+ rtctools/simulation/simulation_problem.py,sha256=TAG8J8td-23UgRz_I0Nz7yp9v_HT8ayblyYPtqbLyZo,48647
45
+ rtc_tools-2.7.0a2.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
46
+ rtc_tools-2.7.0a2.dist-info/METADATA,sha256=OISYetGzEVCx1AWcMEcqOZpd-HT-0p6CftZd3uicWx4,1494
47
+ rtc_tools-2.7.0a2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
48
+ rtc_tools-2.7.0a2.dist-info/entry_points.txt,sha256=-x622IB_l1duw2M6t6syfQ4yzOiQTp0IZxKGcYRgWgk,151
49
+ rtc_tools-2.7.0a2.dist-info/top_level.txt,sha256=pnBrb58PFPd1kp1dqa-JHU7R55h3alDNJIJnF3Jf9Dw,9
50
+ rtc_tools-2.7.0a2.dist-info/RECORD,,
rtctools/_version.py CHANGED
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-04-25T06:42:12+0000",
11
+ "date": "2024-05-14T15:15:45+0200",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "e3d59506cabe8df7e05acd089ccf574e106a577f",
15
- "version": "2.7.0a1"
14
+ "full-revisionid": "6d06af067e4be71ea3b47593feb9be8ee7c37adc",
15
+ "version": "2.7.0a2"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -419,7 +419,6 @@ class SimulationProblem(DataStoreAccessor):
419
419
  start_values = {}
420
420
 
421
421
  # Attempt to cast var.start to python type
422
- start_value_is_symbolic = False
423
422
  mx_start = ca.MX(var.start)
424
423
  if mx_start.is_constant():
425
424
  # cast var.start to python type
@@ -427,7 +426,6 @@ class SimulationProblem(DataStoreAccessor):
427
426
  if start_value_pymoca is not None and start_value_pymoca != 0:
428
427
  start_values["modelica"] = start_value_pymoca
429
428
  else:
430
- start_value_is_symbolic = True
431
429
  start_values["modelica"] = mx_start
432
430
 
433
431
  if not var.fixed:
@@ -479,8 +477,8 @@ class SimulationProblem(DataStoreAccessor):
479
477
  input_source = "modelica"
480
478
  source_description = "modelica file or default value"
481
479
  start_val = start_values.get(input_source, None)
482
- is_numeric = start_val is not None and not start_value_is_symbolic
483
- numeric_start_val = start_val if is_numeric else 0.0
480
+ start_is_numeric = start_val is not None and not isinstance(start_val, ca.MX)
481
+ numeric_start_val = start_val if start_is_numeric else 0.0
484
482
  if len(start_values) > 1:
485
483
  logger.warning(
486
484
  "Initialize: Multiple initial values for {} are provided: {}.".format(
@@ -500,10 +498,12 @@ class SimulationProblem(DataStoreAccessor):
500
498
 
501
499
  # Add a residual for the difference between the state and its starting expression
502
500
  start_expr = start_val
501
+ min_is_symbolic = isinstance(var.min, ca.MX)
502
+ max_is_symbolic = isinstance(var.max, ca.MX)
503
503
  if var.fixed:
504
504
  # Set bounds to be equal to each other, such that IPOPT can
505
505
  # turn the decision variable into a parameter.
506
- if var.min != -np.inf or var.max != np.inf:
506
+ if min_is_symbolic or max_is_symbolic or var.min != -np.inf or var.max != np.inf:
507
507
  logger.info(
508
508
  "Initialize: bounds of {} will be overwritten".format(var_name)
509
509
  + " by the start value given by {}.".format(source_description)
@@ -515,7 +515,7 @@ class SimulationProblem(DataStoreAccessor):
515
515
  minimized_residuals.append((var.symbol - start_expr) / var_nominal)
516
516
 
517
517
  # Check that the start_value is in between the variable bounds.
518
- if start_val is not None and is_numeric:
518
+ if start_is_numeric and not min_is_symbolic and not max_is_symbolic:
519
519
  if not (var.min <= start_val and start_val <= var.max):
520
520
  logger.warning(
521
521
  "Initialize: start value {} = {}".format(var_name, start_val)