Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request
Bugfix for
approximate_missing_eia_stats()
If ES or PT were not present in the list of optimized countries, the IEA hydropower approximation would fail, i.e.
approximate_missing_eia_stats()
. Therefore runs, where the optioneia_approximate_missing
was activated would fail for weather years not part of the IEA data. The functoin would throw a key error:KeyError: "None of [Index(['ES', 'PT'], dtype='object', name='name')] are in the [index]"
The reason is that
approximate_missing_eia_stats()
overwrites anomalous years for 'ES' and 'PT'. By checking if the countries are present before overwriting the data, the bug can be fixed:if ("ES") in runoff:
runoff.loc[1978, ["ES"]] = runoff.loc[1979, ["ES"]]
if ("PT") in runoff:
runoff.loc[1978, ["PT"]] = runoff.loc[1979, ["PT"]]
Bugfix for
manual_adjustment()
The
copy_timeslice()
procedure will add countries to the load data which are not present in the countries list, if afn_load
object is provided. Ifmanual_adjustment()
is called, which usescopy_timeslice()
, this will partly add data for some countries such as GB. Later on, this causes anAssertionError: Load data contains nans.
Checklist
envs/environment.yaml
.config.default.yaml
.doc/configtables/*.csv
.doc/release_notes.rst
is added.