Small fixes (#167)
* update mocksnakemake for testing * remove trailing whitespace in n.loads index * add missing color for H2 liquification * adjust to default lifetime 0 instead of NaN
This commit is contained in:
parent
71be53af4f
commit
28264aa114
@ -420,6 +420,7 @@ plotting:
|
||||
lines: k
|
||||
transmission lines: k
|
||||
H2: m
|
||||
H2 liquefaction: m
|
||||
hydrogen storage: m
|
||||
battery: slategray
|
||||
battery storage: slategray
|
||||
|
@ -28,7 +28,7 @@ def add_build_year_to_new_assets(n, baseyear):
|
||||
# Give assets with lifetimes and no build year the build year baseyear
|
||||
for c in n.iterate_components(["Link", "Generator", "Store"]):
|
||||
|
||||
assets = c.df.index[~c.df.lifetime.isna() & c.df.build_year.isna()]
|
||||
assets = c.df.index[~c.df.lifetime.isna() & c.df.build_year==0]
|
||||
c.df.loc[assets, "build_year"] = baseyear
|
||||
|
||||
# add -baseyear to name
|
||||
@ -410,7 +410,8 @@ if __name__ == "__main__":
|
||||
simpl='',
|
||||
clusters=45,
|
||||
lv=1.0,
|
||||
sector_opts='Co2L0-168H-T-H-B-I-solar3-dist1',
|
||||
opts='',
|
||||
sector_opts='Co2L0-168H-T-H-B-I-solar+p3-dist1',
|
||||
planning_horizons=2020,
|
||||
)
|
||||
|
||||
|
@ -523,10 +523,11 @@ if __name__ == "__main__":
|
||||
snakemake = mock_snakemake(
|
||||
'plot_network',
|
||||
simpl='',
|
||||
clusters=48,
|
||||
lv=1.0,
|
||||
sector_opts='Co2L0-168H-T-H-B-I-solar3-dist1',
|
||||
planning_horizons=2050,
|
||||
clusters=45,
|
||||
lv=1.5,
|
||||
opts='',
|
||||
sector_opts='Co2L0-168H-T-H-B-I-solar+p3-dist1',
|
||||
planning_horizons=2030,
|
||||
)
|
||||
|
||||
overrides = override_component_attrs(snakemake.input.overrides)
|
||||
|
@ -270,6 +270,9 @@ def patch_electricity_network(n):
|
||||
update_wind_solar_costs(n, costs)
|
||||
n.loads["carrier"] = "electricity"
|
||||
n.buses["location"] = n.buses.index
|
||||
# remove trailing white space of load index until new PyPSA version after v0.18.
|
||||
n.loads.rename(lambda x: x.strip(), inplace=True)
|
||||
n.loads_t.p_set.rename(lambda x: x.strip(), axis=1, inplace=True)
|
||||
|
||||
|
||||
def add_co2_tracking(n, options):
|
||||
@ -2007,10 +2010,11 @@ if __name__ == "__main__":
|
||||
snakemake = mock_snakemake(
|
||||
'prepare_sector_network',
|
||||
simpl='',
|
||||
clusters=48,
|
||||
clusters=45,
|
||||
lv=1.0,
|
||||
opts='',
|
||||
sector_opts='Co2L0-168H-T-H-B-I-solar3-dist1',
|
||||
planning_horizons=2020,
|
||||
planning_horizons=2030,
|
||||
)
|
||||
|
||||
logging.basicConfig(level=snakemake.config['logging_level'])
|
||||
|
Loading…
Reference in New Issue
Block a user