You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for your hard work and this great library.
Recently I came across small issue that is stopping me from using numba in my project. We need to parse dates that are adjusted as floats from Dec 30, 1899 (this format is used in Excel).
Below is details of my environment and content of Jupyter cells:
<ipython-input-50-f403da816d8c>:1: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function test failed at nopython mode lowering due to: Cannot cast Literal[str](1899-12-30) to datetime64[]: %".16" = load i8*, i8** %"$const0.3"
File "<ipython-input-50-f403da816d8c>", line 3:
def test():
t = np.datetime64("1899-12-30")
^
[1] During: lowering "$0.4 = call $0.2($const0.3, func=$0.2, args=[Var($const0.3, <ipython-input-50-f403da816d8c> (3))], kws=(), vararg=None)" at <ipython-input-50-f403da816d8c> (3)
@numba.jit
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py:725: NumbaWarning: Function "test" was compiled in object mode without forceobj=True.
File "<ipython-input-50-f403da816d8c>", line 2:
@numba.jit
def test():
^
self.func_ir.loc))
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py:734: NumbaDeprecationWarning:
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.
For more information visit http://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit
File "<ipython-input-50-f403da816d8c>", line 2:
@numba.jit
def test():
^
warnings.warn(errors.NumbaDeprecationWarning(msg, self.func_ir.loc))
The text was updated successfully, but these errors were encountered:
Thanks for the praise, we really appreciate it! Thank you for considering Numba and taking the time to report this error.
I can confirm that parsing such strings you mentioned in a @jit context currently does not seem to work. What you could do in the meantime as a workaround, is to create your np.datetime objects outside of the context and then pass them in as arguments like so:
In [8]: mydate = np.datetime64("1899-12-30")
In [9]: @numba.njit
...: def test(da):
...: print(da)
...:
In [10]: test(mydate)
1899-12-30
the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).
Hello,
First, thanks for your hard work and this great library.
Recently I came across small issue that is stopping me from using
numba
in my project. We need to parse dates that are adjusted as floats from Dec 30, 1899 (this format is used in Excel).Below is details of my environment and content of Jupyter cells:
Thanks again and best regards
Numba 0.44.1
Running through Jupyter
test()
The text was updated successfully, but these errors were encountered: