Commit Graph

88 Commits

Author SHA1 Message Date
martavp
201e4d2f57 simplify make_summary and plot_summary since now overnight also includes planning_horizons and carbon_budget_name 2020-07-08 16:35:50 +02:00
martavp
cf3c45321e include planning_horizons and co2_budget_name in multindex if options['foresight']='myopic' 2020-07-07 18:42:25 +02:00
Fabian Neumann
5ea29551b9
add REUSE.software license information (#160)
* add REUSE.software license information

* add release note on licensing

* Update doc/index.rst

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>

* Update doc/index.rst

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>

* Update doc/release_notes.rst [skip travis]

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
2020-05-29 09:50:55 +02:00
Tom Brown
eb34356722 make_summary: Remove erroneous power outputs for non-multi links
This bug in PyPSA was fixed in:

f484adc876
2020-05-13 13:25:32 +02:00
Tom Brown
bdb3c8886d make_summary.py: Fix so that it works with simpl != ""
Non-empty simpl is needed for cases where the resource resolution
is higher than the network resolution, e.g.

simpl = 70
cluster = 37m
2020-05-07 18:16:28 +02:00
Tom Brown
0df8fc50cf Summaries and plotting: Fix groupby with two bys for pandas 1.0.x 2020-03-25 16:42:38 +01:00
Tom Brown
180846945f Fix bug in ordering of MultiIndex in make_summary.py
df.loc[idx[a,b,some_list],label] does NOT preserve the ordering of
some_list, but sorts it instead. Therefore the pattern:

df.loc[idx[a,b,s.index],label] = s.values

was mismatching the index and values.
2019-12-19 11:40:17 +01:00
FabianHofmann
eaf30a9b65
Introduce mocksnakemake which acutally parses Snakefile (#107)
* rewrite mocksnakemake for parsing real Snakefile

* continue add function to scripts

* going through all scripts, setting new mocksnakemake

* fix plotting scripts

* fix build_country_flh

* fix build_country_flh II

* adjust config files

* fix make_summary for tutorial network

* create dir also for output

* incorporate suggestions

* consistent import of mocksnakemake

* consistent import of mocksnakemake II

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/plot_network.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/plot_network.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/retrieve_databundle.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* use pathlib for mocksnakemake

* rename mocksnakemake into mock_snakemake

* revert change in data

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* remove setting logfile in mock_snakemake, use Path in configure_logging

* fix fallback path and base_dir
fix return type of make_io_accessable

* reformulate mock_snakemake

* incorporate suggestion, fix typos

* mock_snakemake: apply absolute paths again, add assertion error
*.py: make hard coded io path accessable for mock_snakemake

* retrieve_natura_raster: use snakemake.output for fn_out

* include suggestion

* Apply suggestions from code review

Co-Authored-By: Jonas Hörsch <jonas.hoersch@posteo.de>

* linting, add return ad end of file

* Update scripts/plot_p_nom_max.py

Co-Authored-By: Jonas Hörsch <jonas.hoersch@posteo.de>

* Update scripts/plot_p_nom_max.py

fixes #112

Co-Authored-By: Jonas Hörsch <jonas.hoersch@posteo.de>

* plot_p_nom_max: small correction

* config.tutorial.yaml fix snapshots end

* use techs instead of technology

* revert try out from previous commit, complete replacing

* change clusters -> clusts in plot_p_nom_max due to wildcard constraints of clusters

* change clusters -> clusts in plot_p_nom_max due to wildcard constraints of clusters II
2019-12-09 21:29:15 +01:00
Tom Brown
ec9b447949 make_summary: Account for multi-links in supply* summaries 2019-12-06 17:40:20 +01:00
Tom Brown
80642ae9af Fix post-processing to read nomopyomo nc; fix MultiIndex issue
With new pandas:

pd.Index([])|pd.MultiIndex(...)

returns a pd.Index, not a pd.MultiIndex, so just reversed:

pd.MultiIndex(...)|pd.Index([])

This returns a pd.MultiIndex.
2019-12-06 16:56:33 +01:00
euronion
85c356297a Add logging to logfiles to all snakemake workflow scripts. (#102)
* Add logging to logfiles to all snakemake workflow scripts.

* Fix missing quotation marks in Snakefile.

* Apply suggestions from code review

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* Apply suggestions from code review

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* doc: fix _ec_ filenames in docs

* Allow logging message format to be specified in config.yaml.

* Add logging for Snakemake rule 'retrieve_databundle '.

* Add limited logging to STDERR only for retrieve_*.py scripts.

* Import progressbar module only on demand.

* Fix logging to file and enable concurrent printing to STDERR for most scripts.

* Add new 'logging_format' option to Travis CI test config.yaml.

* Add missing parenthesis (bug fix) and cross-os compatible paths.

* Fix typos in messages.

* Use correct log files for logging (bug fix).

* doc: fix line references

* config: logging_format in all configs

* doc: add doc for logging_format

* environment: update to powerplantmatching 0.4.3

* doc: update line references for tutorial.rst

* Change logging configuration scheme for config.yaml.

* Add helper function for doing basic logging configuration.

* Add logpath for prepare_links_p_nom rule.

* Outsource basic logging configuration for all scripts to _helper submodule.

* Update documentation for changed config.yaml structure.

Instead of 'logging_level' and 'logging_format', now 'logging' with subcategories is used.

* _helpers: Change configure_logging signature.
2019-11-28 08:22:52 +01:00
Fabian
e59d2c4162 scripts/* revise imports 2019-11-14 17:50:24 +01:00
FabianHofmann
7e3ea94a53
Merge pull request #76 from euronion/patch-1
Update make_summary for pandas-0.25 compatability.
2019-10-25 15:41:29 +02:00
euronion
da0107478e
Refractor make_summary.py multiindex creation.
Outsource the pd.MultiIndex and pd.Index union into dedicated function and remove C&P code snippets.
2019-10-25 14:29:38 +02:00
euronion
a401d80300
Fix more pandas Index issues in make_summary. 2019-10-24 10:53:07 +02:00
euronion
dfc0242a2d
Update make_summary for pandas-0.25 compatability.
The pandas Index union operation does no longer produce a MultiIndex but a Index tuple in pandas-0.25.2.
This causes the script to fail. (The problem does not exist with pandas-0.24.0.)

Fix by explicitly checking for this case (only the first loop iteration).
2019-10-24 09:54:50 +02:00
Fabian Neumann
3a94d4f5ef add seealso from module description to config documentatoin 2019-08-13 10:03:46 +02:00
Fabian Neumann
4d3d898430 remove trialed sphinx-bibtex and describe wildcards 2019-08-12 23:48:16 +02:00
Fabian Neumann
a5d9bc9c7c add input/output descriptions (WIP) 2019-08-11 22:34:18 +02:00
Fabian Neumann
67cf28b593 fill in relevant settings sections 2019-08-11 13:17:36 +02:00
Fabian Neumann
1bded0ab9b add rule section headers 2019-08-11 11:40:47 +02:00
Jonas Hoersch
fb0d44f64e Add a summary sentence for each rule taken from scripts 2019-08-08 15:07:08 +02:00
Fabian Neumann
7a4e9f22d4 configuration table descriptions 2019-08-07 10:56:23 +02:00
Tom Brown
7e37dbbd03 Include multi-link outputs in energy balance 2019-07-21 12:11:05 +02:00
Tom Brown
ddca9afcc7 Give all loads a carrier; rename heat buses; fix district h losses
Heat buses renamed to:

rural (for low-density areas where district heating not possible)

urban decentral (for high-density areas without district heating and
individual heating technologies) (used to be called "urban")

urban central (for high-density areas with district heating) (used to
be called "central")

District heating losses applied only to urban central.
2019-07-16 16:00:21 +02:00
Tom Brown
6cc676d6cf 190516: Try removing H2 network too 2019-07-12 08:51:25 +02:00
Tom Brown
52a02bd979 Compute cfs; compute nodal costs, capacities, cfs; fix prices 2019-05-13 16:48:29 +02:00
Tom Brown
5357b7b92f Record total capacities and total costs 2019-05-03 17:11:13 +02:00
Tom Brown
c47ffb8d03 Changes for 190501-256 2019-05-02 08:39:29 +02:00
Tom Brown
3b0e0dfb3a Changes to make solving and post-processing work 2019-04-18 12:12:38 +02:00
Tom Brown
cfe44ce702 Copy solve_network.py and *_summary.py from pypsa-eur sector branch 2019-04-18 11:39:17 +02:00
Jonas Hoersch
7f3f096ba6 Fix model for country selections without DC links (fixes #5) 2019-02-13 19:03:57 +01:00
Jonas Hoersch
15e986a0ec make_summary: Update summary creation for new line volume/cost constraints
Fixes #4.
2019-02-10 16:08:39 +01:00
Jonas Hörsch
761b1b998f make_summary: Add summary about capacities and allow single country summaries 2018-11-12 22:00:50 +01:00
Jonas Hörsch
5b201de7d4 {make,plot}_summary: Add rules to flexibly create summaries and plot them 2018-10-26 10:28:54 +02:00
Tom Brown
540985164f Plot summary; take account of snapshot weightings correctly 2018-10-23 17:02:03 +02:00
Tom Brown
f3a12e7aee Add CSV summaries 2018-10-23 17:00:06 +02:00
Jonas Hörsch
71512c15a5 Copy over make_summary.py from sector branch co2 2018-10-23 16:59:41 +02:00