Skip to content

Commit

Permalink
fixes to notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Mar 14, 2023
1 parent 5e71933 commit b14e1a0
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 265 deletions.
90 changes: 0 additions & 90 deletions examples/notebooks/align2.ipynb

This file was deleted.

44 changes: 16 additions & 28 deletions examples/notebooks/distance2mesh.ipynb

Large diffs are not rendered by default.

51 changes: 40 additions & 11 deletions examples/notebooks/interpolate_volume.ipynb

Large diffs are not rendered by default.

59 changes: 21 additions & 38 deletions examples/notebooks/legosurface.ipynb

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions examples/notebooks/manipulate_camera.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[1m\u001b[33;20m[vedo.backends.py:76] WARNING: Only k3d version 2.7.4 is currently supported\u001b[0m\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "de3f0dd4f70d477b8564c01b74159764",
"model_id": "2f5e6ab05ea2483a8379ba59e54a0e62",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Plot(antialias=True, axes=['x', 'y', 'z'], axes_helper=1.0, background_color=16777215, camera=[2, -3, 0.2, 0.0"
"Plot(antialias=True, axes=['x', 'y', 'z'], axes_helper=1.0, axes_helper_colors=[16711680, 65280, 255], backgro"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
Expand Down Expand Up @@ -96,7 +104,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down
25 changes: 6 additions & 19 deletions examples/notebooks/numpy2volume.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/notebooks/pore_network.ipynb

Large diffs are not rendered by default.

48 changes: 41 additions & 7 deletions examples/notebooks/shrink.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/notebooks/slider2d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 1,
"id": "d7392fcc",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3acfa6f4d02245a39843b9b313f46cd7",
"model_id": "286002eed0ff4527b7a39bec25b2ffa3",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -23,7 +23,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "149b03698fd34a6a969065763ea2ad61",
"model_id": "c9b8637b721e47239269d4a71e577bc6",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -37,7 +37,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b2b2f5de1acb4345856adb84ac39717f",
"model_id": "31a6fd09609542f395cc19aec20f5c93",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -136,7 +136,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down
25 changes: 5 additions & 20 deletions examples/notebooks/sphere.ipynb

Large diffs are not rendered by default.

31 changes: 0 additions & 31 deletions examples/other/dolfin/ex05_non-matching-meshes.py

This file was deleted.

File renamed without changes.
14 changes: 8 additions & 6 deletions vedo/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def start_2d():
try:
import PIL.Image
import IPython
except ImportError("PIL or IPython not available"):
except ImportError:
print("PIL or IPython not available")
return None

plt = vedo.plotter_instance
Expand All @@ -72,9 +73,8 @@ def start_k3d(actors2show):
# https://github.com/K3D-tools/K3D-jupyter
try:
import k3d
if str(k3d.__version__) != "2.7.4":
vedo.logger.warning("Only k3d version 2.7.4 is currently supported")
except ModuleNotFoundError("Cannot find k3d, install with: pip install k3d==2.7.4"):
except ModuleNotFoundError:
print("Cannot find k3d, install with: pip install k3d")
return None

plt = vedo.plotter_instance
Expand Down Expand Up @@ -279,7 +279,8 @@ def start_trame():
from trame.app import get_server, jupyter
from trame.ui.vuetify import VAppLayout
from trame.widgets import vtk, vuetify
except ImportError("trame is not installed, try:\n> pip install trame"):
except ImportError:
print("trame is not installed, try:\n> pip install trame")
return None

plt = vedo.plotter_instance
Expand Down Expand Up @@ -312,7 +313,8 @@ def start_trame():
def start_ipyvtklink():
try:
from ipyvtklink.viewer import ViewInteractiveWidget
except ImportError("ipyvtklink is not installed, try:\n> pip install ipyvtklink"):
except ImportError:
print("ipyvtklink is not installed, try:\n> pip install ipyvtklink")
return None

plt = vedo.plotter_instance
Expand Down
3 changes: 2 additions & 1 deletion vedo/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,8 @@ def add(self, *actors, at=None, render=True, resetcam=False):
if render:
if self.interactor:
if not self.interactor.GetInitialized():
vedo.logger.warning("call to add() but Plotter was not initialized with show()")
# vedo.logger.warning("call to add() but Plotter was not initialized with show()")
pass
else:
self.render(resetcam=resetcam)
return self
Expand Down
2 changes: 1 addition & 1 deletion vedo/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_version = '2023.4.3.dev26'
_version = '2023.4.4'

0 comments on commit b14e1a0

Please sign in to comment.