rtc-tools 2.7.0a4__py3-none-any.whl → 2.7.0b1__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.
- {rtc_tools-2.7.0a4.dist-info → rtc_tools-2.7.0b1.dist-info}/METADATA +3 -2
- {rtc_tools-2.7.0a4.dist-info → rtc_tools-2.7.0b1.dist-info}/RECORD +19 -19
- {rtc_tools-2.7.0a4.dist-info → rtc_tools-2.7.0b1.dist-info}/WHEEL +1 -1
- rtctools/_version.py +3 -3
- rtctools/data/netcdf.py +16 -15
- rtctools/data/pi.py +5 -2
- rtctools/data/rtc.py +3 -3
- rtctools/optimization/collocated_integrated_optimization_problem.py +6 -7
- rtctools/optimization/csv_lookup_table_mixin.py +4 -3
- rtctools/optimization/goal_programming_mixin.py +3 -2
- rtctools/optimization/goal_programming_mixin_base.py +4 -3
- rtctools/optimization/modelica_mixin.py +2 -2
- rtctools/optimization/pi_mixin.py +3 -3
- rtctools/simulation/io_mixin.py +1 -1
- rtctools/simulation/pi_mixin.py +3 -3
- rtctools/simulation/simulation_problem.py +14 -9
- {rtc_tools-2.7.0a4.dist-info → rtc_tools-2.7.0b1.dist-info}/entry_points.txt +0 -0
- {rtc_tools-2.7.0a4.dist-info → rtc_tools-2.7.0b1.dist-info/licenses}/COPYING.LESSER +0 -0
- {rtc_tools-2.7.0a4.dist-info → rtc_tools-2.7.0b1.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: rtc-tools
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.0b1
|
|
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/
|
|
@@ -41,6 +41,7 @@ Dynamic: classifier
|
|
|
41
41
|
Dynamic: description
|
|
42
42
|
Dynamic: download-url
|
|
43
43
|
Dynamic: home-page
|
|
44
|
+
Dynamic: license-file
|
|
44
45
|
Dynamic: maintainer
|
|
45
46
|
Dynamic: platform
|
|
46
47
|
Dynamic: provides-extra
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
rtc_tools-2.7.0b1.dist-info/licenses/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
1
2
|
rtctools/__init__.py,sha256=91hvS2-ryd2Pvw0COpsUzTwJwSnTZ035REiej-1hNI4,107
|
|
2
|
-
rtctools/_version.py,sha256=
|
|
3
|
+
rtctools/_version.py,sha256=qpi8lYqShCC9PmcMx5KMwsdJ9rzUpVeHLRvr9yxv_9E,499
|
|
3
4
|
rtctools/rtctoolsapp.py,sha256=VvoOgpu1R5vzaQsUzBjyB4uPenMv2yWukcA6N9KDEr8,4275
|
|
4
5
|
rtctools/util.py,sha256=PaeKfDUA174ODZbY5fZjCTf-F-TdhW7yEuP189Ro190,9075
|
|
5
6
|
rtctools/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -9,42 +10,41 @@ rtctools/_internal/casadi_helpers.py,sha256=q8j5h9XXXkZMUgjg6wbkcFj1mcHi5_SdEi8S
|
|
|
9
10
|
rtctools/_internal/debug_check_helpers.py,sha256=UgQTEPw4PyR7MbYLewSSWQqTwQj7xr5yUBk820O9Kk4,1084
|
|
10
11
|
rtctools/data/__init__.py,sha256=EllgSmCdrlvQZSd1VilvjPaeYJGhY9ErPiQtedmuFoA,157
|
|
11
12
|
rtctools/data/csv.py,sha256=hEpoTH3nhZaAvRN4r-9-nYeAjaFiNDRoiZWg8GxM3yo,5539
|
|
12
|
-
rtctools/data/netcdf.py,sha256=
|
|
13
|
-
rtctools/data/pi.py,sha256=
|
|
14
|
-
rtctools/data/rtc.py,sha256=
|
|
13
|
+
rtctools/data/netcdf.py,sha256=tMs-zcSlOR0HhajUKJVbXGNoi3GeKCM3X4DjuW8FDo8,19130
|
|
14
|
+
rtctools/data/pi.py,sha256=D2r9gaYu6qMpgWRqiWpWPSPJXWgqCVV0bz6ewgM78mc,46701
|
|
15
|
+
rtctools/data/rtc.py,sha256=tYPOzZSFE02bAXX3lgcGR1saoQNIv6oWVWH8CS0dl5Q,9079
|
|
15
16
|
rtctools/data/storage.py,sha256=67J4BRTl0AMEzlKNZ8Xdpy_4cGtwx8Lo_tL2n0G4S9w,13206
|
|
16
17
|
rtctools/data/interpolation/__init__.py,sha256=GBubCIT5mFoSTV-lOk7cpwvZekNMEe5bvqSQJ9HE34M,73
|
|
17
18
|
rtctools/data/interpolation/bspline.py,sha256=qevB842XWCH3fWlWMBqKMy1mw37ust-0YtSnb9PKCEc,948
|
|
18
19
|
rtctools/data/interpolation/bspline1d.py,sha256=HAh7m5xLBuiFKzMzuYEqZX_GmCPChKjV7ynTS6iRZOc,6166
|
|
19
20
|
rtctools/data/interpolation/bspline2d.py,sha256=ScmX0fPDxbUVtj3pbUE0L7UJocqroD_6fUT-4cvdRMc,1693
|
|
20
21
|
rtctools/optimization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
rtctools/optimization/collocated_integrated_optimization_problem.py,sha256=
|
|
22
|
+
rtctools/optimization/collocated_integrated_optimization_problem.py,sha256=qr_Ii_K71zzX48cDwYFD37QpQsh5CsBBiC88uroIEqI,131270
|
|
22
23
|
rtctools/optimization/control_tree_mixin.py,sha256=CC6TWp3kFQgMokx6213pRLx9iY17Fd0VcwG4Wpwa0Uo,8974
|
|
23
|
-
rtctools/optimization/csv_lookup_table_mixin.py,sha256=
|
|
24
|
+
rtctools/optimization/csv_lookup_table_mixin.py,sha256=JUAwYiOd0FPh-jLmPkfeT2i_3j8VLuBfi3i5UtwfVoU,17325
|
|
24
25
|
rtctools/optimization/csv_mixin.py,sha256=_6iPVK_EJ8PxnukepzkhFtidceucsozRML_DDEycYik,12453
|
|
25
|
-
rtctools/optimization/goal_programming_mixin.py,sha256=
|
|
26
|
-
rtctools/optimization/goal_programming_mixin_base.py,sha256=
|
|
26
|
+
rtctools/optimization/goal_programming_mixin.py,sha256=vdnKnz1Ov3OFN-J9KQiiAwHbrLjWH6o_PeZz2YfLz6k,33320
|
|
27
|
+
rtctools/optimization/goal_programming_mixin_base.py,sha256=qJQQcJlJdio4GTcrKfuBi6Nho9u16pDuuprzK0LUyhA,43835
|
|
27
28
|
rtctools/optimization/homotopy_mixin.py,sha256=Kh0kMfxB-Fo1FBGW5tPOQk24Xx_Mmw_p0YuSQotdkMU,6905
|
|
28
29
|
rtctools/optimization/initial_state_estimation_mixin.py,sha256=74QYfG-VYYTNVg-kAnCG6QoY3_sUmaID0ideF7bPkkY,3116
|
|
29
30
|
rtctools/optimization/io_mixin.py,sha256=AsZQ7YOUcUbWoczmjTXaSje5MUEsPNbQyZBJ6qzSjzU,11821
|
|
30
31
|
rtctools/optimization/linearization_mixin.py,sha256=mG5S7uwvwDydw-eBPyQKnLyKoy08EBjQh25vu97afhY,1049
|
|
31
32
|
rtctools/optimization/linearized_order_goal_programming_mixin.py,sha256=LQ2qpYt0YGLpEoerif4FJ5wwzq16q--27bsRjcqIU5A,9087
|
|
32
33
|
rtctools/optimization/min_abs_goal_programming_mixin.py,sha256=WMOv9EF8cfDJgTunzXfI_cUmBSQK26u1HJB_9EAarfM,14031
|
|
33
|
-
rtctools/optimization/modelica_mixin.py,sha256=
|
|
34
|
+
rtctools/optimization/modelica_mixin.py,sha256=b_VsEcg_VsAnODnTQybrY0GbuZUNQ3uugQmML6FlklE,18037
|
|
34
35
|
rtctools/optimization/netcdf_mixin.py,sha256=-zkXh3sMYE50c3kHsrmUVGWMSFm-0cXQpGrCm0yn-Tc,7563
|
|
35
36
|
rtctools/optimization/optimization_problem.py,sha256=qzpc81NaZMeoXKuayFmBF15iXYuNAk5yxmaER_Gcz_A,44131
|
|
36
|
-
rtctools/optimization/pi_mixin.py,sha256=
|
|
37
|
+
rtctools/optimization/pi_mixin.py,sha256=G_6RPlXO-IOjqYxNsMZGY4fmnfxVpwN-_T5Ka3rDwK4,11788
|
|
37
38
|
rtctools/optimization/planning_mixin.py,sha256=O_Y74X8xZmaNZR4iYOe7BR06s9hnmcapbuHYHQTBPPQ,724
|
|
38
39
|
rtctools/optimization/single_pass_goal_programming_mixin.py,sha256=Zb9szg3PGT2o6gkGsXluSfEaAswkw3TKfPQDzUrj_Y4,25784
|
|
39
40
|
rtctools/optimization/timeseries.py,sha256=nCrsGCJThBMh9lvngEpbBDa834_QvklVvkxJqwX4a1M,1734
|
|
40
41
|
rtctools/simulation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
42
|
rtctools/simulation/csv_mixin.py,sha256=rGDUFPsqGHmF0_dWdXeWzWzMpkPmwCNweTBVrwSh31g,6704
|
|
42
|
-
rtctools/simulation/io_mixin.py,sha256=
|
|
43
|
-
rtctools/simulation/pi_mixin.py,sha256=
|
|
44
|
-
rtctools/simulation/simulation_problem.py,sha256=
|
|
45
|
-
rtc_tools-2.7.
|
|
46
|
-
rtc_tools-2.7.
|
|
47
|
-
rtc_tools-2.7.
|
|
48
|
-
rtc_tools-2.7.
|
|
49
|
-
rtc_tools-2.7.
|
|
50
|
-
rtc_tools-2.7.0a4.dist-info/RECORD,,
|
|
43
|
+
rtctools/simulation/io_mixin.py,sha256=WIKOQxr3fS-aNbgjet9iWoUayuD22zLIYmqlWEqxXHo,6215
|
|
44
|
+
rtctools/simulation/pi_mixin.py,sha256=_TU2DrK2MQqVsyrHBD9W4SDEuot9dYmgTDNiXkDAJfk,9833
|
|
45
|
+
rtctools/simulation/simulation_problem.py,sha256=v5Lk2x-yuVb5s7ne5fFgxONxGniLHTyTR0XRzYRl1fw,50005
|
|
46
|
+
rtc_tools-2.7.0b1.dist-info/METADATA,sha256=8hM5-9gf_vYP6z514La_JRMsPIbT5qIhSxSTUgKc-Jc,1776
|
|
47
|
+
rtc_tools-2.7.0b1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
48
|
+
rtc_tools-2.7.0b1.dist-info/entry_points.txt,sha256=DVS8sWf3b9ph9h8srEr6zmQ7ZKGwblwgZgGPZg-jRNQ,150
|
|
49
|
+
rtc_tools-2.7.0b1.dist-info/top_level.txt,sha256=pnBrb58PFPd1kp1dqa-JHU7R55h3alDNJIJnF3Jf9Dw,9
|
|
50
|
+
rtc_tools-2.7.0b1.dist-info/RECORD,,
|
rtctools/_version.py
CHANGED
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-
|
|
11
|
+
"date": "2025-04-15T16:04:52+0200",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2.7.
|
|
14
|
+
"full-revisionid": "941763cc3e1c0ee1b9644aaa5dee37d25fd3b02c",
|
|
15
|
+
"version": "2.7.0b1"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
rtctools/data/netcdf.py
CHANGED
|
@@ -401,20 +401,21 @@ class ExportDataset:
|
|
|
401
401
|
"""
|
|
402
402
|
assert len(set(variable_names)) == len(variable_names)
|
|
403
403
|
|
|
404
|
-
assert (
|
|
405
|
-
|
|
406
|
-
)
|
|
407
|
-
assert (
|
|
408
|
-
|
|
409
|
-
)
|
|
404
|
+
assert self.__time_dim is not None, (
|
|
405
|
+
"First call write_times to ensure the time dimension has been created."
|
|
406
|
+
)
|
|
407
|
+
assert self.__station_dim is not None, (
|
|
408
|
+
"First call write_station_data to ensure the station dimension has been created"
|
|
409
|
+
)
|
|
410
410
|
assert (
|
|
411
411
|
self.__station_id_to_index_mapping is not None
|
|
412
412
|
) # should also be created in write_station_data
|
|
413
413
|
|
|
414
414
|
if ensemble_size > 1:
|
|
415
|
-
assert (
|
|
416
|
-
|
|
417
|
-
|
|
415
|
+
assert self.__ensemble_member_dim is not None, (
|
|
416
|
+
"First call write_ensemble_data to ensure "
|
|
417
|
+
"the realization dimension has been created"
|
|
418
|
+
)
|
|
418
419
|
|
|
419
420
|
for variable_name in variable_names:
|
|
420
421
|
self.__dataset.createVariable(
|
|
@@ -446,15 +447,15 @@ class ExportDataset:
|
|
|
446
447
|
:param values: The values that are to be written to the file
|
|
447
448
|
:param ensemble_size: the number of members in the ensemble
|
|
448
449
|
"""
|
|
449
|
-
assert (
|
|
450
|
-
|
|
451
|
-
)
|
|
450
|
+
assert self.__station_id_to_index_mapping is not None, (
|
|
451
|
+
"First call write_station_data and create_variables."
|
|
452
|
+
)
|
|
452
453
|
|
|
453
454
|
station_index = self.__station_id_to_index_mapping[station_id]
|
|
454
455
|
if ensemble_size > 1:
|
|
455
|
-
self.__dataset.variables[variable_name][
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
self.__dataset.variables[variable_name][:, station_index, ensemble_member_index] = (
|
|
457
|
+
values
|
|
458
|
+
)
|
|
458
459
|
else:
|
|
459
460
|
self.__dataset.variables[variable_name][:, station_index] = values
|
|
460
461
|
|
rtctools/data/pi.py
CHANGED
|
@@ -333,8 +333,11 @@ class ParameterConfig:
|
|
|
333
333
|
|
|
334
334
|
parameters = group.findall("pi:parameter", ns)
|
|
335
335
|
for parameter in parameters:
|
|
336
|
-
yield
|
|
337
|
-
|
|
336
|
+
yield (
|
|
337
|
+
location_id,
|
|
338
|
+
model_id,
|
|
339
|
+
parameter.attrib["id"],
|
|
340
|
+
self.__parse_parameter(parameter),
|
|
338
341
|
)
|
|
339
342
|
|
|
340
343
|
|
rtctools/data/rtc.py
CHANGED
|
@@ -60,9 +60,9 @@ class DataConfig:
|
|
|
60
60
|
logger.error(message)
|
|
61
61
|
raise Exception(message)
|
|
62
62
|
else:
|
|
63
|
-
self.__location_parameter_ids[
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
self.__location_parameter_ids[internal_id] = (
|
|
64
|
+
self.__pi_location_parameter_id(pi_timeseries, "fews")
|
|
65
|
+
)
|
|
66
66
|
self.__variable_map[external_id] = internal_id
|
|
67
67
|
|
|
68
68
|
for k in ["import", "export"]:
|
|
@@ -1028,8 +1028,8 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1028
1028
|
+ len(self.dae_variables["constant_inputs"])
|
|
1029
1029
|
]
|
|
1030
1030
|
constant_inputs_1 = accumulated_U[
|
|
1031
|
-
2 * len(collocated_variables)
|
|
1032
|
-
|
|
1031
|
+
2 * len(collocated_variables) + len(self.dae_variables["constant_inputs"]) : 2
|
|
1032
|
+
* len(collocated_variables)
|
|
1033
1033
|
+ 2 * len(self.dae_variables["constant_inputs"])
|
|
1034
1034
|
]
|
|
1035
1035
|
|
|
@@ -1803,9 +1803,9 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1803
1803
|
# Cast delay from DM to np.array
|
|
1804
1804
|
delay = delay.toarray().flatten()
|
|
1805
1805
|
|
|
1806
|
-
assert np.all(
|
|
1807
|
-
|
|
1808
|
-
)
|
|
1806
|
+
assert np.all(np.isfinite(delay)), (
|
|
1807
|
+
"Delay duration must be resolvable to real values at transcribe()"
|
|
1808
|
+
)
|
|
1809
1809
|
|
|
1810
1810
|
out_times = np.concatenate([history_times, collocation_times])
|
|
1811
1811
|
out_values = ca.veccat(
|
|
@@ -2869,8 +2869,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2869
2869
|
|
|
2870
2870
|
# Check coefficient matrix
|
|
2871
2871
|
logger.info(
|
|
2872
|
-
"Sanity check on objective and constraints Jacobian matrix"
|
|
2873
|
-
"/constant coefficients values"
|
|
2872
|
+
"Sanity check on objective and constraints Jacobian matrix/constant coefficients values"
|
|
2874
2873
|
)
|
|
2875
2874
|
|
|
2876
2875
|
in_var = nlp["x"]
|
|
@@ -55,7 +55,7 @@ class LookupTable(LookupTableBase):
|
|
|
55
55
|
"This lookup table was not instantiated with tck metadata. \
|
|
56
56
|
Domain/Range information is unavailable."
|
|
57
57
|
)
|
|
58
|
-
if
|
|
58
|
+
if isinstance(t, tuple) and len(t) == 2:
|
|
59
59
|
raise NotImplementedError(
|
|
60
60
|
"Domain/Range information is not yet implemented for 2D LookupTables"
|
|
61
61
|
)
|
|
@@ -298,8 +298,9 @@ class CSVLookupTableMixin(OptimizationProblem):
|
|
|
298
298
|
def check_lookup_table(lookup_table):
|
|
299
299
|
if lookup_table in self.__lookup_tables:
|
|
300
300
|
raise Exception(
|
|
301
|
-
"Cannot add lookup table {},"
|
|
302
|
-
|
|
301
|
+
"Cannot add lookup table {},since there is already one with this name.".format(
|
|
302
|
+
lookup_table
|
|
303
|
+
)
|
|
303
304
|
)
|
|
304
305
|
|
|
305
306
|
# Read CSV files
|
|
@@ -351,8 +351,9 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
351
351
|
if goal.has_target_bounds:
|
|
352
352
|
# We use a violation variable formulation, with the violation
|
|
353
353
|
# variables epsilon bounded between 0 and 1.
|
|
354
|
-
m, M =
|
|
355
|
-
epsilon, np.inf, dtype=np.float64
|
|
354
|
+
m, M = (
|
|
355
|
+
np.full_like(epsilon, -np.inf, dtype=np.float64),
|
|
356
|
+
np.full_like(epsilon, np.inf, dtype=np.float64),
|
|
356
357
|
)
|
|
357
358
|
|
|
358
359
|
# A function range does not have to be specified for critical
|
|
@@ -437,7 +437,7 @@ class _GoalConstraint:
|
|
|
437
437
|
):
|
|
438
438
|
assert isinstance(m, (float, np.ndarray, Timeseries))
|
|
439
439
|
assert isinstance(M, (float, np.ndarray, Timeseries))
|
|
440
|
-
assert type(m)
|
|
440
|
+
assert type(m) is type(M)
|
|
441
441
|
|
|
442
442
|
# NumPy arrays only allowed for vector goals
|
|
443
443
|
if isinstance(m, np.ndarray):
|
|
@@ -982,8 +982,9 @@ class _GoalProgrammingMixinBase(OptimizationProblem, metaclass=ABCMeta):
|
|
|
982
982
|
if goal.has_target_bounds:
|
|
983
983
|
# We use a violation variable formulation, with the violation
|
|
984
984
|
# variables epsilon bounded between 0 and 1.
|
|
985
|
-
m, M =
|
|
986
|
-
epsilon, np.inf, dtype=np.float64
|
|
985
|
+
m, M = (
|
|
986
|
+
np.full_like(epsilon, -np.inf, dtype=np.float64),
|
|
987
|
+
np.full_like(epsilon, np.inf, dtype=np.float64),
|
|
987
988
|
)
|
|
988
989
|
|
|
989
990
|
# A function range does not have to be specified for critical
|
|
@@ -334,7 +334,7 @@ class ModelicaMixin(OptimizationProblem):
|
|
|
334
334
|
try:
|
|
335
335
|
(m, M) = bounds[sym_name]
|
|
336
336
|
except KeyError:
|
|
337
|
-
if self.__python_types.get(sym_name, float)
|
|
337
|
+
if self.__python_types.get(sym_name, float) is bool:
|
|
338
338
|
(m, M) = (0, 1)
|
|
339
339
|
else:
|
|
340
340
|
(m, M) = (-np.inf, np.inf)
|
|
@@ -408,7 +408,7 @@ class ModelicaMixin(OptimizationProblem):
|
|
|
408
408
|
return seed
|
|
409
409
|
|
|
410
410
|
def variable_is_discrete(self, variable):
|
|
411
|
-
return self.__python_types.get(variable, float)
|
|
411
|
+
return self.__python_types.get(variable, float) is not float
|
|
412
412
|
|
|
413
413
|
@property
|
|
414
414
|
@cached
|
|
@@ -285,8 +285,8 @@ class PIMixin(IOMixin):
|
|
|
285
285
|
:param variable: Time series ID.
|
|
286
286
|
:param unit: Unit.
|
|
287
287
|
"""
|
|
288
|
-
assert hasattr(
|
|
289
|
-
|
|
290
|
-
)
|
|
288
|
+
assert hasattr(self, "_PIMixin__timeseries_import"), (
|
|
289
|
+
"set_unit can only be called after read() in pre() has finished."
|
|
290
|
+
)
|
|
291
291
|
self.__timeseries_import.set_unit(variable, unit, 0)
|
|
292
292
|
self.__timeseries_export.set_unit(variable, unit, 0)
|
rtctools/simulation/io_mixin.py
CHANGED
|
@@ -94,7 +94,7 @@ class IOMixin(SimulationProblem, metaclass=ABCMeta):
|
|
|
94
94
|
self.__cache_loop_timeseries = {}
|
|
95
95
|
|
|
96
96
|
timeseries_names = set(self.io.get_timeseries_names(0))
|
|
97
|
-
for v in self.
|
|
97
|
+
for v in self.get_input_variables():
|
|
98
98
|
if v in timeseries_names:
|
|
99
99
|
_, values = self.io.get_timeseries_sec(v)
|
|
100
100
|
self.__cache_loop_timeseries[v] = values
|
rtctools/simulation/pi_mixin.py
CHANGED
|
@@ -248,8 +248,8 @@ class PIMixin(IOMixin):
|
|
|
248
248
|
:param variable: Time series ID.
|
|
249
249
|
:param unit: Unit.
|
|
250
250
|
"""
|
|
251
|
-
assert hasattr(
|
|
252
|
-
|
|
253
|
-
)
|
|
251
|
+
assert hasattr(self, "_PIMixin__timeseries_import"), (
|
|
252
|
+
"set_unit can only be called after read() in pre() has finished."
|
|
253
|
+
)
|
|
254
254
|
self.__timeseries_import.set_unit(variable, unit, 0)
|
|
255
255
|
self.__timeseries_export.set_unit(variable, unit, 0)
|
|
@@ -500,8 +500,9 @@ class SimulationProblem(DataStoreAccessor):
|
|
|
500
500
|
self.set_var(var_name, numeric_start_val)
|
|
501
501
|
except KeyError:
|
|
502
502
|
logger.warning(
|
|
503
|
-
"Initialize: {} not found in state vector. "
|
|
504
|
-
|
|
503
|
+
"Initialize: {} not found in state vector. Initial value of {} not set.".format(
|
|
504
|
+
var_name, numeric_start_val
|
|
505
|
+
)
|
|
505
506
|
)
|
|
506
507
|
|
|
507
508
|
# Add a residual for the difference between the state and its starting expression
|
|
@@ -525,10 +526,14 @@ class SimulationProblem(DataStoreAccessor):
|
|
|
525
526
|
# Check that the start_value is in between the variable bounds.
|
|
526
527
|
if start_is_numeric and not min_is_symbolic and not max_is_symbolic:
|
|
527
528
|
if not (var.min <= start_val and start_val <= var.max):
|
|
528
|
-
logger.
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
logger.log(
|
|
530
|
+
(
|
|
531
|
+
logging.WARNING
|
|
532
|
+
if source_description != "modelica file or default value"
|
|
533
|
+
else logging.DEBUG
|
|
534
|
+
),
|
|
535
|
+
f"Initialize: start value {var_name} = {start_val} "
|
|
536
|
+
f"is not in between bounds {var.min} and {var.max} and will be adjusted.",
|
|
532
537
|
)
|
|
533
538
|
|
|
534
539
|
# Default start var for ders is zero
|
|
@@ -1067,9 +1072,9 @@ class SimulationProblem(DataStoreAccessor):
|
|
|
1067
1072
|
:param dt: Timestep size of the simulation.
|
|
1068
1073
|
"""
|
|
1069
1074
|
if self._dt_is_fixed:
|
|
1070
|
-
assert math.isclose(
|
|
1071
|
-
|
|
1072
|
-
)
|
|
1075
|
+
assert math.isclose(self.__dt, dt), (
|
|
1076
|
+
"Timestep size dt is marked as constant and cannot be changed."
|
|
1077
|
+
)
|
|
1073
1078
|
else:
|
|
1074
1079
|
self.__dt = dt
|
|
1075
1080
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|