enthought / enthought/mayavi

Jupyter-backed with Python 3.5.2

Open
#487 4 comments 5 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

Using the jupyter backend for rendering the following statement

```
from mayavi import mlab
mlab.init_notebook()
x, y, z = np.ogrid[-10:10:20j, -10:10:20j, -10:10:20j]
s = np.sin(x*y*z)/(x*y*z)

src = mlab.pipeline.scalar_field(s)
mlab.pipeline.iso_surface(src, contours=[s.min()+0.1*s.ptp(), ], opacity=0.3)
mlab.pipeline.iso_surface(src, contours=[s.max()-0.1*s.ptp(), ],)
```

An error is raised that looks related to the unicode / str changes between 2.7 and 3
```
/Users/mader/anaconda/lib/python3.5/site-packages/mayavi/tools/notebook.py in _repr_html_(self)
58 return scene_to_png(scene)
59 elif _backend == 'x3d':
---> 60 return scene_to_x3d(scene)
61
62

/Users/mader/anaconda/lib/python3.5/site-packages/mayavi/tools/notebook.py in scene_to_x3d(scene)
91 else:
92 url_base = "http://www.x3dom.org/download"
---> 93 x3d_elem = _fix_x3d_header(ex.output_string)
94 html = '''
95 %s

/Users/mader/anaconda/lib/python3.5/site-packages/mayavi/tools/notebook.py in _fix_x3d_header(x3d)
72 x3d = x3d.replace(
73 '',
---> 74 rep
75 )
76 return x3d

TypeError: a bytes-like object is required, not 'str'
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.