econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
315 stars 195 forks source link

Allow for a pre-built grid in `LinearFast` #1388

Closed Mv77 closed 2 months ago

Mv77 commented 2 months ago

The CGrid constructor of the econforge interpolation library can take a substantial time if you build many interpolators.

This PR allows you to pass a pre-constructed CGrid object to LinearFast.

This can save a lot of time in instances where you are building many interpolators over the same grid. For example, if you have consumption functions for many Markov states that are defined over the same asset grid. (cc: @wdu9 ?)

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 71.68%. Comparing base (649d8c6) to head (40dd7b3).

Files Patch % Lines
HARK/econforgeinterp.py 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1388 +/- ## ========================================== - Coverage 71.69% 71.68% -0.01% ========================================== Files 84 84 Lines 13939 13941 +2 ========================================== + Hits 9993 9994 +1 - Misses 3946 3947 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alanlujan91 commented 2 months ago

This is a useful change.

However, currently interpolation.py is preventing us from moving up to python=3.12. Do you think it will be maintained and supported going forward?

Mv77 commented 2 months ago

This is a useful change.

However, currently interpolation.py is preventing us from moving up to python=3.12. Do you think it will be maintained and supported going forward?

¯_(ツ)_/¯