rtc-tools 2.7.0b1__tar.gz → 2.7.0b3__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.
Potentially problematic release.
This version of rtc-tools might be problematic. Click here for more details.
- {rtc_tools-2.7.0b1/src/rtc_tools.egg-info → rtc_tools-2.7.0b3}/PKG-INFO +2 -2
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/README.md +3 -3
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/setup.py +1 -1
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3/src/rtc_tools.egg-info}/PKG-INFO +2 -2
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtc_tools.egg-info/requires.txt +1 -1
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/_version.py +3 -3
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/collocated_integrated_optimization_problem.py +4 -6
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/control_tree_mixin.py +8 -5
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/csv_lookup_table_mixin.py +1 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/optimization_problem.py +18 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/rtctoolsapp.py +4 -4
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/util.py +1 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/COPYING.LESSER +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/MANIFEST.in +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/pyproject.toml +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/setup.cfg +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtc_tools.egg-info/SOURCES.txt +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtc_tools.egg-info/dependency_links.txt +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtc_tools.egg-info/entry_points.txt +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtc_tools.egg-info/top_level.txt +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/__init__.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/_internal/__init__.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/_internal/alias_tools.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/_internal/caching.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/_internal/casadi_helpers.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/_internal/debug_check_helpers.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/__init__.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/csv.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/interpolation/__init__.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/interpolation/bspline.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/interpolation/bspline1d.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/interpolation/bspline2d.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/netcdf.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/pi.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/rtc.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/data/storage.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/__init__.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/csv_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/goal_programming_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/goal_programming_mixin_base.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/homotopy_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/initial_state_estimation_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/io_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/linearization_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/linearized_order_goal_programming_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/min_abs_goal_programming_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/modelica_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/netcdf_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/pi_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/planning_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/single_pass_goal_programming_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/timeseries.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/simulation/__init__.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/simulation/csv_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/simulation/io_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/simulation/pi_mixin.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/simulation/simulation_problem.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/tests/test_case.py +0 -0
- {rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/versioneer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rtc-tools
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.0b3
|
|
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
|
Download-URL: http://github.com/deltares/rtc-tools/
|
|
@@ -25,7 +25,7 @@ Classifier: Operating System :: Unix
|
|
|
25
25
|
Classifier: Operating System :: MacOS
|
|
26
26
|
Requires-Python: >=3.9
|
|
27
27
|
License-File: COPYING.LESSER
|
|
28
|
-
Requires-Dist: casadi!=3.6.6
|
|
28
|
+
Requires-Dist: casadi!=3.6.6,<=3.7,>=3.6.3
|
|
29
29
|
Requires-Dist: numpy>=1.16.0
|
|
30
30
|
Requires-Dist: scipy>=1.0.0
|
|
31
31
|
Requires-Dist: pymoca==0.9.*,>=0.9.1
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
[](
|
|
4
4
|
https://github.com/deltares/rtc-tools/actions/workflows/rtc-tools.yml
|
|
5
5
|
)
|
|
6
|
-
[
|
|
6
|
+
[](https://sonarcloud.io/summary/new_code?id=Deltares_rtc-tools)
|
|
9
9
|
|
|
10
10
|
> **NOTE** The rtc-tools repository has been migrated from gitlab to here;
|
|
11
11
|
see [migration from gitlab](#migration-from-gitlab).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rtc-tools
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.0b3
|
|
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
|
Download-URL: http://github.com/deltares/rtc-tools/
|
|
@@ -25,7 +25,7 @@ Classifier: Operating System :: Unix
|
|
|
25
25
|
Classifier: Operating System :: MacOS
|
|
26
26
|
Requires-Python: >=3.9
|
|
27
27
|
License-File: COPYING.LESSER
|
|
28
|
-
Requires-Dist: casadi!=3.6.6
|
|
28
|
+
Requires-Dist: casadi!=3.6.6,<=3.7,>=3.6.3
|
|
29
29
|
Requires-Dist: numpy>=1.16.0
|
|
30
30
|
Requires-Dist: scipy>=1.0.0
|
|
31
31
|
Requires-Dist: pymoca==0.9.*,>=0.9.1
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-
|
|
11
|
+
"date": "2025-05-23T14:56:50+0200",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2.7.
|
|
14
|
+
"full-revisionid": "16ab781cd81009655c779d5cc5b7c4aa3e73fa85",
|
|
15
|
+
"version": "2.7.0b3"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -2043,9 +2043,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2043
2043
|
def controls(self):
|
|
2044
2044
|
return self.__controls
|
|
2045
2045
|
|
|
2046
|
-
def _collint_get_lbx_ubx(self, count, indices):
|
|
2047
|
-
bounds = self.bounds()
|
|
2048
|
-
|
|
2046
|
+
def _collint_get_lbx_ubx(self, bounds, count, indices):
|
|
2049
2047
|
lbx = np.full(count, -np.inf, dtype=np.float64)
|
|
2050
2048
|
ubx = np.full(count, np.inf, dtype=np.float64)
|
|
2051
2049
|
|
|
@@ -2210,7 +2208,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2210
2208
|
count = max(count, control_indices_stop)
|
|
2211
2209
|
|
|
2212
2210
|
discrete = self._collint_get_discrete(count, indices)
|
|
2213
|
-
lbx, ubx = self._collint_get_lbx_ubx(count, indices)
|
|
2211
|
+
lbx, ubx = self._collint_get_lbx_ubx(bounds, count, indices)
|
|
2214
2212
|
x0 = self._collint_get_x0(count, indices)
|
|
2215
2213
|
|
|
2216
2214
|
# Return number of control variables
|
|
@@ -2326,7 +2324,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2326
2324
|
offset += 1
|
|
2327
2325
|
|
|
2328
2326
|
discrete = self._collint_get_discrete(count, indices)
|
|
2329
|
-
lbx, ubx = self._collint_get_lbx_ubx(count, indices)
|
|
2327
|
+
lbx, ubx = self._collint_get_lbx_ubx(bounds, count, indices)
|
|
2330
2328
|
x0 = self._collint_get_x0(count, indices)
|
|
2331
2329
|
|
|
2332
2330
|
# Return number of state variables
|
|
@@ -3112,7 +3110,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
3112
3110
|
variable_to_all_indices = {k: set(v) for k, v in indices[0].items()}
|
|
3113
3111
|
for ensemble_indices in indices[1:]:
|
|
3114
3112
|
for k, v in ensemble_indices.items():
|
|
3115
|
-
variable_to_all_indices[k] |= v
|
|
3113
|
+
variable_to_all_indices[k] |= set(v)
|
|
3116
3114
|
|
|
3117
3115
|
if len(inds_up) > 0:
|
|
3118
3116
|
exceedences = []
|
|
@@ -86,6 +86,11 @@ class ControlTreeMixin(OptimizationProblem):
|
|
|
86
86
|
logger.debug("ControlTreeMixin: Branching times:")
|
|
87
87
|
logger.debug(self.__branching_times)
|
|
88
88
|
|
|
89
|
+
# Avoid calling constant_inputs() many times
|
|
90
|
+
constant_inputs = [
|
|
91
|
+
self.constant_inputs(ensemble_member=i) for i in range(self.ensemble_size)
|
|
92
|
+
]
|
|
93
|
+
|
|
89
94
|
# Branches start at branching times, so that the tree looks like the following:
|
|
90
95
|
#
|
|
91
96
|
# *-----
|
|
@@ -122,18 +127,16 @@ class ControlTreeMixin(OptimizationProblem):
|
|
|
122
127
|
for forecast_variable in options["forecast_variables"]:
|
|
123
128
|
# We assume the time stamps of the forecasts in all ensemble
|
|
124
129
|
# members to be identical
|
|
125
|
-
timeseries =
|
|
130
|
+
timeseries = constant_inputs[0][forecast_variable]
|
|
126
131
|
els = np.logical_and(
|
|
127
132
|
timeseries.times >= branching_time_0, timeseries.times < branching_time_1
|
|
128
133
|
)
|
|
129
134
|
|
|
130
135
|
# Compute distance between ensemble members
|
|
131
136
|
for i, member_i in enumerate(branches[current_branch]):
|
|
132
|
-
timeseries_i =
|
|
137
|
+
timeseries_i = constant_inputs[member_i][forecast_variable]
|
|
133
138
|
for j, member_j in enumerate(branches[current_branch]):
|
|
134
|
-
timeseries_j =
|
|
135
|
-
forecast_variable
|
|
136
|
-
]
|
|
139
|
+
timeseries_j = constant_inputs[member_j][forecast_variable]
|
|
137
140
|
distances[i, j] += np.linalg.norm(
|
|
138
141
|
timeseries_i.values[els] - timeseries_j.values[els]
|
|
139
142
|
)
|
|
@@ -314,6 +314,24 @@ class OptimizationProblem(DataStoreAccessor, metaclass=ABCMeta):
|
|
|
314
314
|
if log_level == logging.ERROR and not log_solver_failure_as_error:
|
|
315
315
|
log_level = logging.INFO
|
|
316
316
|
|
|
317
|
+
if self.solver_options()["solver"].lower() == "knitro":
|
|
318
|
+
list_feas_flags = [
|
|
319
|
+
"KN_RC_OPTIMAL_OR_SATISFACTORY",
|
|
320
|
+
"KN_RC_ITER_LIMIT_FEAS",
|
|
321
|
+
"KN_RC_NEAR_OPT",
|
|
322
|
+
"KN_RC_FEAS_XTOL",
|
|
323
|
+
"KN_RC_FEAS_NO_IMPROVE",
|
|
324
|
+
"KN_RC_FEAS_FTOL",
|
|
325
|
+
"KN_RC_TIME_LIMIT_FEAS",
|
|
326
|
+
"KN_RC_FEVAL_LIMIT_FEAS",
|
|
327
|
+
"KN_RC_MIP_EXH_FEAS",
|
|
328
|
+
"KN_RC_MIP_TERM_FEAS",
|
|
329
|
+
"KN_RC_MIP_SOLVE_LIMIT_FEAS",
|
|
330
|
+
"KN_RC_MIP_NODE_LIMIT_FEAS",
|
|
331
|
+
]
|
|
332
|
+
if solver_stats["return_status"] in list_feas_flags:
|
|
333
|
+
success = True
|
|
334
|
+
|
|
317
335
|
return success, log_level
|
|
318
336
|
|
|
319
337
|
@abstractproperty
|
|
@@ -64,7 +64,7 @@ def copy_libraries(*args):
|
|
|
64
64
|
|
|
65
65
|
for ep in importlib_metadata.entry_points(group="rtctools.libraries.modelica"):
|
|
66
66
|
if ep.name == "library_folder":
|
|
67
|
-
library_folders.append(
|
|
67
|
+
library_folders.append(Path(importlib.resources.files(ep.module).joinpath(ep.attr)))
|
|
68
68
|
|
|
69
69
|
tlds = {}
|
|
70
70
|
for lf in library_folders:
|
|
@@ -104,7 +104,6 @@ def download_examples(*args):
|
|
|
104
104
|
from zipfile import ZipFile
|
|
105
105
|
|
|
106
106
|
version = rtctools.__version__
|
|
107
|
-
rtc_full_name = "rtc-tools-{}".format(version)
|
|
108
107
|
try:
|
|
109
108
|
url = "https://github.com/deltares/rtc-tools/zipball/{}".format(version)
|
|
110
109
|
|
|
@@ -117,11 +116,12 @@ def download_examples(*args):
|
|
|
117
116
|
|
|
118
117
|
with ZipFile(local_filename, "r") as z:
|
|
119
118
|
target = path / "rtc-tools-examples"
|
|
120
|
-
|
|
119
|
+
zip_folder_name = next(x for x in z.namelist() if x.startswith("Deltares-rtc-tools-"))
|
|
120
|
+
prefix = "{}/examples/".format(zip_folder_name.rstrip("/"))
|
|
121
121
|
members = [x for x in z.namelist() if x.startswith(prefix)]
|
|
122
122
|
z.extractall(members=members)
|
|
123
123
|
shutil.move(prefix, target)
|
|
124
|
-
shutil.rmtree(
|
|
124
|
+
shutil.rmtree(zip_folder_name)
|
|
125
125
|
|
|
126
126
|
sys.exit("Succesfully downloaded the RTC-Tools examples to '{}'".format(target.resolve()))
|
|
127
127
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/goal_programming_mixin_base.py
RENAMED
|
File without changes
|
|
File without changes
|
{rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/initial_state_estimation_mixin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rtc_tools-2.7.0b1 → rtc_tools-2.7.0b3}/src/rtctools/optimization/min_abs_goal_programming_mixin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|