OpenSourceEconomics / lcm

Solution and simulation of life cycle models in Python with GPU acceleration.
Apache License 2.0
16 stars 1 forks source link

Update grids.py and interpolation.py #69

Closed timmens closed 5 months ago

timmens commented 6 months ago

In this PR, I

  1. Add types to the grids.py module For this I define the Scalar type, which includes int, float, and jax.Array, because many JAX and LCM functions workon zero-dimensiona JAX arrays (and that often faster compared to float's).
  2. Delete the interpolation.py module, because it was not used anymore
  3. Create more precise types for the grid specification of discrete and continuous variables.
  4. Delete a JAX config update that constraints computation on the CPU, which was added for testing.
  5. Added more unit and illustrative tests
timmens commented 5 months ago

Could this be extended to let the user supply her own grid directly?

In principle, yes, but it is not completely trivial. I have opened an issue but set the priority to low for now (#76)

timmens commented 5 months ago

@hmgaudecker

I am fairly happy with the new changes and would be okay with merging this PR without your review if you do not find the time right now. Of course, if you find the time, I'd be happy to get your feedback.

There is no time pressure on this PR, so a review in the next 1-2 weeks would suffice.