-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mock tornado for jupyterlite #381
Mock tornado for jupyterlite #381
Conversation
This pull request introduces 1 alert when merging e5b2cf9 into 76111ce - view on LGTM.com new alerts:
|
e5b2cf9
to
22b41e1
Compare
22b41e1
to
011ee0f
Compare
This pull request introduces 1 alert when merging 011ee0f into 558cc47 - view on LGTM.com new alerts:
|
try: | ||
import micropip # noqa | ||
except ImportError: | ||
sys.modules['tornado'] = types.ModuleType('tornadofake') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinRenou I think that the mocking got put into the wrong place here? the idea is that micropip
is only available in jupyterlite correct? so it should be:
try:
import micropip # noqa
sys.modules['tornado'] = types.ModuleType('tornadofake')
except ImportError:
pass
?
This broke the %matplotlib ipympl
import matplotlib.pyplot as plt
import numpy as np
import mpl_interactions.ipyplot as iplt
x = np.linspace(0, 2 * np.pi, 200)
def f(x, amp, freq):
return amp * np.sin(x * freq)
# Create the plot as normal
fig, ax = plt.subplots()
controls = iplt.plot(x, f, freq=(0.05, 10, 250), amp=(1, 10))
_ = iplt.title("the Frequency is: {freq:.2f}", controls=controls["freq"])
# save as a gif
anim = controls.save_animation("freq-plot-1.gif", fig, "freq", interval=35)
|
simpler matplotlib only reproduction: %matplotlib ipympl
from matplotlib import pyplot as plt
from matplotlib import animation
fig = plt.figure()
def animate(i):
pass
anim = animation.FuncAnimation(fig, animate)
fig.canvas.draw() |
See #334