QuantEcon / lecture-python-programming.myst

Python Programming for Finance and Economics
https://python-programming.quantecon.org
43 stars 26 forks source link

FIX: Update Numba Lecture to Address Deprecation of `@jit` #296

Closed HumphreyYang closed 9 months ago

HumphreyYang commented 10 months ago

This PR resolves #294.

Future actions are held in https://github.com/QuantEcon/meta/issues/112

github-actions[bot] commented 10 months ago

🚀 Deployed on https://657937bd6664cd4eaa54bbe3--epic-agnesi-957267.netlify.app

HumphreyYang commented 10 months ago

Hi @mmcky,

Could you please have a first pass on this?

Many thanks in advance.

mmcky commented 10 months ago

@HumphreyYang thanks for putting this together. This looks like a good change to me.

I wonder if using @jit(nopython=True) would be useful to show instead of @njit as we will plan to swap back to using the simpler @jit directive once the deprecation has been made in a later release.

Also can you please create and link the switch back to @jit issue.

Thank you.

HumphreyYang commented 10 months ago

@HumphreyYang thanks for putting this together. This looks like a good change to me.

I wonder if using @jit(nopython=True) would be useful to show instead of @njit as we will plan to swap back to using the simpler @jit directive once the deprecation has been made in a later release.

Also can you please create and link the switch back to @jit issue.

Thank you.

Hi @mmcky,

From the roadmap, I think Numba developers want to push people away from @jit(nopython=False). If that is the case, I think @njit is more compact. Maybe we should ask @jstac for his opinion?

Also can you please create and link the switch back to @jit issue.

It has been created in the meta repository here as it might involve more than one lecture.

Many thanks in advance.

Best, Humphrey

jstac commented 10 months ago

Thanks @HumphreyYang and @mmcky . I'm indifferent between the two options, since we'll be changing both to @jit soon anyway.

mmcky commented 10 months ago

thanks @HumphreyYang -- that linked issue is useful so I have added it to the top level description.

Do you know if njit is going to persist once the @jit decorator moves to default nopython=True mode?

HumphreyYang commented 10 months ago

thanks @HumphreyYang -- that linked issue is useful so I have added it to the top level description.

Do you know if njit is going to persist once the @jit decorator moves to default nopython=True mode?

Many thanks @mmcky,

I checked their documentation, but I did not find anything about the deprecation of njit. There is no deprecation warning when using njit at the moment. Therefore, I think it is not going to be removed.

jstac commented 9 months ago

Thanks @HumphreyYang , looking good.

@mmcky Could you please give this a careful proofread and then merge when ready? I flagged a couple of small things above.

HumphreyYang commented 9 months ago

Many thanks @jstac and @mmcky ,

The typo is introduced when I modify the text according to @mmcky's feedback. I will be more careful when deleting content. I also found another typo in the original text : )

@mmcky, would you mind having another review and merge if it looks good?

Many thanks in advance.