This cell just test if the startup-sequence has been run..
(startup-sequence placed in `~/.ipython/profile_default/startup /00_init.py`, that is a softlink to `/home/shared/00_init.py`.)
%% Cell type:code id: tags:
``` python
importsys
p=sys.path
print(f"Your current path=")
itmal_found_in_path=False
foriinp:
print(f" {i}")
n=i.find("/itmal")
ifn>0:
itmal_found_in_path=True
assertitmal_found_in_path,"ups, 'itmal' dir not present in system path...you are in trouble!"
print("OK")
```
%% Cell type:markdown id: tags:
### Test ITMAL library
Now, import some functions form 'libitmal'..
%% Cell type:code id: tags:
``` python
fromlibitmalimportversionsasver
ver.Versions()
```
%% Cell type:markdown id: tags:
If it went well, you should see version like
```Python version: 3.8.3.
Scikit-learn version: 0.23.1.
Keras version: 2.4.3
Tensorflow version: 2.2.0
Tensorflow.keras version: 2.3.0-tf```
%% Cell type:markdown id: tags:
### Long-running cells in JupyterHub
...and how to capture output from 'em after closing Your browser or Your VPN connection.
### Step 1
First use the `%%capture` magic command in a long-running cell---the cell below also sets the 'done' flag to false.
### Step 2
Run the cell, and close you browser.
%% Cell type:code id: tags:
``` python
%%capture output
import time
t=20
done=False #
print("Jupyter Hub test..")
print(f" long running cell, sleep for {t} seconds..")
print(f" beg: {time.ctime()}")
time.sleep(t)
print(f" end: {time.ctime()}")
done=True
```
%% Cell type:markdown id: tags:
### Step 3
Finally come back to the node you launched the long-running cell on and see if the `done` flag is marked as `True`, then the captured output can be printed, see this in the second cell
%% Cell type:code id: tags:
``` python
#print(f"done={done}")
if done:
output.show() # displays captured output
else:
print("cell above still seem to be running, wait some more..")