Skip to content

Commit

Permalink
Fix #122. Add location field.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Nov 15, 2016
1 parent 12f1710 commit 24971d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocelot/transformations/locations/markets.py
Expand Up @@ -194,13 +194,14 @@ def update_market_production_volumes(data, kind="market activity"):
rp['production volume']['amount'] = max(total_pv - missing_pv, 0)
logger.info({
'type': 'table element',
'data': (ds['name'], rp['name'], total_pv, missing_pv, rp['production volume']['amount'])
'data': (ds['name'], rp['name'], ds['location'], total_pv,
missing_pv, rp['production volume']['amount'])
})
return data

update_market_production_volumes.__table__ = {
'title': 'Update market production volumes while subtracting hard links',
'columns': ["Name", "Product", "Total", "Activity links", "Net"]
'columns': ["Name", "Product", "Location", "Total", "Activity links", "Net"]
}


Expand Down
3 changes: 3 additions & 0 deletions tests/locations/markets.py
Expand Up @@ -316,6 +316,7 @@ def test_update_market_production_volumes():
given = [{
'name': '',
'type': 'foo',
'location': '',
'exchanges': [{
'name': '',
'type': 'reference product',
Expand All @@ -333,6 +334,7 @@ def test_update_market_production_volumes_activity_link():
given = [{
'name': '',
'type': 'foo',
'location': '',
'exchanges': [{
'name': '',
'type': 'reference product',
Expand All @@ -353,6 +355,7 @@ def test_update_market_production_volumes_negative_sum():
given = [{
'name': '',
'type': 'foo',
'location': '',
'exchanges': [{
'name': '',
'type': 'reference product',
Expand Down

0 comments on commit 24971d0

Please sign in to comment.