Skip to content

Commit

Permalink
update plexos adapter and jupyter #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludee committed Nov 5, 2018
1 parent 1768702 commit 249ad33
Show file tree
Hide file tree
Showing 3 changed files with 1,581 additions and 93 deletions.
10 changes: 5 additions & 5 deletions database_adapter/reeem_adapter_plexos.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from reeem_io import *

# input
# filename = ""
filename = "2018-04-25_Base_Plexos_FrameworkV1_DataV2_Output.xlsx"
# filename = "2018-04-25_Base_Plexos_FrameworkV1_DataV2_Input.xlsx"
# filename = "2018-02-02_Base_Plexos_FrameworkV1_DataV1_Output.xlsx"
Expand Down Expand Up @@ -47,7 +46,7 @@ def plexos_2_reeem_db(filename, fns, db_table, empty_rows, db_schema,

# seperate columns
dfunit = df[['schema', 'field', 'category', 'indicator', 'unit',
'aggregation', 'source']].copy().dropna()
'aggregation', 'source']].copy()
dfunit.index.names = ['nid']
dfunit.columns = ['schema', 'field', 'category', 'indicator', 'unit',
'aggregation', 'source']
Expand All @@ -56,8 +55,9 @@ def plexos_2_reeem_db(filename, fns, db_table, empty_rows, db_schema,

# drop seperated columns
dfclean = df.drop(['schema', 'field', 'category',
'indicator', 'unit', 'aggregation', 'source'],axis=1).dropna()
'indicator', 'unit', 'aggregation', 'source'],axis=1)
# print(dfclean)

else:
df.columns = ['indicator', 'unit', '2030',
'schema', 'field', 'category', 'aggregation']
Expand All @@ -67,7 +67,7 @@ def plexos_2_reeem_db(filename, fns, db_table, empty_rows, db_schema,

# seperate columns
dfunit = df[['schema', 'field', 'category',
'indicator', 'unit', 'aggregation']].copy().dropna()
'indicator', 'unit', 'aggregation']].copy()
dfunit.index.names = ['nid']
dfunit.columns = ['schema', 'field', 'category',
'indicator', 'unit', 'aggregation']
Expand All @@ -76,7 +76,7 @@ def plexos_2_reeem_db(filename, fns, db_table, empty_rows, db_schema,

# drop seperated columns
dfclean = df.drop(['schema', 'field', 'category',
'indicator', 'unit', 'aggregation'],axis=1).dropna()
'indicator', 'unit', 'aggregation'],axis=1)
# print(dfclean)

# stack dataframe
Expand Down
2 changes: 1 addition & 1 deletion database_setup/reeem_db_setup_plexos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ COMMENT ON TABLE model_draft.reeem_plexos_output IS
"metadata_version": "1.3"}';

-- scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT reeem_scenario_log('v0.1.0','setup','model_draft','reeem_plexos_output','reeem_db_setup_plexos.sql',' ');
SELECT reeem_scenario_log('v0.1.0','setup','model_draft','reeem_plexos_output','reeem_db_setup_plexos.sql',' ');
Loading

0 comments on commit 249ad33

Please sign in to comment.