From 9f4b60e31c0d306d80b9c4778342c8940e277271 Mon Sep 17 00:00:00 2001 From: lodersky Date: Thu, 4 Apr 2019 16:44:15 +0200 Subject: [PATCH 1/3] Add pycharm folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 54a019dc..128863b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *~ *.pyc +.idea/* result/* results/* doc/_build/* \ No newline at end of file From a9cbd3cc8a40cf77b4333fd80eec0af86a78f7eb Mon Sep 17 00:00:00 2001 From: lodersky Date: Thu, 4 Apr 2019 16:46:15 +0200 Subject: [PATCH 2/3] Plotting/reporting for all commodities --- urbs/output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/urbs/output.py b/urbs/output.py index 166c4c83..07592379 100644 --- a/urbs/output.py +++ b/urbs/output.py @@ -120,13 +120,13 @@ def get_timeseries(instance, stf, com, sites, timesteps=None): # PROCESS created = get_entity(instance, 'e_pro_out') - created = created.xs([stf, com], level=['stf', 'com']).loc[timesteps] try: + created = created.xs([stf, com], level=['stf', 'com']).loc[timesteps] created = created.unstack(level='sit')[sites].fillna(0).sum(axis=1) created = created.unstack(level='pro') created = drop_all_zero_columns(created) except KeyError: - created = pd.DataFrame(index=timesteps) + created = pd.DataFrame(index=timesteps[1:]) consumed = get_entity(instance, 'e_pro_in') try: From 9d9335386bdd0b7e9662e411b63a71465665372c Mon Sep 17 00:00:00 2001 From: lodersky Date: Thu, 18 Apr 2019 09:45:54 +0200 Subject: [PATCH 3/3] Fix wrong parenthesis --- urbs/features/transmission.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/urbs/features/transmission.py b/urbs/features/transmission.py index 7faf8270..bcb94156 100644 --- a/urbs/features/transmission.py +++ b/urbs/features/transmission.py @@ -152,15 +152,15 @@ def transmission_balance(m, tm, stf, sit, com): # exports increase balance for stframe, site_in, site_out, transmission, commodity in m.tra_tuples - if (site_in == sit and stframe == stf and commodity) == - com) - + if (site_in == sit and stframe == stf and + commodity == com)) - sum(m.e_tra_out[(tm, stframe, site_in, site_out, transmission, com)] # imports decrease balance for stframe, site_in, site_out, transmission, commodity in m.tra_tuples - if site_out == sit and stframe == stf and - commodity == com)) + if (site_out == sit and stframe == stf and + commodity == com))) # transmission cost function