mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Have autoreload update shell namespace with reloaded module variables
This commit is contained in:
parent
0c69ab6a32
commit
89e7a0a320
1 changed files with 5 additions and 2 deletions
|
@ -143,8 +143,11 @@ class InteractiveSceneEmbed:
|
|||
|
||||
def auto_reload(self):
|
||||
"""Enables IPython autoreload for automatic reloading of modules."""
|
||||
self.shell.magic("load_ext autoreload")
|
||||
self.shell.magic("autoreload all")
|
||||
def pre_cell_func(*args, **kwargs):
|
||||
new_mod = ModuleLoader.get_module(self.shell.user_module.__file__, is_during_reload=True)
|
||||
self.shell.user_ns.update(vars(new_mod))
|
||||
|
||||
self.shell.events.register("pre_run_cell", pre_cell_func)
|
||||
|
||||
def checkpoint_paste(
|
||||
self,
|
||||
|
|
Loading…
Add table
Reference in a new issue