rtc-tools-interface 0.7.3__tar.gz → 0.7.5__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.
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/PKG-INFO +1 -1
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/README.md +1 -1
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/PKG-INFO +1 -1
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/_version.py +3 -3
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/plotting/plot_tools.py +1 -1
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/simulation/plot_mixin.py +23 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/results_collection.py +1 -1
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/COPYING.LESSER +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/SOURCES.txt +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/dependency_links.txt +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/requires.txt +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/top_level.txt +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/base_goal.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/base_optimization_problem.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/goal_generator_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/goal_performance_metrics.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/goal_table_schema.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/helpers/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/helpers/statistics_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/plot_goals_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/plot_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/read_goals.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/plotting/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/plotting/subplot_classes.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/simulation/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/simulation/base_simulation_problem.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/plot_table_schema.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/read_goals_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/read_plot_table.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/serialization.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/type_definitions.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/setup.cfg +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/setup.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/test_base_optimization_problem.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/test_passing_goals_directly.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/test_plot_goals_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/test_read_goals.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/simulation/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/simulation/test_base_simulation_problem.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/simulation/test_plot_mixin.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/utils/__init__.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/utils/get_test.py +0 -0
- {rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/versioneer.py +0 -0
|
@@ -163,4 +163,4 @@ The table could thus look like:
|
|
|
163
163
|
| | Volume (\$m^3\$) | | | electricity_cost | "Goal for minimizing electricity cost, at priority 10" | python
|
|
164
164
|
|
|
165
165
|
|
|
166
|
-
After running the model, in your output folder the folder `
|
|
166
|
+
After running the model, in your output folder the folder `figures` containing the figures is created.
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2024-
|
|
11
|
+
"date": "2024-05-07T16:13:24+0200",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "0.7.
|
|
14
|
+
"full-revisionid": "af2a5c1b89eab1ec3446493bf214a9a157408bdb",
|
|
15
|
+
"version": "0.7.5"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/plotting/plot_tools.py
RENAMED
|
@@ -40,7 +40,7 @@ def get_subplot_axis(i_plot, n_rows, n_cols, axs):
|
|
|
40
40
|
|
|
41
41
|
def get_file_write_path(output_folder: Union[str, Path], file_name="figure"):
|
|
42
42
|
"""Get path to to file."""
|
|
43
|
-
new_output_folder = Path(output_folder) / "
|
|
43
|
+
new_output_folder = Path(output_folder) / "figures"
|
|
44
44
|
os.makedirs(new_output_folder, exist_ok=True)
|
|
45
45
|
return os.path.join(new_output_folder, file_name)
|
|
46
46
|
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/simulation/plot_mixin.py
RENAMED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"""Mixin to store all required data for plotting. Can also call the plot function."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from typing import Dict, List
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
4
7
|
|
|
5
8
|
from rtctools_interface.plotting.plot_tools import create_plot_final_results
|
|
6
9
|
from rtctools_interface.utils.results_collection import PlottingBaseMixin
|
|
@@ -14,6 +17,23 @@ class PlotMixin(PlottingBaseMixin):
|
|
|
14
17
|
"""
|
|
15
18
|
|
|
16
19
|
optimization_problem = False
|
|
20
|
+
_manual_extracted_states: Dict[str, list] = {}
|
|
21
|
+
|
|
22
|
+
def manual_extraction_from_state_vector(self):
|
|
23
|
+
for variable in self.custom_variables:
|
|
24
|
+
try:
|
|
25
|
+
self._manual_extracted_states[variable].append(self.get_var(variable))
|
|
26
|
+
except KeyError:
|
|
27
|
+
logger.debug("Variable {} not found in output of model.".format(variable))
|
|
28
|
+
|
|
29
|
+
def initialize(self):
|
|
30
|
+
super().initialize()
|
|
31
|
+
self._manual_extracted_states = {variable: [] for variable in self.custom_variables}
|
|
32
|
+
self.manual_extraction_from_state_vector()
|
|
33
|
+
|
|
34
|
+
def update(self, dt):
|
|
35
|
+
super().update(dt)
|
|
36
|
+
self.manual_extraction_from_state_vector()
|
|
17
37
|
|
|
18
38
|
def post(self):
|
|
19
39
|
"""Tasks after optimizing."""
|
|
@@ -26,3 +46,6 @@ class PlotMixin(PlottingBaseMixin):
|
|
|
26
46
|
|
|
27
47
|
if self.plot_final_results:
|
|
28
48
|
create_plot_final_results(current_run, self._previous_run, plotting_library=self.plotting_library)
|
|
49
|
+
|
|
50
|
+
def collect_timeseries_data(self, all_variables_to_store: List[str]) -> Dict[str, np.ndarray]:
|
|
51
|
+
return {variable: np.array(self._manual_extracted_states[variable]) for variable in all_variables_to_store}
|
|
@@ -152,7 +152,7 @@ class PlottingBaseMixin(ReadGoalsMixin):
|
|
|
152
152
|
timeseries_data[timeseries_name] = extracted_results[timeseries_name]
|
|
153
153
|
except KeyError:
|
|
154
154
|
try:
|
|
155
|
-
timeseries_data[timeseries_name] = self.get_timeseries(timeseries_name)
|
|
155
|
+
timeseries_data[timeseries_name] = self.io.get_timeseries(timeseries_name)[1]
|
|
156
156
|
except KeyError as exc:
|
|
157
157
|
raise KeyError("Cannot find timeseries for %s" % timeseries_name) from exc
|
|
158
158
|
return timeseries_data
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtc_tools_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/__init__.py
RENAMED
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/optimization/base_goal.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
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/plotting/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/simulation/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/read_goals_mixin.py
RENAMED
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/read_plot_table.py
RENAMED
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/serialization.py
RENAMED
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/rtctools_interface/utils/type_definitions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/test_plot_goals_mixin.py
RENAMED
|
File without changes
|
{rtc-tools-interface-0.7.3 → rtc-tools-interface-0.7.5}/tests/optimization/test_read_goals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|