diff --git a/setup.cfg b/setup.cfg index 4e2ff0551d91f4b40ae9c14fa9c314a9cef2726c..4d9a693a733b112e46233d33455ed17d480d9f58 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,7 +66,7 @@ dev = %(docs)s %(test)s %(io)s - bumpversion # for incrementing the version + bumpversion==1.0.0 # for incrementing the version twine # for publishing sphinx # for documentation pre-commit # https://pre-commit.com/ for hook managment diff --git a/tfields/core.py b/tfields/core.py index cf8f85a19b3e7fc4147f2c76f3011364802ee51c..8c4ddc9ba796977b1c6190ac38cfd3f58c1e0294 100644 --- a/tfields/core.py +++ b/tfields/core.py @@ -2830,6 +2830,24 @@ class TensorMaps(TensorFields): paths = sorted_paths return paths + def plot(self, **kwargs): # pragma: no cover + """ + Forwarding to rna.plotting.plot_mesh + """ + scalars_demanded = ( + "color" not in kwargs + and "facecolors" not in kwargs + and any([v in kwargs for v in ["vmin", "vmax", "cmap"]]) + ) + map_ = self.maps[kwargs.pop("map", 3)] + map_index = kwargs.pop("map_index", None if not scalars_demanded else 0) + if map_index is not None: + if not len(map_) == 0: + kwargs["color"] = map_.fields[map_index] + if map_.dim == 3: + return rna.plotting.plot_mesh(self, map_, **kwargs) + return rna.plotting.plot_tensor_map(self, map_, **kwargs) + if __name__ == "__main__": # pragma: no cover import doctest diff --git a/tfields/mesh_3d.py b/tfields/mesh_3d.py index 5965599018bd92496e1d583bf4a90428af6a9e98..afcebffc218254c6f1d02658ad651f4c88076dd3 100644 --- a/tfields/mesh_3d.py +++ b/tfields/mesh_3d.py @@ -9,7 +9,6 @@ Triangulated mesh class and methods import logging import os import numpy as np -import rna import tfields # obj imports @@ -1168,21 +1167,6 @@ class Mesh3D(tfields.TensorMaps): templates.append(template) return parts, templates - def plot(self, **kwargs): # pragma: no cover - """ - Forwarding to rna.plotting.plot_mesh - """ - scalars_demanded = ( - "color" not in kwargs - and "facecolors" not in kwargs - and any([v in kwargs for v in ["vmin", "vmax", "cmap"]]) - ) - 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] - return rna.plotting.plot_mesh(self, self.faces, **kwargs) - if __name__ == "__main__": # pragma: no cover import doctest