| Conditions | 2 |
| Total Lines | 37 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Create a basic scenario from the internal data structure. |
||
| 12 | def scenario_feedin(regions, year, name, weather_year=None): |
||
| 13 | """ |
||
| 14 | |||
| 15 | Parameters |
||
| 16 | ---------- |
||
| 17 | regions |
||
| 18 | year |
||
| 19 | name |
||
| 20 | weather_year |
||
| 21 | |||
| 22 | Returns |
||
| 23 | ------- |
||
| 24 | |||
| 25 | Examples |
||
| 26 | -------- |
||
| 27 | >>> regions = geometries.get_federal_states_polygon() # doctest: +SKIP |
||
| 28 | >>> f = scenario_feedin(regions, 2014, "fs") # doctest: +SKIP |
||
| 29 | >>> f["NI"].sum() # doctest: +SKIP |
||
| 30 | geothermal 4380.000000 |
||
| 31 | hydro 2242.134748 |
||
| 32 | solar 831.424963 |
||
| 33 | wind 2602.090478 |
||
| 34 | dtype: float64 |
||
| 35 | >>> f["BY"].sum() # doctest: +SKIP |
||
| 36 | geothermal 4380.000000 |
||
| 37 | hydro 2242.134748 |
||
| 38 | solar 849.019372 |
||
| 39 | wind 1279.604124 |
||
| 40 | dtype: float64 |
||
| 41 | """ |
||
| 42 | wy = weather_year |
||
| 43 | try: |
||
| 44 | feedin = coastdat.scenario_feedin(year, name, weather_year=wy) |
||
| 45 | except FileNotFoundError: |
||
| 46 | coastdat.get_feedin_per_region(year, regions, name, weather_year=wy) |
||
| 47 | feedin = coastdat.scenario_feedin(year, name, weather_year=wy) |
||
| 48 | return feedin |
||
| 49 |