MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / MB

Function MB

code/dask/MB_numba_dask2.py:50–63  ·  view source on GitHub ↗
(nC, Re_limits, nR, Im_limits, imax, job_id, n_jobs)

Source from the content-addressed store, hash-verified

48@jit(nb_tuple((int64[:],uint8[:,:]))(int64,float64[:],int64,float64[:],
49 int64,int64,int64), nopython=True)
50def MB(nC, Re_limits, nR, Im_limits, imax, job_id, n_jobs):
51 Re = np.linspace(Re_limits[0], Re_limits[1], nC)
52 Im = np.linspace(Im_limits[0], Im_limits[1], nR)
53 my_rows = np.arange(job_id, len(Im), n_jobs, dtype=np.int64)
54 n_rows_here = len(my_rows)
55 img = np.zeros((n_rows_here, nC), dtype=np.uint8)
56 row_counter = 0
57 for i in my_rows:
58 I = Im[i]
59 for j,R in enumerate(Re):
60 c = complex(R, I)
61 img[row_counter, j] = nIter(c, imax)
62 row_counter += 1
63 return my_rows, img
64
65def main():
66 imax = 255

Callers

nothing calls this directly

Calls 1

nIterFunction · 0.70

Tested by

no test coverage detected