| Total Complexity | 1 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | |||
| 3 | """Tests for Flows with NonConvex attribute |
||
| 4 | |||
| 5 | SPDX-FileCopyrightText: Deutsches Zentrum für Luft- und Raumfahrt e.V. |
||
| 6 | SPDX-FileCopyrightText: Patrik Schönfeldt |
||
| 7 | |||
| 8 | SPDX-License-Identifier: MIT |
||
| 9 | """ |
||
| 10 | |||
| 11 | import pandas as pd |
||
| 12 | |||
| 13 | from oemof import solph |
||
| 14 | |||
| 15 | |||
| 16 | def _run_flow_model(flow): |
||
| 17 | date_time_index = pd.date_range("1/1/2012", periods=10, freq="h") |
||
| 18 | energysystem = solph.EnergySystem( |
||
| 19 | timeindex=date_time_index, |
||
| 20 | infer_last_interval=True, |
||
| 21 | ) |
||
| 22 | bus = solph.buses.Bus(label="bus", balanced=False) |
||
| 23 | energysystem.add(bus) |
||
| 24 | |||
| 25 | bus.inputs[bus] = flow |
||
| 26 | |||
| 27 | model = solph.Model(energysystem) |
||
| 28 | model.solve() |
||
| 29 | |||
| 30 | return solph.processing.results(model)[(bus, bus)]["sequences"] |
||
| 31 |