File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed
examples/virtual_staining/vcp_tutorials Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 124
124
]
125
125
},
126
126
{
127
- "cell_type" : " markdown " ,
128
- "id " : " 2ae23986 " ,
129
- "metadata " : {
130
- "cell_marker " : " \"\"\" "
131
- } ,
127
+ "cell_type" : " code " ,
128
+ "execution_count " : null ,
129
+ "id " : " f0f20186 " ,
130
+ "metadata " : {},
131
+ "outputs" : [] ,
132
132
"source" : [
133
- " <div class=\" alert alert-warning\" >\n " ,
134
- " On Google Colab, please restart the session after installing dependencies.\n " ,
135
- " Click 'Runtime -> Restart session' in the header bar\n " ,
136
- " or press <kbd>⌘</kbd>/<kbd>Ctrl</kbd> + <kbd>m</kbd> <kbd>.</kbd>.\n " ,
137
- " </div>"
133
+ " # restart kernel if running in Google Colab\n " ,
134
+ " if \" get_ipython\" in globals():\n " ,
135
+ " session = get_ipython()\n " ,
136
+ " if \" google.colab\" in str(session):\n " ,
137
+ " print(\" Shutting down colab session.\" )\n " ,
138
+ " session.kernel.do_shutdown(restart=True)"
138
139
]
139
140
},
140
141
{
Original file line number Diff line number Diff line change 90
90
# See the [repository](https://github.com/mehta-lab/VisCy) for more details
91
91
# !pip install "viscy[metrics,visual]==0.3.0rc3"
92
92
93
- # %% [markdown]
94
- """
95
- <div class="alert alert-warning">
96
- On Google Colab, please restart the session after installing dependencies.
97
- Click 'Runtime -> Restart session' in the header bar
98
- or press <kbd>⌘</kbd>/<kbd>Ctrl</kbd> + <kbd>m</kbd> <kbd>.</kbd>.
99
- </div>
100
- """
93
+ # %%
94
+ # restart kernel if running in Google Colab
95
+ if "get_ipython" in globals ():
96
+ session = get_ipython ()
97
+ if "google.colab" in str (session ):
98
+ print ("Shutting down colab session." )
99
+ session .kernel .do_shutdown (restart = True )
101
100
102
101
# %%
103
102
# Validate installation
You can’t perform that action at this time.
0 commit comments