From d7e28a066a55c5f9c769596abf93596a05699f03 Mon Sep 17 00:00:00 2001 From: jdorfner Date: Thu, 18 Aug 2016 14:02:20 +0200 Subject: [PATCH] remove save from default runme (due to rare use and poooor performance) --- runme.py | 5 ----- urbs.py | 10 ++++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/runme.py b/runme.py index c72e66f9..a90700ae 100644 --- a/runme.py +++ b/runme.py @@ -115,11 +115,6 @@ def run_scenario(input_file, timesteps, scenario, result_dir, plot_periods={}): os.path.join(result_dir, '{}.xlsx').format(sce), prob.com_demand, prob.sit) - # store optimisation problem for later re-analysis - urbs.save( - prob, - os.path.join(result_dir, '{}.pgz').format(sce)) - urbs.result_figures( prob, os.path.join(result_dir, '{}'.format(sce)), diff --git a/urbs.py b/urbs.py index 18183e9a..8b39e3d8 100644 --- a/urbs.py +++ b/urbs.py @@ -1525,10 +1525,6 @@ def get_entity(instance, name): # convert to Series results = results[name] - - # if Series has MultiIndex, sort it to avoid PerformanceWarnings - if isinstance(results.index, pd.core.index.MultiIndex): - results = results.sortlevel() return results @@ -1781,8 +1777,10 @@ def get_timeseries(instance, com, sit, timesteps=None): dsmup = get_entity(instance, 'dsm_up') dsmdo = get_entity(instance, 'dsm_down') - dsmup = dsmup.xs(sit, level = 'sit').xs(com, level = 'com') - dsmdo = dsmdo.xs(sit, level = 'sit').xs(com, level = 'com') + dsmup = dsmup.xs(sit, level = 'sit') + dsmup = dsmup.xs(com, level = 'com') + dsmdo = dsmdo.xs(sit, level = 'sit') + dsmdo = dsmdo.xs(com, level = 'com') # series by summing the first time step set dsmdo = dsmdo.unstack().sum(axis=0)