From 072d975d96bab8d0c1cdda62a78957bfa7295310 Mon Sep 17 00:00:00 2001 From: Daniel Huppmann Date: Wed, 19 Dec 2018 19:15:56 +0100 Subject: [PATCH] refactor `_df` to `_data` in `__init__()` --- pyam/core.py | 8 ++++---- tests/conftest.py | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pyam/core.py b/pyam/core.py index 94233d8a5..96b222a0c 100644 --- a/pyam/core.py +++ b/pyam/core.py @@ -67,12 +67,12 @@ def __init__(self, data, **kwargs): """ # import data from pd.DataFrame or read from source if isinstance(data, pd.DataFrame) or isinstance(data, pd.Series): - _df = format_data(data.copy()) + _data = format_data(data.copy()) elif has_ix and isinstance(data, ixmp.TimeSeries): - _df = read_ix(data, **kwargs) + _data = read_ix(data, **kwargs) else: - _df = read_files(data, **kwargs) - self.data, self.time_col, self.extra_cols = _df + _data = read_files(data, **kwargs) + self.data, self.time_col, self.extra_cols = _data self._LONG_IDX = IAMC_IDX + [self.time_col] + self.extra_cols # define a dataframe for categorization and other metadata indicators diff --git a/tests/conftest.py b/tests/conftest.py index b6ee42125..eb922f68e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,14 +1,13 @@ -import matplotlib -matplotlib.use('agg') - import os import pytest -from datetime import datetime - import pandas as pd +import matplotlib +from datetime import datetime from pyam import IamDataFrame +matplotlib.use('agg') + here = os.path.dirname(os.path.realpath(__file__)) IMAGE_BASELINE_DIR = os.path.join(here, 'expected_figs') TEST_DATA_DIR = os.path.join(here, 'data')