Skip to content

Mandelbrot official solution not working for me either #11

@erikkemperman

Description

@erikkemperman

As promised, I just tried the mandelbrot version from the solution branch, and unfortunately I run into the same (or very similar) problem with numba vectorize:

UFuncTypeError: ufunc 'mandelbrot_vec' did not contain a loop with signature matching types (<class 'numpy.dtype[complex128]'>, <class 'numpy.dtype[int64]'>) -> <class 'numpy.dtype[int64]'>

I'm on a recent macbook pro with M1 chip, and conda install gave me numba.__version__ == '0.53.1'.

Minor (unrelated) detail, in the 'Hint' section where the innermost loop is factored out as its own function, you're using the constant MAX_ITER rather than the function arg max_iter:

https://github.com/esciencecenter-digital-skills/parallel-python-workshop/blame/main/mandelbrot/Mandelbrot.ipynb#L224

And the same is true in the solution:

https://github.com/esciencecenter-digital-skills/parallel-python-workshop/blame/exercise-solutions/mandelbrot/Mandelbrot_solution.ipynb#L290

As a further minor suggestion, it might be worthwhile to make a separate function def mandelbrot_render(niters) with the plotting logic so we can easily check if our changes don't mess up the results. In that case, though, it's important to always use niters = compute_mandelbrot(...) everywhere, and not just the naked compute_mandelbrot().

Anyway, thanks for a great workshop, hope this helps a bit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions