Skip to content

Commit

Permalink
Release 0.8.0 (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Oct 19, 2020
1 parent 8051d45 commit b6c473b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 38 deletions.
11 changes: 10 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Next release
# Release v0.8.0

## Highlights

- Add a `boxplot()` visualization feature to the plotting toolbox.
- Implement an API to read data from World Bank Open Data Catalogue.
- Write a tutorial illustrating how to read model results from a GAMS gdx file.
- Define `index`, `model`, `scenario`, ... attributes
and show a summary of the index dimensions on `print()`.
- Refactor the timeseries data backend for improved performance.

## API changes

Expand Down
9 changes: 1 addition & 8 deletions pyam/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def swap_time_for_year(self, inplace=False):
if not inplace:
return ret

def as_pandas(self, meta_cols=True, with_metadata=None):
def as_pandas(self, meta_cols=True):
"""Return object as a pandas.DataFrame
Parameters
Expand All @@ -558,13 +558,6 @@ def as_pandas(self, meta_cols=True, with_metadata=None):
join `data` with all `meta` columns if True (default)
or only with columns in list, or return copy of `data` if False
"""
# TODO: deprecate/remove `with_metadata` in release >=0.8
if with_metadata is not None:
deprecation_warning('Please use `meta_cols` instead.',
'The argument `with_metadata')
meta_cols = mpl_args_to_meta_cols(self, **with_metadata) \
if isinstance(with_metadata, dict) else with_metadata

# merge data and (downselected) meta, or return copy of data
if meta_cols:
meta_cols = self.meta.columns if meta_cols is True else meta_cols
Expand Down
19 changes: 1 addition & 18 deletions pyam/iiasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Connection(object):
By default, this function will (try to) read user credentials which
were set using :meth:`pyam.iiasa.set_config(<user>, <password>)`.
Alternatively, you can provide a path to a yaml file
with entries of 'username' and 'password'.
with entries of 'username' and 'password'.
base_url : str, custom authentication server URL
Notes
Expand Down Expand Up @@ -220,11 +220,6 @@ def index(self, default=True):
cols = ['version'] if default else ['version', 'is_default']
return self._query_index(default)[META_IDX + cols].set_index(META_IDX)

def scenario_list(self, default=True):
"""Deprecated, use :meth:`Connection.index`"""
deprecation_warning('Use `Connection.index()` instead.')
return self._query_index(default)

@lru_cache()
def _query_index(self, default=True):
# TODO merge this function with `meta()`
Expand All @@ -246,12 +241,6 @@ def meta_columns(self):
_check_response(r)
return pd.read_json(r.content, orient='records')['name']

def available_metadata(self):
"""Deprecated, use :attr:`Connection.meta_columns`"""
# TODO: deprecate/remove this function in release >=0.8
deprecation_warning('Use `Connection.meta_columns` instead.')
return self.meta_columns

@lru_cache()
def meta(self, default=True):
"""Return categories and indicators (meta) of scenarios
Expand Down Expand Up @@ -287,12 +276,6 @@ def extract(row):
return pd.concat([extract(row) for i, row in df.iterrows()],
sort=False)

def metadata(self, default=True):
"""Deprecated, use :meth:`Connection.meta`"""
# TODO: deprecate/remove this function in release >=0.8
deprecation_warning('Use `Connection.meta()` instead.')
return self.meta(default=default)

def models(self):
"""List all models in the connected resource"""
return pd.Series(self._query_index()['model'].unique(),
Expand Down
4 changes: 0 additions & 4 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ def test_as_pandas(test_df):
pd.DataFrame([['bar', 2]] * 2)])
npt.assert_array_equal(obs[cols], exp) # assert meta columns are merged

# test deprecated `with_metadata` arg
obs = df.as_pandas(with_metadata=True)
npt.assert_array_equal(obs[cols], exp) # assert meta columns are merged

# merge only one column
obs = df.as_pandas(['string'])
assert 'string' in obs.columns
Expand Down
7 changes: 0 additions & 7 deletions tests/test_iiasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ def test_meta_columns(conn):
# test that connection returns the correct list of meta indicators
npt.assert_array_equal(conn.meta_columns, META_COLS)

# test for deprecated version of the function
npt.assert_array_equal(conn.available_metadata(), META_COLS)


@pytest.mark.parametrize("default", [True, False])
def test_index(conn, default):
Expand All @@ -169,10 +166,6 @@ def test_meta(conn, default):

pdt.assert_frame_equal(conn.meta(default=default), exp, check_dtype=False)

# test for deprecated version of the function
pdt.assert_frame_equal(conn.metadata(default=default), exp,
check_dtype=False)


@pytest.mark.parametrize("kwargs", [
{},
Expand Down

0 comments on commit b6c473b

Please sign in to comment.