0 votes
1 view
in Python by (47.8k points)

Currently, I am working on a python project that contains submodules and uses numpy/scipy. Ipython is used as an interactive console. Unfortunately, I am not very happy with the workflow that I am using right now, I would appreciate some advice.

In IPython, the framework is loaded by a simple import command. However, it is often necessary to change the code in one of the submodules of the framework. At this point, a model is already loaded and I use IPython to interact with it.

Now, the framework contains many modules that depend on each other, i.e. when the framework is initially loaded the main module is importing and configuring the submodules. The changes to the code are only executed if the module is reloaded using reload(main_mod.sub_mod). This is cumbersome as I need to reload all changed modules individually using the full path. It would be very convenient if reload(main_module) would also reload all submodules, but without reloading numpy/scipy.

1 Answer

0 votes
by (107k points)

For reloading submodules in IPythonIn you can use the following reloading module:

%load_ext autoreload

%autoreload 2

The above modules will reload all the changed module every time before executing a new line. 

Related questions

0 votes
1 answer
asked Oct 15, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
asked Oct 10, 2019 in Python by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...