Skip to content

Commit

Permalink
Merge pull request #572 from iiasa/issue/571
Browse files Browse the repository at this point in the history
Extend feature vintage_and_active_years()
  • Loading branch information
khaeru authored May 25, 2022
2 parents b572cce + 0fedf74 commit 9566826
Show file tree
Hide file tree
Showing 7 changed files with 454 additions and 174 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
# for the message_ix project.
# - "3.10.0-alpha.1" # Development version

exclude:
# JPype1 (for ixmp) binary wheels are not available for this combination
- os: windows-latest
python-version: "3.10"

fail-fast: false

runs-on: ${{ matrix.os }}
Expand Down
49 changes: 24 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
# GAMS, R, Python-specific auxiliary files
*.~gm
# Python, R, etc.
*-checkpoint.ipynb
*.bak
*.dat
*.egg-info
*.~op
*.pyc
*.gdx
*.lst
*.log
*.eggs
*.lxi
*.gch
*.gpr
/model/2*/**
/model/$gms*
*.dat
*.tmp
*.RData*
*.pyc
*-checkpoint.ipynb
*.RData*
*.tmp
*#
*~
#*
*#
.
*.eggs

# MESSAGEix specifics
# GAMS
*.~gm
*.~op
*.gch
*.gdx
*.gpr
*.log
*.lst
message_ix/model/2*/**
message_ix/model/$gms*
message_ix/model/MESSAGE_master.gms
message_ix/model/cplex.opt

# Apple file system
.DS_Store

# Sphinx
doc/_build
doc/bibtex.json
Expand All @@ -42,16 +37,20 @@ dist
# testdb
.cache/**
tests/data/nightly
.Rproj.user

# pytest and related
.benchmarks
.coverage*
.mypy_cache
prof/
.pytest_cache
coverage.xml
htmlcov
prof/

# JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# JetBrains IDEs incl. PyCharm
/**/.idea
# RStudio
.Rproj.user

# macOS
.DS_Store
23 changes: 19 additions & 4 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
.. Next release
.. ============
Next release
============

.. All changes
.. -----------
Migration notes
---------------

- The `in_horizon` argument to :meth:`.vintage_and_active_years` is deprecated, and will be removed in :mod:`message_ix` 4.0 or later.
At the same time, the behaviour will change to be the equivalent of providing `in_horizon` = :obj:`False`, i.e. the method will no longer filter to the scenario time horizon by default.
To prepare for this change, user code that expects values confined to the time horizon can be altered to use :meth:`.pandas.DataFrame.query`:

.. code-block:: python
df = scen.vintage_and_active_years().query(f"{scen.y0} <= year_vtg")
All changes
-----------

- Extend functionality of :meth:`.vintage_and_active_years`; add aliases
:meth:`.yv_ya`, :meth:`.ya`, and :attr:`.y0` (:pull:`572`).

.. _v3.5.0:

Expand Down
3 changes: 3 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ The full API is also available from R; see :doc:`rmessageix`.
to_excel
var
vintage_and_active_years
y0
years_active
ya
yv_ya

.. automethod:: add_macro

Expand Down
Loading

0 comments on commit 9566826

Please sign in to comment.