message_ix icon indicating copy to clipboard operation
message_ix copied to clipboard

Use scipy.interpolate in message_ix.tools.add_year

Open khaeru opened this issue 5 years ago • 2 comments

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().

khaeru avatar Dec 18 '20 11:12 khaeru

@vruijven @francescolovat as discussed today.

khaeru avatar Dec 18 '20 11:12 khaeru

@khaeru thanks for noticing this. Indeed there should be more compact and concise ways of doing this. A small part of the code being long is to cover some corner cases. But in general the process can be made simpler.

behnam-zakeri avatar Feb 04 '21 18:02 behnam-zakeri