From 9573d3f93ecd8f8557b7d897b1f2cc40f9cc8bec Mon Sep 17 00:00:00 2001 From: Zebedee Nicholls Date: Mon, 23 Sep 2019 17:26:41 +1000 Subject: [PATCH] Appease stickler --- pyam/core.py | 4 ++-- tests/conftest.py | 54 +++++++++++++++++++++++------------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pyam/core.py b/pyam/core.py index 4356e9298..e3a8eec77 100644 --- a/pyam/core.py +++ b/pyam/core.py @@ -911,8 +911,8 @@ def _variable_components(self, variable, all=False): """Get all components (sub-categories) of a variable for a given level If `all`, for `variable='foo'`, return `['foo|bar']`, but don't include - `'foo|bar|baz'`, which is a sub-sub-category. Otherwise return all variables - below `variable` in the hierarchy""" + `'foo|bar|baz'`, which is a sub-sub-category. Otherwise return all + variables below `variable` in the hierarchy""" var_list = pd.Series(self.data.variable.unique()) if all: return var_list[pattern_match(var_list, '{}|*'.format(variable))] diff --git a/tests/conftest.py b/tests/conftest.py index d1c53c30c..b70dd29bb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -125,34 +125,34 @@ ) - +ms = ['AIM', 'cscen'] CHECK_AGG_REGIONAL_DF = pd.DataFrame([ - ['AIM', 'cscen', 'World', 'Emissions|N2O', 'Mt N/yr', 1.9, 15.7], - ['AIM', 'cscen', 'World', 'Emissions|N2O|AFOLU', 'Mt N/yr', 0.1, 0.1], - ['AIM', 'cscen', 'World', 'Emissions|N2O|Ind', 'Mt N/yr', 1.8, 15.6], - ['AIM', 'cscen', 'World', 'Emissions|N2O|Ind|Shipping', 'Mt N/yr', 1, 6], - ['AIM', 'cscen', 'World', 'Emissions|N2O|Ind|Solvents', 'Mt N/yr', 1.6, 3.8], - ['AIM', 'cscen', 'World', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -0.8, 5.8], - ['AIM', 'cscen', 'RASIA', 'Emissions|N2O', 'Mt N/yr', 0, 5.9], - ['AIM', 'cscen', 'RASIA', 'Emissions|N2O|Ind', 'Mt N/yr', 0, 5.9], - ['AIM', 'cscen', 'RASIA', 'Emissions|N2O|Ind|Solvents', 'Mt N/yr', 0.8, 2.6], - ['AIM', 'cscen', 'RASIA', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -0.8, 3.3], - ['AIM', 'cscen', 'REUROPE', 'Emissions|N2O', 'Mt N/yr', 0.8, 3.7], - ['AIM', 'cscen', 'REUROPE', 'Emissions|N2O|Ind', 'Mt N/yr', 0.8, 3.7], - ['AIM', 'cscen', 'REUROPE', 'Emissions|N2O|Ind|Solvents', 'Mt N/yr', 0.8, 1.2], - ['AIM', 'cscen', 'REUROPE', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', 0, 2.5], - ['AIM', 'cscen', 'China', 'Emissions|N2O', 'Mt N/yr', 0.2, 1.3], - ['AIM', 'cscen', 'China', 'Emissions|N2O|Ind', 'Mt N/yr', 0.2, 1.3], - ['AIM', 'cscen', 'China', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', 0.2, 1.3], - ['AIM', 'cscen', 'Japan', 'Emissions|N2O', 'Mt N/yr', -1, 2], - ['AIM', 'cscen', 'Japan', 'Emissions|N2O|Ind', 'Mt N/yr', -1, 2], - ['AIM', 'cscen', 'Japan', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -1, 2], - ['AIM', 'cscen', 'Germany', 'Emissions|N2O', 'Mt N/yr', 2, 3], - ['AIM', 'cscen', 'Germany', 'Emissions|N2O|Ind', 'Mt N/yr', 2, 3], - ['AIM', 'cscen', 'Germany', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', 2, 3], - ['AIM', 'cscen', 'UK', 'Emissions|N2O', 'Mt N/yr', -2, -0.5], - ['AIM', 'cscen', 'UK', 'Emissions|N2O|Ind', 'Mt N/yr', -2, -0.5], - ['AIM', 'cscen', 'UK', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -2, -0.5], + ms + ['World', 'Emissions|N2O', 'Mt N/yr', 1.9, 15.7], + ms + ['World', 'Emissions|N2O|AFOLU', 'Mt N/yr', 0.1, 0.1], + ms + ['World', 'Emissions|N2O|Ind', 'Mt N/yr', 1.8, 15.6], + ms + ['World', 'Emissions|N2O|Ind|Shipping', 'Mt N/yr', 1, 6], + ms + ['World', 'Emissions|N2O|Ind|Solvents', 'Mt N/yr', 1.6, 3.8], + ms + ['World', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -0.8, 5.8], + ms + ['RASIA', 'Emissions|N2O', 'Mt N/yr', 0, 5.9], + ms + ['RASIA', 'Emissions|N2O|Ind', 'Mt N/yr', 0, 5.9], + ms + ['RASIA', 'Emissions|N2O|Ind|Solvents', 'Mt N/yr', 0.8, 2.6], + ms + ['RASIA', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -0.8, 3.3], + ms + ['REUROPE', 'Emissions|N2O', 'Mt N/yr', 0.8, 3.7], + ms + ['REUROPE', 'Emissions|N2O|Ind', 'Mt N/yr', 0.8, 3.7], + ms + ['REUROPE', 'Emissions|N2O|Ind|Solvents', 'Mt N/yr', 0.8, 1.2], + ms + ['REUROPE', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', 0, 2.5], + ms + ['China', 'Emissions|N2O', 'Mt N/yr', 0.2, 1.3], + ms + ['China', 'Emissions|N2O|Ind', 'Mt N/yr', 0.2, 1.3], + ms + ['China', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', 0.2, 1.3], + ms + ['Japan', 'Emissions|N2O', 'Mt N/yr', -1, 2], + ms + ['Japan', 'Emissions|N2O|Ind', 'Mt N/yr', -1, 2], + ms + ['Japan', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -1, 2], + ms + ['Germany', 'Emissions|N2O', 'Mt N/yr', 2, 3], + ms + ['Germany', 'Emissions|N2O|Ind', 'Mt N/yr', 2, 3], + ms + ['Germany', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', 2, 3], + ms + ['UK', 'Emissions|N2O', 'Mt N/yr', -2, -0.5], + ms + ['UK', 'Emissions|N2O|Ind', 'Mt N/yr', -2, -0.5], + ms + ['UK', 'Emissions|N2O|Ind|Transport', 'Mt N/yr', -2, -0.5], ], columns=['model', 'scenario', 'region', 'variable', 'unit', 2005, 2010],