Conditions | 2 |
Total Lines | 38 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """Create a basic scenario from the internal data structure. |
||
11 | def scenario_feedin(regions, year, name, weather_year=None): |
||
12 | """ |
||
13 | |||
14 | Parameters |
||
15 | ---------- |
||
16 | regions |
||
17 | year |
||
18 | name |
||
19 | weather_year |
||
20 | |||
21 | Returns |
||
22 | ------- |
||
23 | |||
24 | Examples |
||
25 | -------- |
||
26 | >>> from reegis import geometries # doctest: +SKIP |
||
27 | >>> fs=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 |