iiasa / iiasa/message_ix

Use scipy.interpolate in message_ix.tools.add_year

Open
#433 2 comments 0 reactions 0 assignees View on GitHub
enh help wanted
Dominant language
Jupyter Notebook
Stars
150
Forks
178
Avg merge
17h 32m
Merged PRs (30d)
2

Description

About 500 of the ~1000 lines in `tools.add_year` are devoted to two functions, `interpolate_1d()` and `interpolate_2d()`, and one utility function, `intpol()` to do interpolation.

These can likely be slimmed down, and maybe made more performant, by fully using lower-level methods in pandas and scipy, e.g. [`scipy.interpolate.griddata()`](https://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#multivariate-data-interpolation-griddata).

Contributor guide

Open the contributing guide

Research direction

Start in message_ix.tools.add_year and read interpolate_1d(), interpolate_2d(), and intpol() to understand their current interpolation behavior. Compare the existing logic with the referenced pandas and scipy.interpolate.griddata() APIs. Done means the interpolation implementation is slimmer or more performant while preserving the existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.