Commit Graph

115 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
f128cc3e3c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-03-09 07:36:43 +00:00
Fabian Neumann
483f3e1b82 eliminate manual country code conversion, adjust mock_snakemake to ll wildcard 2023-03-09 08:36:18 +01:00
Fabian
5cf2b8174a scripts: apply linting fixes 2023-03-07 17:21:00 +01:00
Fabian Neumann
541b83b049 merge helper.py into _helpers.py 2023-03-06 19:16:37 +01:00
Fabian Neumann
3bdf3b6f5e use mock_snakemake from pypsa-eur 2023-03-06 19:09:45 +01:00
Fabian Neumann
93d9e13f52 add spdx identifiers to scripts 2023-03-06 18:49:23 +01:00
pre-commit-ci[bot]
b7c58883b7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-03-06 16:19:25 +00:00
Fabian Neumann
76d57731ec fix all lv references to ll, pickup right location of default lifetime 2023-03-06 17:18:07 +01:00
Fabian Neumann
d27fee7e77 align cost fill values to pypsa-eur implementation 2023-03-06 14:47:46 +01:00
Fabian Neumann
b30ff67458 remove unneeded currency conversion USD to EUR 2023-03-06 14:38:04 +01:00
Fabian Neumann
ee5a0c4e73 conform to pypsa-eur logging level definition 2023-03-06 14:27:15 +01:00
pre-commit-ci[bot]
13769f90af [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-03-06 08:27:46 +00:00
Fabian Neumann
6d98edb320
Merge pull request #314 from PyPSA/loggin-replace-print
Replacing print statement with logging
2023-03-05 15:07:10 +01:00
virio-andreyana
379ed0da93 Sentence capitalized 2023-02-24 14:42:51 +01:00
virio-andreyana
d237e60b25 Replacing print statement with logging 2023-02-23 10:30:32 +01:00
lisazeyen
332936bcec adjust p_nom_max if existing larger 2023-02-22 17:44:05 +01:00
Fabian Neumann
b14d657042 minor fixes and address deprecation warnings 2023-02-16 20:13:26 +01:00
Fabian Neumann
4a2da0a5f4
Update scripts/add_existing_baseyear.py 2023-01-30 11:55:40 +01:00
Fabian Neumann
6996748d9b
Merge branch 'master' into cluster_heat_nodes 2023-01-30 11:53:00 +01:00
lisazeyen
5b256bfa5d take VOM for RES from existing 2022-11-28 16:56:42 +01:00
Fabian
df4eb85a19 fix typos 2022-11-18 09:08:07 +01:00
lisazeyen
3daff49c99
Merge pull request #256 from PyPSA/fix-bug-myopic-co2
Fix bug myopic co2
2022-08-09 21:33:31 +02:00
lisazeyen
b42e76040d small clean up 2022-08-09 21:30:45 +02:00
Irieo
1920c2bae1 temporary fix of DateIn and DateOut 2022-08-09 15:30:58 +02:00
lisazeyen
2994c91173 add bioenergy to add_existing 2022-08-08 15:28:04 +02:00
lisazeyen
58b018e624 drop powerplants which are already decommissioned 2022-08-08 13:52:41 +02:00
lisazeyen
7c3b4b6664 split grouping years for power and heat techs 2022-08-02 09:18:06 +02:00
Fabian Neumann
2857691367
Merge pull request #246 from PyPSA/meta
store config and wildcards in n.meta
2022-08-01 21:01:06 +02:00
lisazeyen
cbab86c4bc add heat buses clustering to myopic 2022-08-01 18:15:35 +02:00
lisazeyen
18f4eac351 adjust script to new grouping years 2022-08-01 15:24:07 +02:00
Fabian Neumann
cb00ba58ce add option to specify any config through sector opts with CF:<label>:...:value 2022-07-20 11:35:12 +02:00
Fabian Neumann
b96207c73e store config and wildcards in n.meta 2022-06-30 08:42:18 +02:00
Fabian Neumann
d4a82a2a41
Merge pull request #217 from PyPSA/myopic-fix
Myopic fix
2022-04-12 14:47:22 +02:00
Fabian Neumann
1625d9db75
address recent deprecations (#235)
* address recent deprecations

* address recent deprecations in pd.read_csv
2022-04-12 14:37:05 +02:00
lisazeyen
03fca360ff style improvement 2022-03-21 09:14:15 +01:00
lisazeyen
71a8bc6c96 use define spatial for all conventionals, add lifetime for H2 storage 2022-03-18 13:46:40 +01:00
lisazeyen
cfb5a797cb start to extend define_spatial for conventional carriers 2022-03-18 10:22:00 +01:00
lisazeyen
aed81940b3
add_existing_baseyear.py: Style improvement
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2022-03-17 18:15:14 +01:00
lisazeyen
030bf96d32 update mocksnakemake 2022-01-07 12:45:33 +01:00
lisazeyen
c9ce9190a7 adjust to spatital resolved gas nodes 2022-01-07 12:40:17 +01:00
lisazeyen
b5aa4234ef adjust capital cost of existing renewables to consider e.g. electricity grid connection costs as well 2022-01-07 12:09:02 +01:00
lisazeyen
953e1c883e adjust functions to new default lifetime np.inf instead of previous NaN 2022-01-07 11:38:25 +01:00
lisazeyen
372473d76c update mocksnakemake 2022-01-07 11:32:31 +01:00
Fabian Neumann
ff6d736a89
Merge branch 'master' into myopic-low-clustering-gens 2021-09-30 14:51:45 +02:00
lisazeyen
28264aa114
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
2021-09-27 11:16:12 +02:00
Fabian Neumann
195cabba0c merge master 2021-07-06 09:55:41 +02:00
martavp
103ad49671 Enable use of lower generators clustering than network clustering 2021-07-05 12:19:43 +02:00
Fabian Neumann
1fc1d2a17d
Revision complete (#139)
* ammonia_production: minor cleaning and move into __main__ (#106)

* biomass_potentials: code cleaning and automatic country index inferral (#107)

* Revision: build energy totals (#111)

* blacken

* energy_totals: preliminaries

* energy_totals: update build_swiss

* energy_totals: update build_eurostat

* energy_totals: update build_idees

* energy_totals: update build_energy_totals

* energy_totals: update build_eea_co2

* energy_totals: update build_eurostat_co2

* energy_totals: update build_co2_totals

* energy_totals: update build_transport_data

* energy_totals: add tqdm progressbar to idees

* energy_totals: adjust __main__ section

* energy_totals: handle inputs via Snakefile and config

* energy_totals: handle data and emissions year via config

* energy_totals: fix reading in eurostat for different years

* energy_totals: fix erroneous drop duplicates
This caused problems for waste management in HU and SI

* energy_totals: make scope selection of CO2 or GHG a config option

* Revision: build industrial production per country (#114)

* industry-ppc: format

* industry-ppc: rewrite for performance

* industry-ppc: move reference year to config

* industry-ppct: tidy up and format (#115)

* remove stale industry demand rules (#116)

* industry-epc: rewrite for performance (#117)

* Revision: industrial distribution key (#118)

* industry-distribution: first tidying

* industry-distribution: first tidying

* industry-distribution: fix syntax

* Revision: industrial energy demand per node today (#119)

* industry-epn: minor code cleaning

* industry-epn: remove accidental artifact

* industry-epn: remove accidental artifact II

* industry-ppn: code cleaning (#120)

* minor code cleaning (#121)

* Revision: industry sector ratios (#122)

* sector-ratios: basic reformatting

* sector-ratios: add new read_excel function that filters year already

* sector-ratios: rename jrc to idees

* sector-ratios: rename conv_factor to toe_to_MWh

* sector-ratios: modularise into functions

* Move overriding of component attributes to function and into data (#123)

* move overriding of component attributes to central function and store in separate folder

* fix return of helper.override_component_attrs

* prepare: fix accidental syntax error

* override_component_attrs: bugfix that aligns with pypsa components

* Revision: build population layout (#108)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* config: change path to atlite cutout

* Revision: build clustered population layouts (#112)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* cl_pop_layout: blacken

* cl_pop_layout: turn GeoDataFrame into GeoSeries + code cleaning

* cl_pop_layout: add fraction column which is repeatedly calculated downstream

* Revision: build various heating-related time series (#113)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* cl_pop_layout: blacken

* cl_pop_layout: turn GeoDataFrame into GeoSeries + code cleaning

* gitignore: add .vscode

* heating_profiles: update to new atlite and move into __main__

* heating_profiles: remove extra cutout

* heating_profiles: load regions with .buffer(0) and remove clean_invalid_geometries

* heating_profiles: load regions with .buffer(0) before squeeze()

* heating_profiles: account for transpose of dataarray

* heating_profiles: account for transpose of dataarray in add_exiting_baseyear

* Reduce verbosity of Snakefile (2) (#128)

* tidy Snakefile light

* Snakefile: fix indents

* Snakefile: add missing RDIR

* tidy config by removing quotes and expanding lists (#109)

* bugfix: reorder squeeze() and buffer()

* plot/summary: cosmetic changes including: (#131)

- matplotlibrc for default style and backend
- remove unused config options
- option to configure geomap colors
- option to configure geomap bounds

* solve: align with pypsa-eur using ilopf (#129)

* tidy myopic code scripts (#132)

* use mock_snakemake from pypsa-eur (#133)

* Snakefile: add benchmark files to each rule

* Snakefile: only run build_retro_cost if endogenously optimised

* Snakefile: remove old {network} wildcard constraints

* WIP: Revision: prepare_sector_network (#124)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* cl_pop_layout: blacken

* cl_pop_layout: turn GeoDataFrame into GeoSeries + code cleaning

* move overriding of component attributes to central function and store in separate folder

* prepare: sort imports and remove six dependency

* prepare: remove add_emission_prices

* prepare: remove unused set_line_s_max_pu
This is a function from prepare_network

* prepare: remove unused set_line_volume_limit
This is a PyPSA-Eur function from prepare_network

* prepare: tidy add_co2limit

* remove six dependency

* prepare: tidy code first batch

* prepare: extend override_component_attrs to avoid hacky madd

* prepare: remove hacky madd() for individual components

* prepare: tidy shift function

* prepare: nodes and countries from n.buses not pop_layout

* prepare: tidy loading of pop_layout

* prepare: fix prepare_costs function

* prepare: optimise loading of traffic data

* prepare: move localizer into generate_periodic profiles

* prepare: some formatting of transport data

* prepare: eliminate some code duplication

* prepare: fix remove_h2_network
- only try to remove EU H2 store if it exists
- remove readding nodal Stores because they are never removed

* prepare: move cost adjustment to own function

* prepare: fix a syntax error

* prepare: add investment_year to get() assuming global variable

* prepare: move co2_totals out of prepare_data()

* Snakefile: remove unused prepare_sector_network inputs

* prepare: move limit p/s_nom of lines/links into function

* prepare: tidy add_co2limit file handling

* Snakefile: fix tabs

* override_component_attrs: add n/a defaults

* README: Add network picture to make scope clear

* README: Fix date of preprint (was too optimistic...)

* prepare: move some more config options to config.yaml

* prepare: runtime bugfixes

* fix benchmark path

* adjust plot ylims

* add unit attribute to bus, correct cement capture efficiency

* bugfix: land usage constrained missed inplace operation

Co-authored-by: Tom Brown <tom@nworbmot.org>

* add release notes

* remove old fix_branches() function

* deps: make geopy optional, remove unused imports

* increase default BarConvTol

* get ready for upcoming PyPSA release

* re-remove ** bug

* amend release notes

Co-authored-by: Tom Brown <tom@nworbmot.org>
2021-07-01 20:09:04 +02:00
Fabian Neumann
a156d44f28
remove unused {network} wildcard (#104) 2021-04-29 16:52:35 +02:00
martavp
b7b7407756 Adapt nomenclature from "YearCommissioned" to "DataIn"
This was breaking add_existing_baseyear.py and it is now fixed. Column name for commissioning year in powerplantmatching has changed. Now "DataIn" is used as column name, also when renewable capacities per country are added to the power plants dataframe
2021-01-12 10:46:30 +01:00
Tom Brown
17bf0dfbb1 prepare_costs: use default lifetime from config.yaml
Rather than hard-coding 25 years.
2020-11-30 17:01:14 +01:00
eb5194
5dabdac288 add_existing_baseyear: read input file as .csv 2020-10-02 12:21:31 +02:00
lisazeyen
7fe7dc381f read config.yaml for testing with yaml.safe_load() 2020-09-22 09:32:24 +02:00
Tom Brown
6b40504159 add_existing_baseyears: Correct for p_nom data is thermal output
p_nom in PyPSA is capacity on the input side (from final energy),
whereas existing capacities are given on output side (i.e. heat
delivered).
2020-08-19 12:51:53 +02:00
Tom Brown
6444f7fde9 Weight offshore connection costs with aggregation weight
Rather than taking a mean of the clustered connection costs.

Apply cost update also for overnight scenarios based on planning year.

Add land costs for onshore wind.
2020-08-19 12:41:17 +02:00
martavp
35e1d4b03b fix bug when determining elec_buses 2020-08-17 12:08:49 +02:00
Tom Brown
663e1195e1 Add suffix -year to optimized components before solving
This simplifies the structure of add_brownfield.py dramatically.

Some other changes need to be make elsewhere because of name
changes (e.g. battery constraints in solve_network.py).
2020-08-12 18:08:01 +02:00
Tom Brown
16b05a570d Distribute heating technologies within each country by population 2020-08-11 11:09:39 +02:00
Tom Brown
1d6b6483e0 add_existing_baseyear: Divide p_nom by efficiency for Links
This is because the p_nom of a Link is the thermal capacity at bus0,
whereas the capacities we have are the electrical capacity at bus1.
2020-08-11 09:55:39 +02:00
Tom Brown
658f8ad00c Distribute existing power plants to the correct nodes
Previously they were distributed only by country to the first node in
the country.

Now conventional power plants are assigned to the correct node using
the bus map from PyPSA-Eur.

Wind and solar are distributed in each country by capacity factor.

The code has been refactored and a bug was fixed whereby total
capacities of wind and solar in each country were not correct.

Now the years in the config.yaml for myopic are integers not strings.
2020-08-10 20:30:29 +02:00
Tom Brown
ece21bfdfa add_existing_baseyear.py: Add carrier to conventional generators 2020-07-30 08:22:27 +02:00
martavp
4523f324cd Group the generators existing before base year into categories and add them to the network as e.g. solar-2005, solar-2010, solar-2015 2020-07-18 11:22:30 +02:00
martavp
7d1500604f import prepare_cost function from prepare_sector_network 2020-07-14 13:28:10 +02:00
martavp
a4c22a29a4 Remove generators, stores and links whose installationYear + lifetime < year. Correct commented lines to YearDecomissioning > year 2020-07-08 16:28:08 +02:00
martavp
95f80aeba7 Add scripts to (a) include existing power and heating capacities installed before the base year, and (b) add to year n, capacities optimized in year n-1.
Existing onwind and offwind capacity are now read from IRENA database, similarly to solar capacities. Previously we were using thewindpower.net database which is not open.
2020-07-07 18:26:31 +02:00