numba unsupported opcode, but the opcode doesnt seem to exist
I am getting an error when using numba/jit.
Here's the function:
@jit(nopython=True)
def find_map(nodes1, nodes2, feather2, verbose=False):
def conndirections(i1,i2):
dr1,dr2=[0,0,0,0],[0,0,0,0] # represents NE,NW,SE,SW directions
conns1,conns2=nodes1[i1][1],nodes2[i2][1]
if len(conns1)!=len(conns2): return False
for i in conns1:
if nodes1[i1][0][0]-nodes1[i][0][0] > 0:
if nodes1[i1][0][1]-nodes1[i][0][1] > 0: dr1[0]+=1 # NE
else: dr1[1]+=1 # NW
else:
if nodes1[i1][0][1]-nodes1[i][0][1] > 0: dr1[2]+=1 # SE
else: dr1[3]+=1 # SW
for i in conns2:
if nodes2[i2][0][0]-nodes2[i][0][0] > 0:
if nodes2[i2][0][1]-nodes2[i][0][1] > 0: dr2[0]+=1 # NE
else: dr2[1]+=1 # NW
else:
if nodes2[i2][0][1]-nodes2[i][0][1] > 0: dr2[2]+=1 # SE
else: dr2[3]+=1 # SW
return dr1==dr2
mapi2_to_i1_a2={}
checkednodes=0
checked_n1_indices,checked_n2_indices=[],[]
largestd2=-1
moredistantcouple=(0,0)
for i1 in range(len(nodes1)):
n1=nodes1[i1]
d2min=1e10
i2passed=-1
for i2 in range(len(nodes2)):
if not i2 in checked_n2_indices:
n2=nodes2[i2]
d2 = (n1[0][0]-n2[0][0])**2+(n1[0][1]-n2[0][1])**2
if d2 < d2min and d2 < feather2 and conndirections(i1,i2):
d2min=d2
i2passed=i2
if i2passed!=-1:
checkednodes+=1
checked_n1_indices.append(i1)
checked_n2_indices.append(i2passed)
mapi2_to_i1_a2[i2passed]=i1
if d2min>largestd2:
largestd2=d2min
moredistantcouple=(i1,i2passed)
else:
pass
if verbose: print(f"nodes checked {checkednodes} out of {len(nodes1)},{len(nodes2)} - unrecognized nodes ~ {(1-checkednodes/len(nodes1))*100:.2f}%")
n1_unrecognized,n2_unrecognized=[],[]
for i1 in range(len(nodes1)):
if i1 not in checked_n1_indices: n1_unrecognized.append(i1)
for i2 in range(len(nodes2)):
if i2 not in checked_n2_indices: n2_unrecognized.append(i2)
return mapi2_to_i1_a2,n1_unrecognized,n2_unrecognized
and the puzzle is that the error
UnsupportedBytecodeError: Use of unsupported opcode (FORMAT_WITH_SPEC) found. Raised from /tmp/ipykernel_3739/147908977.py (79)
talks about an unsupported opcode FORMAT_WITH_SPEC which I didnt find anywhere google search
... so I don't even know where to start to debug it!