(nonmodular, raise_errors)
| 73 | |
| 74 | |
| 75 | def get_grid_module(nonmodular, raise_errors): |
| 76 | max_import = nonmodular.grid.power_import |
| 77 | max_export = nonmodular.grid.power_export |
| 78 | cost_per_unit_co2 = nonmodular.parameters.cost_co2.item() |
| 79 | |
| 80 | cost_import = nonmodular._grid_price_import.squeeze() |
| 81 | cost_import.name = 'cost_import' |
| 82 | cost_export = nonmodular._grid_price_export.squeeze() |
| 83 | cost_export.name = 'cost_export' |
| 84 | co2_per_unit = nonmodular._grid_co2.squeeze() |
| 85 | co2_per_unit.name = 'co2_per_unit_production' |
| 86 | grid_status = nonmodular._grid_status_ts.squeeze() |
| 87 | grid_status.name = 'grid_status' |
| 88 | time_series = pd.concat([cost_import, cost_export, co2_per_unit, grid_status], axis=1) |
| 89 | |
| 90 | return GridModule(max_import=max_import, |
| 91 | max_export=max_export, |
| 92 | time_series=time_series, |
| 93 | forecaster='oracle', |
| 94 | forecast_horizon=nonmodular.horizon - 1, |
| 95 | cost_per_unit_co2=cost_per_unit_co2, |
| 96 | raise_errors=raise_errors) |
| 97 | |
| 98 | |
| 99 | def get_unbalanced_energy_module(nonmodular, raise_errors): |
no test coverage detected