Skip to content

Commit

Permalink
remove save from default runme (due to rare use and poooor performance)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojdo committed Aug 18, 2016
1 parent 1729ed2 commit d7e28a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 0 additions & 5 deletions runme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
10 changes: 4 additions & 6 deletions urbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d7e28a0

Please sign in to comment.