pygae / clifford

Geometric Algebra for Python
http://clifford.rtfd.io
BSD 3-Clause "New" or "Revised" License
762 stars 71 forks source link

Importing predefined algebra gives numba error #294

Closed larrykvit closed 4 years ago

larrykvit commented 4 years ago

Setup: Windows 10, clean install of Python3.8, no other packages installed. Installed clifford via pip.

Tried to import clifford.pga, and get an error (shown bellow). All other predefined algebras give the same error.

Trying to define my own algebra using clifford.Cl(), gives the same error.

`

import clifford.pga Traceback (most recent call last): File "", line 1, in File "c:\program files\python38\lib\site-packages\clifford\pga.py", line 3, in layout, blades = Cl(3, 0, 1, firstIdx=0) File "c:\program files\python38\lib\site-packages\clifford__init.py", line 733, in Cl layout = Layout._from_Cl(p, q, r, firstIdx=firstIdx, names=names) File "c:\program files\python38\lib\site-packages\clifford_layout.py", line 163, in _from_Cl return cls._from_sig([0]r + [+1]p + [-1]*q, kwargs) File "c:\program files\python38\lib\site-packages\clifford_layout.py", line 158, in _from_sig return cls(sig, bladeTupList, firstIdx=firstIdx, kwargs) File "c:\program files\python38\lib\site-packages\clifford_layout.py", line 146, in init self._genTables() File "c:\program files\python38\lib\site-packages\clifford_layout.py", line 313, in _genTables self.omt = sparse.where(omt_prod_mask, self.gmt, self.gmt.dtype.type(0)) File "c:\program files\python38\lib\site-packages\sparse_coo\common.py", line 817, in where return elemwise(np.where, condition, x, y) File "c:\program files\python38\lib\site-packages\sparse_coo\umath.py", line 48, in elemwise return _Elemwise(func, *args, kwargs).get_result() File "c:\program files\python38\lib\site-packages\sparse_coo\umath.py", line 478, in get_result r = self._get_func_coords_data(mask) File "c:\program files\python38\lib\site-packages\sparse_coo\umath.py", line 606, in _get_func_coords_data matched_arrays = self._match_coo( File "c:\program files\python38\lib\site-packages\sparse_coo\umath.py", line 739, in _match_coo matched_idx = _match_arrays(linear) File "c:\program files\python38\lib\site-packages\numba\dispatcher.py", line 395, in _compile_for_args raise e File "c:\program files\python38\lib\site-packages\numba\dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "c:\program files\python38\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(args, kwargs) File "c:\program files\python38\lib\site-packages\numba\dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "c:\program files\python38\lib\site-packages\numba\dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "c:\program files\python38\lib\site-packages\numba\dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "c:\program files\python38\lib\site-packages\numba\dispatcher.py", line 103, in _compile_core cres = compiler.compile_extra(self.targetdescr.typing_context, File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 390, in compile_extra return self._compile_bytecode() File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 903, in _compile_bytecode return self._compile_core() File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 890, in _compile_core res = pm.run(self.status) File "c:\program files\python38\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 266, in run raise patched_exception File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 257, in run stage() File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 703, in _backend lowered = lowerfn() File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 682, in backend_nopython_mode return native_lowering_stage( File "c:\program files\python38\lib\site-packages\numba\compiler.py", line 1143, in native_lowering_stage lower.lower() File "c:\program files\python38\lib\site-packages\numba\lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "c:\program files\python38\lib\site-packages\numba\lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "c:\program files\python38\lib\site-packages\numba\lowering.py", line 243, in lower_function_body self.lower_block(block) File "c:\program files\python38\lib\site-packages\numba\lowering.py", line 258, in lower_block self.lower_inst(inst) File "c:\program files\python38\lib\contextlib.py", line 131, in exit__ self.gen.throw(type, value, traceback) File "c:\program files\python38\lib\site-packages\numba\errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "c:\program files\python38\lib\site-packages\numba\six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Type of #4 arg mismatch: i1 != i32

File "....\program files\python38\lib\site-packages\sparse_coo\umath.py", line 71: def _match_arrays(a, b): # pragma: no cover

a_ind, b_ind = [], []
^

[1] During: lowering "$56.1 = build_list(items=[])" at c:\program files\python38\lib\site-packages\sparse_coo\umath.py (71)

This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1.

Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new

If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba

Thanks in advance for your help in improving Numba!

`

eric-wieser commented 4 years ago

Updating numba will make this issue go away.

larrykvit commented 4 years ago

Thanks, that worked! Just a note - the clifford package installs the older numba package by default (and updating numba to the newer package shows a warning). ERROR: clifford 1.2.0 has requirement numba==0.45.1, but you'll have numba 0.48.0 which is incompatible.

eric-wieser commented 4 years ago

Thanks. We're aware of that, and it's fixed in master (and 1.3.0dev1 on pypi).

We should have a new release out soon.