Skip to content

Commit

Permalink
Release candidate 1.6 (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Sep 15, 2022
1 parent d7d9b45 commit 1bf008c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
8 changes: 7 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Next Release
# Release v1.6.0

## Highlights

- Improved performance for writing data to *xlsx*
- Support for filtering by model-scenario pairs with an `index` argument
- Better integration with the IIASA Scenario Explorer database API

## Dependency changes

Expand Down
2 changes: 2 additions & 0 deletions doc/source/api/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ See `this tutorial <../tutorials/iiasa_dbs.html>`_ for more information.

.. autofunction:: read_iiasa

.. autofunction:: lazy_read_iiasa

Reading UNFCCC inventory data
-----------------------------

Expand Down
3 changes: 3 additions & 0 deletions doc/source/api/iiasa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ See `this tutorial <../tutorials/iiasa_dbs.html>`_ for more information.
.. autofunction:: read_iiasa
:noindex:

.. autofunction:: lazy_read_iiasa
:noindex:

.. autofunction:: set_config
16 changes: 7 additions & 9 deletions pyam/iiasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ def index(self, default=True, **kwargs):
If `True`, return *only* the default version of a model/scenario.
Any model/scenario without a default version is omitted.
If `False`, returns all versions.
kwargs
Arguments to filer by *model* and *scenario*, `*` can be used as wildcard
kwargs
Arguments to filer by *model* and *scenario*, `*` can be used as wildcard.
"""
cols = ["version"] if default else ["version", "is_default"]
return self._query_index(default, **kwargs)[META_IDX + cols].set_index(META_IDX)
Expand Down Expand Up @@ -575,9 +575,8 @@ def read_iiasa(name, default=True, meta=True, creds=None, base_url=_AUTH_URL, **
Parameters
----------
name : str
A valid name of an IIASA scenario explorer instance,
see :attr:`pyam.iiasa.Connection.valid_connections`. Obtain a list of options
via pyam.iiasa.Connection().valid_connections.
| Name of an IIASA Scenario Explorer database instance.
| See :attr:`pyam.iiasa.Connection.valid_connections`.
default : bool, optional
Return *only* the default version of each scenario.
Any (`model`, `scenario`) without a default version is omitted.
Expand Down Expand Up @@ -618,9 +617,8 @@ def lazy_read_iiasa(
The location to test for valid data and save the data if not up-to-date. Must be
either xls, xlsx or csv.
name : str
A valid name of an IIASA scenario explorer instance,
see :attr:`pyam.iiasa.Connection.valid_connections`. Obtain a list of options
via pyam.iiasa.Connection().valid_connections.
| Name of an IIASA Scenario Explorer database instance.
| See :attr:`pyam.iiasa.Connection.valid_connections`.
default : bool, optional
Return *only* the default version of each scenario.
Any (`model`, `scenario`) without a default version is omitted.
Expand Down Expand Up @@ -662,7 +660,7 @@ def lazy_read_iiasa(
logger.info("Database out of date and will be re-downloaded")
# If we get here, we need to redownload the database
new_read = read_iiasa(
name, meta=True, default=default, creds=None, base_url=_AUTH_URL, **kwargs
name, meta=meta, default=default, creds=creds, base_url=base_url, **kwargs
)
Path(file).parent.mkdir(parents=True, exist_ok=True)
if file.suffix == ".csv":
Expand Down

0 comments on commit 1bf008c

Please sign in to comment.