OpenSourceEconomics / skillmodels

MIT License
11 stars 5 forks source link

Make "included_positions" a numpy array for "sigma_points" #33

Closed hmgaudecker closed 4 years ago

hmgaudecker commented 5 years ago

Recent Numba throws a warning:

python3.7/site-packages/numba/ir_utils.py:1959: NumbaPendingDeprecationWarning: 
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'included_positions' of function 'translog'.

For more information visit http://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

File "lib/python3.7/site-packages/skillmodels/model_functions/transition_functions.py", line 141:
@jit
def translog(sigma_points, coeffs, included_positions):

More context: http://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

Note: I have not looked at the code and I suppose that the list is not changed; else feel free to change the title.

janosg commented 5 years ago

I think we should be able to make this a numpy array directly when generating it, i.e. here.

I definitely don't change the list ever.

hmgaudecker commented 5 years ago

Oh, seeing #34, a tuple should be just as good. An array just came to my mind as the first thing.