Skip to content

Commit

Permalink
Merge pull request #114 from tomalrussell/fix/get_scenario_data
Browse files Browse the repository at this point in the history
Get data only (not dict) from SectorModel.get_scenario_data
  • Loading branch information
tomalrussell committed Nov 22, 2017
2 parents 6fee367 + e0e8827 commit 121368c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion smif/model/sector_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ def get_scenario_data(self, input_name):
raise ValueError("Scenario data for %s not available for this input",
input_name)

return self.deps[input_name].source_model._data
source_model = self.deps[input_name].source_model
output_name = self.deps[input_name].source.name

return source_model.get_data(output_name)

def get_region_names(self, region_set_name):
"""Get the list of region names for ``region_set_name``
Expand Down
2 changes: 1 addition & 1 deletion tests/model/test_sector_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_scenario_dependencies(self):
model.add_dependency(scenario_model, 'scenario_output', 'input_name')

assert 'input_name' in model.deps
assert model.get_scenario_data('input_name') == {'scenario_output': data}
assert model.get_scenario_data('input_name') == data


class TestSectorModelBuilder():
Expand Down

0 comments on commit 121368c

Please sign in to comment.