QuantEcon / lecture-python-advanced.myst

Advanced Quantitative Economics with Python
https://python-advanced.quantecon.org
22 stars 19 forks source link

[amss] Build Error #163

Open mmcky opened 1 week ago

mmcky commented 1 week ago

@kp992 would you have time to look into the build error for amss

ValueError: V and W need to be successfully computed before simulation.

The build cache is failing so it is failing on the fresh build of the lectures. The diff (preview) built fine as amss didn't execute in that context.

kp992 commented 1 week ago

Hmm, digging into this looks like there are multiple bugs. Just running the latest version locally, I see:

>>> amss_model.solve(V, σ_v_star, b_0, W, σ_w_star)
...
File ~/mambaforge/envs/qe/lib/python3.10/site-packages/interpolation/splines/eval_splines.py:100, in __eval_spline(grid, C, points, out, k, diff, extrap_mode)
     98 @overload(_eval_spline)
     99 def __eval_spline(grid, C, points, out=None, k=1, diff="None", extrap_mode="linear"):
--> 100     kk = (k).literal_value
    101     diffs = (diff).literal_value
    102     extrap_ = (extrap_mode).literal_value

AttributeError: 'Integer' object has no attribute 'literal_value'

This is coming from interpolation.

mmcky commented 5 days ago

@kp992 this is blocking our ability to publish. Any ideas on how we can fix this.

kp992 commented 4 days ago

@mmcky I am trying to figure out fix or some workarounds.

kp992 commented 4 days ago

@mmcky If we need a quick release, one option is to just pin "numba<0.60". That will work fine. Till then, I am trying to fix the issue in numba 0.60.

mmcky commented 4 days ago

thanks @kp992 -- nice suggestion.

https://docs.anaconda.com/anaconda/allpkglists/2024.02-1/

indicates that numba == 0.59 in the anaconda release being used. Does it get upgraded somewhere?

kp992 commented 4 days ago

May be this is the issue:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
interpolation 2.2.6 requires numba>=0.59.1, but you have numba 0.59.0 which is incompatible.

So, pip resolver is picking numba=0.60 (which is the latest one)

See: https://github.com/EconForge/interpolation.py/blob/16c106fe857150d445e1c918b07da5da45d64a9b/pyproject.toml#L18.