Skip to content

Commit

Permalink
Merge pull request #240 from lodersky/master
Browse files Browse the repository at this point in the history
Fix plotting error
  • Loading branch information
lodersky authored Apr 18, 2019
2 parents d51a777 + 9d93353 commit 90651b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*~
*.pyc
.idea/*
result/*
results/*
doc/_build/*
8 changes: 4 additions & 4 deletions urbs/features/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions urbs/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 90651b6

Please sign in to comment.