Skip to content

Commit

Permalink
appease stickler
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Mar 6, 2019
1 parent a73b1c8 commit 3cc72b1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ixmp/reporting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def from_scenario(cls, scenario):
zip(scenario.par_list(), repeat('par')),
zip(scenario.equ_list(), repeat('equ')),
zip(scenario.var_list(), repeat('var')),
)
)

for name, kind in quantities:
# Retrieve data
Expand Down Expand Up @@ -120,7 +120,7 @@ def read_config(self, path):
See :meth:`configure`.
"""
with open(path, 'r') as f:
self.configure(**yaml.load(f), config_dir=path.parent)
self.configure(config_dir=path.parent, **yaml.load(f))

def configure(self, **config):
"""Configure the Reporter.
Expand Down
2 changes: 1 addition & 1 deletion ixmp/reporting/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'make_dataframe',
'load_file',
'write_report',
]
]


# Carry unit attributes automatically
Expand Down
2 changes: 1 addition & 1 deletion ixmp/reporting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def quantity_as_xr(scenario, name, kind='par'):
'par': ['value'],
'equ': ['lvl', 'mrg'],
'var': ['lvl', 'mrg'],
}[kind]
}[kind]

[dims.remove(col) for col in value_columns]

Expand Down
14 changes: 7 additions & 7 deletions tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ def dantzig(mp, solve=False):
['new-york', 325, 'cases'],
['chicago', 300, 'cases'],
['topeka', 275, 'cases'],
], columns=['j', 'value', 'unit'])
], columns=['j', 'value', 'unit'])
scen.add_par('b', b_data)

# distance in thousands of miles
# add parameter elements as dataframe (with index names)
scen.init_par('d', idx_sets=['i', 'j'])
d_data = pd.DataFrame([
['seattle', 'new-york', 2.5, 'km'],
['seattle', 'chicago', 1.7, 'km'],
['seattle', 'topeka', 1.8, 'km'],
['seattle', 'new-york', 2.5, 'km'],
['seattle', 'chicago', 1.7, 'km'],
['seattle', 'topeka', 1.8, 'km'],
['san-diego', 'new-york', 2.5, 'km'],
['san-diego', 'chicago', 1.8, 'km'],
['san-diego', 'topeka', 1.4, 'km'],
], columns='i j value unit'.split())
['san-diego', 'chicago', 1.8, 'km'],
['san-diego', 'topeka', 1.4, 'km'],
], columns='i j value unit'.split())
scen.add_par('d', d_data)

# cost per case per 1000 miles
Expand Down

0 comments on commit 3cc72b1

Please sign in to comment.