When I added unpack_buffer_archive, in code review people said
it was redundant with unpack_buffer and they should be merged.
I said merging was too annoying. They were right. This merges
the functions together into a function with a 38 line docstring
and a 18 line implementation.
Merge together unpack_buffer and unpack_buffer_archive. When I added unpack_buffer_archive, in code review people said
it was redundant with unpack_buffer and they should be merged.
I said merging was too annoying. They were right. This merges
the functions together into a function with a 38 line docstring
and a 18 line implementation.
# non-native
# setup: import matplotlib ; import numpy as np ; matplotlib.use('module://matplotlib.backends.html5_canvas_backend') ; from matplotlib import pyplot as plt
# run: canvas_rendering()

# pythran export canvas_rendering()
import matplotlib
import numpy as np

matplotlib.use("module://matplotlib.backends.html5_canvas_backend")
from matplotlib import pyplot as plt  # noqa: E402


def canvas_rendering():
    t = np.arange(0.0, 2.0, 0.01)
    s = 1 + np.sin(2 * np.pi * t)
    plt.figure()
    plt.plot(t, s, linewidth=1.0, marker=11)
    plt.plot(t, t)
    plt.grid(True)
    plt.show()
    plt.close("all")
    plt.clf()

# non-native
# setup: import matplotlib ; import numpy as np ; matplotlib.use('module://matplotlib.backends.html5_canvas_backend') ; from matplotlib import pyplot as plt
# run: canvas_rendering()

# pythran export canvas_rendering()
import matplotlib
import numpy as np

matplotlib.use("module://matplotlib.backends.html5_canvas_backend")
from matplotlib import pyplot as plt  # noqa: E402


def canvas_rendering():
    t = np.arange(0.0, 2.0, 0.01)
    s = 1 + np.sin(2 * np.pi * t)
    plt.figure()
    plt.plot(t, s, linewidth=1.0, marker=11)
    plt.plot(t, t)
    plt.grid(True)
    plt.show()
    plt.close("all")
    plt.clf()
