Skip to content

Commit

Permalink
refactor _df to _data in __init__()
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Dec 19, 2018
1 parent 1facfb5 commit 072d975
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pyam/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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')
Expand Down

0 comments on commit 072d975

Please sign in to comment.