Skip to content

Bug: Points System crashes with ValueError due to p.retire being a list (plus subsequent TypingError) #1075

@lnguyen-kit

Description

@lnguyen-kit

Hi,

I am attempting to run the model using the "Points System" for pensions. I encountered a blocking error immediately when running the baseline.

  1. The Primary Issue (ValueError) When p.retire is a list (representing the time path, length 400), the function PS_amount in pensions.py crashes at np.zeros(p.retire). It interprets the list as dimensions rather than the length of the array.

Traceback:
File "C:...\ogcore\pensions.py", line 412, in PS_amount
L_inc_avg_s = np.zeros(p.retire)
ValueError: maximum supported dimension for an ndarray is currently 64, found 400

  1. Secondary Issue (TypingError) If I manually patch the code above to use int(p.retire[0]), I immediately hit a second error regarding g_y (growth rate). If g_y is a scalar (float), the Numba-compiled loop fails because it tries to access g_y[-1].

Traceback (after patching the ValueError):
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function() found for signature:

getitem(float64, int64)
...
File "...\ogcore\pensions.py", line 888:
for s in range(S_ret):
L_inc_avg_s[s] = w[s] / np.exp(g_y[-1] * (u - s)) * e[s] * n[s]
^

Environment:

  • OS: Windows 11
  • Python 3.11 / Anaconda

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions