Error running tutorial
Created by: zain-sohail
The tutorial uses a numba method for binning which gives out an error
---------------------------------------------------------------------------
TypingError Traceback (most recent call last)
File <timed exec>:1, in <module>
File ~/sed/sed/binning.py:83, in bin_partition(part, binDict, binAxes, binRanges, nBins, hist_mode, jitterParams, return_edges)
[80](file:///home/zains/sed/sed/binning.py?line=79) vals = part.values[:, binColumns]
[82](file:///home/zains/sed/sed/binning.py?line=81) if hist_mode == "numba":
---> [83](file:///home/zains/sed/sed/binning.py?line=82) hist_partition, edges = numba_histogramdd(
[84](file:///home/zains/sed/sed/binning.py?line=83) vals,
[85](file:///home/zains/sed/sed/binning.py?line=84) bins=nBins,
[86](file:///home/zains/sed/sed/binning.py?line=85) ranges=binRanges,
[87](file:///home/zains/sed/sed/binning.py?line=86) )
[88](file:///home/zains/sed/sed/binning.py?line=87) elif hist_mode == "numpy":
[89](file:///home/zains/sed/sed/binning.py?line=88) hist_partition, edges = np.histogramdd(
[90](file:///home/zains/sed/sed/binning.py?line=89) vals,
[91](file:///home/zains/sed/sed/binning.py?line=90) bins=nBins,
[92](file:///home/zains/sed/sed/binning.py?line=91) range=binRanges,
[93](file:///home/zains/sed/sed/binning.py?line=92) )
File ~/sed/sed/binning.py:435, in numba_histogramdd(sample, bins, ranges)
[431](file:///home/zains/sed/sed/binning.py?line=430) edges[i] = np.linspace(*ranges[i, :], bins[i] + 1)
[433](file:///home/zains/sed/sed/binning.py?line=432) nbin[i] = len(edges[i]) + 1 # includes an outlier on each end
--> [435](file:///home/zains/sed/sed/binning.py?line=434) hist = _hist_from_bin_ranges(sample, bins, ranges)
[437](file:///home/zains/sed/sed/binning.py?line=436) if (hist.shape != nbin - 2).any():
[438](file:///home/zains/sed/sed/binning.py?line=437) raise RuntimeError("Internal Shape Error")
File ~/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py:468, in _DispatcherBase._compile_for_args(self, *args, **kws)
[464](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=463) msg = (f"{str(e).rstrip()} \n\nThis error may have been caused "
[465](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=464) f"by the following argument(s):\n{args_str}\n")
[466](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=465) e.patch_message(msg)
--> [468](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=467) error_rewrite(e, 'typing')
[469](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=468) except errors.UnsupportedError as e:
[470](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=469) # Something unsupported is present in the user code, add help info
[471](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=470) error_rewrite(e, 'unsupported_error')
File ~/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py:409, in _DispatcherBase._compile_for_args.<locals>.error_rewrite(e, issue_type)
[407](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=406) raise e
[408](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=407) else:
--> [409](file:///home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/dispatcher.py?line=408) raise e.with_traceback(None)
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function zeros>) found for signature:
>>> zeros(array(int64, 1d, C), class(uint32))
There are 4 candidate implementations:
- Of which 4 did not match due to:
Overload in function '_OverloadWrapper._build.<locals>.ol_generated': File: numba/core/overload_glue.py: Line 131.
With argument(s): '(array(int64, 1d, C), class(uint32))':
Rejected as the implementation raised a specific error:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<intrinsic stub>) found for signature:
>>> stub(array(int64, 1d, C), class(uint32))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Intrinsic of function 'stub': File: numba/core/overload_glue.py: Line 35.
With argument(s): '(array(int64, 1d, C), class(uint32))':
No match.
During: resolving callee type: Function(<intrinsic stub>)
During: typing of call at <string> (3)
File "<string>", line 3:
<source missing, REPL/exec in use?>
raised from /home/zains/.cache/pypoetry/virtualenvs/sed-GVhCdIOu-py3.10/lib/python3.10/site-packages/numba/core/typeinfer.py:1086
During: resolving callee type: Function(<built-in function zeros>)
During: typing of call at /home/zains/sed/sed/binning.py (344)
File "../sed/binning.py", line 344:
def _hist_from_bin_ranges(
<source elided>
H = np.zeros(bins, np.uint32)
^
secondly, the tutorial requires matplotlib. Should this be part of the poetry package dependencies or an optional one?