Exemplo n.º 1
0
def test_pattern_time():
    start = time.time()
    im = plot_patterns(x="Elephant valley")
    im
    end = time.time()
    assert (end - start) < 15
Exemplo n.º 2
0
def test_pattern_3():
    im = plot_patterns(x="Triple spiral valley")
    assert str(type(im)) == "<class 'matplotlib.image.AxesImage'>"
Exemplo n.º 3
0
def test_pattern_2():
    im = plot_patterns(x="Elephant valley")
    assert str(type(im)) == "<class 'matplotlib.image.AxesImage'>"
Exemplo n.º 4
0
def test_pattern_1():
    im = plot_patterns(x="mini mandelbrot")
    assert str(type(im)) == "<class 'matplotlib.image.AxesImage'>"
Exemplo n.º 5
0
def test_plot_patterns():
    assert plot_patterns(
        x="test"
    ) == 'It seems like you did not chose one of the patterns of the list...Restart the function if you want to plot a characteristic pattern'
Exemplo n.º 6
0
im = plt.imshow(Z_1.Mandelbrotset, cmap='binary')
anim = animation.FuncAnimation(fig,
                               animate,
                               frames=np.arange(15),
                               interval=400,
                               blit=False)
plt.show()
end_1 = time.time()
print(
    "Time spent to animate the zoom on the Mandelbrotset:  {0:.5f} s.".format(
        end_1 - start_1))

start_2 = time.time()
x = input(
    "Do you want to save each frame of the animation in a folder ? This will slow the animation. Answer 'yes' or 'no' without quotes :"
)
Inside_the_set(x)
end_2 = time.time()
print("Time spent to animate the zoom inside the Mandelbrotset:  {0:.5f} s.".
      format(end_2 - start_2))

start_3 = time.time()
x = input(
    'Which one do you want to plot ("Elephant valley", "Triple squared valley" or "mini mandelbrot". Write the answer without quotes)?'
)
plot_patterns(x)
end_3 = time.time()
print(
    "Time spent to plot a characteristic pattern:  {0:.5f} s.".format(end_3 -
                                                                      start_3))