This is the function I'm trying to call
@njit
def reactor_metrics(array, fuel, reactor_block_properties, reactor_fuel_type):
x_max, y_max, z_max = array.shape
total_fuel_cells = 0
total_neighbor = 0.0
total_heat_multiplier = 0.0
power = 0.0
heat = 0.0
total_cooling = 0.0
for x in range(x_max):
for y in range(y_max):
for z in range(z_max):
element = int(array[x, y, z])
if element in reactor_block_properties:
total_cooling += reactor_block_properties[element]['cooling_value']
if element == 1:
total_fuel_cells += 1
adjacent_cells = count_neighbors(array, x, y, z, 1)
mod = count_neighbors(array, x, y, z, 2)
base_energy_gen = reactor_fuel_type[fuel]['energy_gen']
base_heat_gen = reactor_fuel_type[fuel]['heat_gen']
# ... irrelevant code
efficiency = 100 * total_neighbor / total_fuel_cells if total_fuel_cells != 0 else 0
heat_multiplier = 100 * total_heat_multiplier / total_fuel_cells if total_fuel_cells != 0 else 0
metrics = {
"heat_gen": heat,
"cooling": total_cooling,
"fuel_cells": total_fuel_cells,
"energy_gen": power,
"efficiency": int(efficiency),
"heat_multiplier": heat_multiplier,
"total_energy": power * total_fuel_cells,
"heat_diff": int(heat - total_cooling)
}
return metrics
``` And this is the error `File "metrics.py", line 49:
def count_neighbors_opposite(array, x, y, z, element):
<source elided>
@jit
^
This error may have been caused by the following argument(s):
- argument 2: Cannot determine Numba type of <class 'dict'>
- argument 3: Cannot determine Numba type of <class 'dict'>`