{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2017-07-20T21:08:18.311000Z", "start_time": "2017-07-20T21:08:17.182000Z" }, "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import seaborn as sns\n", "from Index_Calculations import facility_index_gen, index_and_generation\n", "import os\n", "import glob\n", "import numpy as np\n", "from joblib import Parallel, delayed" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2017-07-20T21:08:18.533000Z", "start_time": "2017-07-20T21:08:18.524000Z" }, "collapsed": true }, "outputs": [], "source": [ "states = [\"AL\", \"AK\", \"AZ\", \"AR\", \"CA\", \"CO\", \"CT\", \"DE\",\n", " \"FL\", \"GA\", \"HI\", \"ID\", \"IL\", \"IN\", \"IA\", \"KS\",\n", " \"KY\", \"LA\", \"ME\", \"MD\", \"MA\", \"MI\", \"MN\", \"MS\",\n", " \"MO\", \"MT\", \"NE\", \"NV\", \"NH\", \"NJ\", \"NM\", \"NY\",\n", " \"NC\", \"ND\", \"OH\", \"OK\", \"OR\", \"PA\", \"RI\", \"SC\",\n", " \"SD\", \"TN\", \"TX\", \"UT\", \"VT\", \"VA\", \"WA\", \"WV\", \"WI\", \"WY\"]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2017-07-20T21:08:26.317000Z", "start_time": "2017-07-20T21:08:18.989000Z" }, "collapsed": true }, "outputs": [], "source": [ "facility_path = os.path.join('Data storage', 'Facility gen fuels and CO2 2017-05-25.zip')\n", "facility_df = pd.read_csv(facility_path)\n", "epa_path = os.path.join('Data storage', 'Monthly EPA emissions 2017-05-25.csv')\n", "epa_df = pd.read_csv(epa_path)\n", "ef_path = os.path.join('Data storage', 'Final emission factors.csv')\n", "out_folder = os.path.join('Data storage', 'final state data')\n", "NERC_path = os.path.join('Data storage', 'Facility NERC labels.csv')\n", "all_fuel_paths = [os.path.join('Data storage', \n", " 'state gen data', \n", " state + ' fuels gen.csv') for state in states]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2017-07-20T21:11:32.636000Z", "start_time": "2017-07-20T21:09:13.390000Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[Parallel(n_jobs=-1)]: Done 36 out of 50 | elapsed: 1.7min remaining: 40.3s\n", "[Parallel(n_jobs=-1)]: Done 50 out of 50 | elapsed: 2.3min finished\n" ] } ], "source": [ "if __name__ == '__main__':\n", " Parallel(n_jobs=-1, verbose=3)(delayed(index_and_generation)\n", " (eia_facility_df=facility_df,\n", " all_fuel_path = fuel_path,\n", " epa_df=epa_df,\n", " emission_factor_path=ef_path,\n", " export_folder=out_folder, export_path_ext=' '\n", " + state, state=state) for state, fuel_path in zip(states, all_fuel_paths))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.13" } }, "nbformat": 4, "nbformat_minor": 2 }