Commit 08625a6e authored by dboe's avatar dboe
Browse files

manicure

parent 400a1023
......@@ -1128,12 +1128,15 @@ class Mesh3D(tfields.TensorMaps):
>>> m_altered_fields = m.copy()
>>> m_altered_fields[0] += 42
>>> assert not m_split.equal(m_altered_fields.cut(template))
>>> assert tfields.Tensors(m_split).equal(m_altered_fields.cut(template))
>>> assert tfields.Tensors(m_split.maps[3]).equal(m_altered_fields.cut(template).maps[3])
>>> assert tfields.Tensors(m_split).equal(
... m_altered_fields.cut(template))
>>> assert tfields.Tensors(m_split.maps[3]).equal(
... m_altered_fields.cut(template).maps[3])
The cut expression may be a sympy.BooleanFunction:
>>> cut_expr_bool_fun = (x > 1.5) & (y < 1.5) & (y >0.2) & (z > -0.5)
>>> m_split_bool = m.cut(cut_expr_bool_fun, at_intersection='split')
>>> m_split_bool = m.cut(cut_expr_bool_fun,
... at_intersection='split')
Returns:
copy of cut mesh
......@@ -1166,7 +1169,8 @@ class Mesh3D(tfields.TensorMaps):
Forwarding to plotTools.plot_mesh
"""
scalars_demanded = any([v in kwargs for v in ['vmin', 'vmax', 'cmap']])
map_index = kwargs.pop('map_index', None if not scalars_demanded else 0)
map_index = kwargs.pop('map_index',
None if not scalars_demanded else 0)
if map_index is not None:
if not len(self.maps[3]) == 0:
kwargs['color'] = self.maps[3].fields[map_index]
......@@ -1175,6 +1179,4 @@ class Mesh3D(tfields.TensorMaps):
if __name__ == '__main__': # pragma: no cover
import doctest
# doctest.run_docstring_examples(Mesh3D.project, globals())
# doctest.run_docstring_examples(Mesh3D.tree, globals())
doctest.testmod()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment