Commit b8a66dae authored by Jorn Baayen's avatar Jorn Baayen

Port PIMixin

parent 759d9e82
...@@ -183,7 +183,7 @@ class PIMixin(OptimizationProblem): ...@@ -183,7 +183,7 @@ class PIMixin(OptimizationProblem):
# Load bounds from timeseries # Load bounds from timeseries
for variable in self.dae_variables['constant_inputs']: for variable in self.dae_variables['constant_inputs']:
variable = variable.getName() variable = variable.name()
try: try:
timeseries = Timeseries( timeseries = Timeseries(
self._timeseries_import_times, self._timeseries_import_dict[ensemble_member][variable]) self._timeseries_import_times, self._timeseries_import_dict[ensemble_member][variable])
...@@ -204,7 +204,7 @@ class PIMixin(OptimizationProblem): ...@@ -204,7 +204,7 @@ class PIMixin(OptimizationProblem):
# Load bounds from timeseries # Load bounds from timeseries
for variable in self.dae_variables['free_variables']: for variable in self.dae_variables['free_variables']:
variable = variable.getName() variable = variable.name()
m, M = None, None m, M = None, None
...@@ -248,7 +248,7 @@ class PIMixin(OptimizationProblem): ...@@ -248,7 +248,7 @@ class PIMixin(OptimizationProblem):
# Load history # Load history
history = AliasDict(self.alias_relation) history = AliasDict(self.alias_relation)
for variable in self.dae_variables['states'] + self.dae_variables['algebraics'] + self.dae_variables['control_inputs'] + self.dae_variables['constant_inputs']: for variable in self.dae_variables['states'] + self.dae_variables['algebraics'] + self.dae_variables['control_inputs'] + self.dae_variables['constant_inputs']:
variable = variable.getName() variable = variable.name()
try: try:
history[variable] = Timeseries(self._timeseries_import_times[:self._timeseries_import.forecast_index + 1], history[variable] = Timeseries(self._timeseries_import_times[:self._timeseries_import.forecast_index + 1],
self._timeseries_import_dict[ensemble_member][variable][:self._timeseries_import.forecast_index + 1]) self._timeseries_import_dict[ensemble_member][variable][:self._timeseries_import.forecast_index + 1])
...@@ -275,7 +275,7 @@ class PIMixin(OptimizationProblem): ...@@ -275,7 +275,7 @@ class PIMixin(OptimizationProblem):
# Load seeds # Load seeds
for variable in self.dae_variables['free_variables']: for variable in self.dae_variables['free_variables']:
variable = variable.getName() variable = variable.name()
try: try:
s = Timeseries(self._timeseries_import_times, self._timeseries_import_dict[ensemble_member][variable]) s = Timeseries(self._timeseries_import_times, self._timeseries_import_dict[ensemble_member][variable])
except KeyError: except KeyError:
...@@ -319,7 +319,7 @@ class PIMixin(OptimizationProblem): ...@@ -319,7 +319,7 @@ class PIMixin(OptimizationProblem):
# For all variables that are output variables the values are # For all variables that are output variables the values are
# extracted from the results. # extracted from the results.
for variable in [sym.getName() for sym in self.output_variables]: for variable in [sym.name() for sym in self.output_variables]:
try: try:
values = results[variable] values = results[variable]
if len(values) != len(times): if len(values) != len(times):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment