SmartDataInnovationLab / ipython-cache

versatile cache line magic for ipython
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

Multi-line expressions #16

Open akdor1154 opened 6 years ago

akdor1154 commented 6 years ago

A lot of my slow computes are from pretty big expressions. Some can be split over multiple lines (e.g. for a sql script I can define the sql string earlier and cache just the execution) but others can't easily (say a big nasty nested comprehension). It would be useful to have a multiline magic or something as well to be able to cache these.

Great lib btw!

diallobakary4 commented 5 years ago

I am facing a similar problem with multiple loops. A cache cell magic will really be useful in that case.

riedel commented 2 years ago

Can someone describe how to effectively use a cell cache? I guess mostly be weird to cache the output cache like caching _ . So I guess the idea would be to no execute the cell and put a cache on the last line and re-execute any assignment on that happens to be on the last line of the cell?