Skip to content

Commit

Permalink
release notes added
Browse files Browse the repository at this point in the history
  • Loading branch information
behnam-zakeri committed Apr 27, 2019
1 parent 0fc33b5 commit e01b6d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ jdbc.pwd = ixmp
- [#65](https://github.com/iiasa/message_ix/pull/65): Bugfix for downloading tutorials. Now downloads current installed version by default.
- [#60](https://github.com/iiasa/message_ix/pull/60): Add basic ability to write and read model input to/from Excel
- [#59](https://github.com/iiasa/message_ix/pull/59): Added MacOSX CI support
- [#190](https://github.com/iiasa/message_ix/pull/190): Storage equations in GAMS, unit test, and documentation
20 changes: 10 additions & 10 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def init_storage(scen):
'level', 'year', 'time'])
# Initiating a parameter for specifying storage losses (percentage)
scen.init_par('storage_loss', idx_sets=['node', 'technology', 'commodity',
'level', 'year', 'time'])
'level', 'year', 'time'])


# A function for adding storage technologies and parameterization
Expand Down Expand Up @@ -119,22 +119,22 @@ def add_storage_data(scen, time_order):
for y in set(scen.set('year')):
for h in time_order.keys():
scen.add_par('bound_storage_lo', ['node', 'dam', 'electr',
'storage', y, h], 0.0, '%')
'storage', y, h], 0.0, '%')

scen.add_par('bound_storage_up', ['node', 'dam', 'electr',
'storage', y, h], 1.0, '%')
'storage', y, h], 1.0, '%')

scen.add_par('storage_loss', ['node', 'dam', 'electr',
'storage', y, h], 0.05, '%')
'storage', y, h], 0.05, '%')

# input, output, and capacity factor for storage technologies
output = {'dam': ['node', 'stored_com', 'storage'],
'pump': ['node', 'stored_com', 'storage'],
'turbine': ['node', 'electr', 'level']}
'pump': ['node', 'stored_com', 'storage'],
'turbine': ['node', 'electr', 'level']}

inp = {'dam': ['node', 'stored_com', 'storage'],
'pump': ['node', 'electr', 'level'],
'turbine': ['node', 'stored_com', 'storage']}
'pump': ['node', 'electr', 'level'],
'turbine': ['node', 'stored_com', 'storage']}

var_cost = {'dam': 0, 'pump': 0.2, 'turbine': 0.3}

Expand Down Expand Up @@ -218,7 +218,7 @@ def test_storage(test_mp):
if storage_in_java:
# II.1. Equality: storage content in the beginning and end is equal
assert scen.var('STORAGE', {'time': 'a'})['lvl'] == scen.var('STORAGE',
{'time': 'd'})['lvl']
{'time': 'd'})['lvl']

# II.2. Storage content should never exceed storage capacity
assert max(scen.var('STORAGE')['lvl']) <= cap_storage
Expand All @@ -231,4 +231,4 @@ def test_storage(test_mp):
# II.4. Energy balance: storage change + losses = storage content
storage = scen.var('STORAGE').set_index(['year', 'time'])['lvl']
assert storage[(2020, 'b')] * (1 - loss[(2020, 'b')]
) == -change[(2020, 'c')]
) == -change[(2020, 'c')]

0 comments on commit e01b6d6

Please sign in to comment.