Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingmar Schlecht committed Feb 28, 2018
1 parent 2dafa15 commit 0638acc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
12 changes: 6 additions & 6 deletions checksums.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
renewable_capacity_timeseries_DE.csv,eb074a32c3506fe64df2e6c8680f2b3187c98ff2dc48fd8b7721d4a3c09c246e
renewable_power_plants.sqlite,71bd82c03b74975dba0de53ffb4421595af69f2a8163f92313f76d34745d6fc1
renewable_power_plants.xlsx,66cbba7ce1bd1926a77c5604cd120c2c0d071c9608870946bd36636303e109b9
renewable_capacity_timeseries_DE.csv,99b7473fcc53cba3e4945f9dfed07690e258f3fb88d07369dff1fdea19f415d2
renewable_power_plants.sqlite,0292ef23b9b2f2f6aef5cb0bc295f5c264129cbe8450f46a3512bcec7711b360
renewable_power_plants.xlsx,923df41ec765de1b90c7073fb40c7abd153689fe6673980523e9e9a4457e3912
renewable_power_plants_CH.csv,14b657da2644b43fabab8b78e43c0d963395e5cc3381280c236fb4c82a591d73
renewable_power_plants_DE.csv,4e64ab261976d3f058e37e8e76c490b8052fa64688fb52c52f6ee69cb30c866d
renewable_power_plants_DE.csv,c14b51f6a1139f7a5d03310c4d0fd1f413855fac8d9eb87f2b97bf8fce4201a1
renewable_power_plants_DK.csv,50e6ae0636158ed49614f6b5c214b69834a9a634f45c9faa27f00b86a95e1c93
renewable_power_plants_FR.csv,a9abeebe7c3e30ecc9caaaeb1bc529875ff78f62fe82542a3705f90fe7be743b
renewable_power_plants_PL.csv,42919ae255cea37572c5feb465857a5d61ef88b3bf5dab8ffa0c2eda618c0943
res_plants_separated_DE_unvalidated_plants.csv,827426e68fadb6117e0859e6ddd23dac63235a0b9c153099dec8cf07fb385e27
res_plants_separated_FR_overseas_territories.csv,113fdfad9e3b7c25503ddf07aaa6238f6b6047cc8b0a9ec6765598563901d8c7
res_plants_separated_DE_unvalidated_plants.csv,4ade5021fb039b575c66b26f3b1b106ece3dc380ffef9b91cc1d07ce8168e707
res_plants_separated_FR_overseas_territories.csv,581ff3aebd0d31558cf736e0e2eafc3fbe3f408fff413988b3fb1e3c2b6aa962
validation_marker.csv,bf2ae93b44ec396d5f7df40ddc98b461e5b3a6c475401f8913abde1f5e29207a
18 changes: 11 additions & 7 deletions validation_and_output.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"source": [
"settings = {\n",
" 'version': '2018-02-27',\n",
" 'changes': 'Update of data to latest available versions.'\n",
" 'changes': 'Update of German data to latest available versions.'\n",
"}"
]
},
Expand Down Expand Up @@ -118,8 +118,7 @@
"# Read data from script Part 1 download_and_process\n",
"\n",
"dfs = {}\n",
"dfs['DE'] = pd.read_pickle('intermediate/DE_renewables_final_download_and_process.pickle')\n",
"for country in countries_non_DE:\n",
"for country in countries:\n",
" dfs[country] = pd.read_pickle('intermediate/'+country+'_renewables.pickle')"
]
},
Expand Down Expand Up @@ -275,7 +274,7 @@
"\t\"Long explanation\": \"This powerplant is located in regions belonging to France but not located in Europe (e.g. Guadeloupe).\"\n",
"}\n",
"\n",
"dfs['FR'].loc[mark_rows_FR_not_in_Europe, 'comment'] += key+\";\"\n",
"dfs['FR'].loc[mark_rows_FR_not_in_Europe, 'comment'] += key+\"#\"\n",
"\n",
"del mark_rows_FR_not_in_Europe"
]
Expand Down Expand Up @@ -499,8 +498,12 @@
"metadata": {},
"outputs": [],
"source": [
"# Filling the empty cells in the gethermal column since this did not work in the loop\n",
"# Filling a few timeseries with forward-fill, as some did not work in the loop\n",
"timeseries_daily.Onshore = timeseries_daily.Onshore.fillna(method='ffill')\n",
"timeseries_daily.Offshore = timeseries_daily.Offshore.fillna(method='ffill')\n",
"timeseries_daily.Bioenergy = timeseries_daily.Bioenergy.fillna(method='ffill')\n",
"timeseries_daily.Geothermal = timeseries_daily.Geothermal.fillna(method='ffill')\n",
"timeseries_daily['Run-of-river'] = timeseries_daily['Run-of-river'].fillna(method='ffill')\n",
"\n",
"# Shorten timestamp to year for the yearly time series \n",
"timeseries_yearly.index = pd.to_datetime(timeseries_yearly.index, format=\"%Y\").year\n",
Expand Down Expand Up @@ -1282,14 +1285,15 @@
" web: http://open-power-system-data.org/\n",
"views: True\n",
"openpowersystemdata-enable-listing: True\n",
"documentation: https://github.com/Open-Power-System-Data/renewable_power_plants/blob/2017-06-26/main.ipynb\n",
"\"\"\"\n",
"\n",
"metadata = yaml.load(metadata)\n",
"\n",
"metadata['last_changes'] = settings['changes']\n",
"metadata['version'] = settings['version']\n",
"\n",
"metadata['documentation'] = 'https://github.com/Open-Power-System-Data/renewable_power_plants/blob/'+settings['version']+'/main.ipynb'\n",
"\n",
"datapackage_json = json.dumps(metadata, indent=4, separators=(',', ': '))\n",
"\n",
"# Write the information of the metadata\n",
Expand Down Expand Up @@ -1329,7 +1333,7 @@
"for country in countries_including_dirty:\n",
" files.append(table_names[country]+'.csv')\n",
"\n",
"with open(os.path.join(output_path, 'checksums.txt'), 'w') as f:\n",
"with open('checksums.txt', 'w') as f:\n",
" for file_name in sorted(files):\n",
" file_hash = get_sha_hash(os.path.join(package_path, file_name))\n",
" f.write('{},{}\\n'.format(file_name, file_hash))"
Expand Down

0 comments on commit 0638acc

Please sign in to comment.