Exemplo n.º 1
0
 def test_int_version(self):
     """tests int_version"""
     assert int_version('numpy', '1.20.0rc1') == [1, 20, 0], int_version(
         'numpy', '1.20.0rc1')
     assert int_version('scipy',
                        '1.6.0rc2') == [1, 6, 0
                                        ], int_version('scipy', '1.6.0rc2')
     assert int_version('matplotlib',
                        '3.3.3') == [3, 3,
                                     3], int_version('matplotlib', '3.3.3')
     assert int_version('pyNastran',
                        '1.4.0+dev.8913610a0') == [1, 4, 0], int_version(
                            'pyNastran', '1.4.0+dev.8913610a0')
Exemplo n.º 2
0
    import imageio
    import PIL
    IS_IMAGEIO = True
except ImportError:
    IS_IMAGEIO = False

from pyNastran import is_pynastrangui_exe
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.utils import remove_files

if is_pynastrangui_exe:  # pragma: no cover
    assert IS_IMAGEIO, 'imageio is not istalled for the exe'

if IS_IMAGEIO:
    from pyNastran.utils import int_version
    iver = int_version('pillow', PIL.__version__)
    assert iver != [7, 1, 0], 'pillow=7.1.0 is not supported'


def setup_animation(scale,
                    istep=None,
                    animate_scale=True,
                    animate_phase=False,
                    animate_time=False,
                    icase_fringe=None,
                    icase_disp=None,
                    icase_vector=None,
                    icase_start=None,
                    icase_end=None,
                    icase_delta=None,
                    time=2.0,
Exemplo n.º 3
0
"""Plots a model cutting plane"""
import numpy as np
from pyNastran.utils import int_version
try:
    import matplotlib.pyplot as plt
    import matplotlib
    MPL_VER = int_version('matplotlib', matplotlib.__version__)
    IS_MATPLOTLIB = True
except ImportError:  # pragma: no cover
    IS_MATPLOTLIB = False
    MPL_VER = None

from pyNastran.bdf.mesh_utils.cut_model_by_plane import (
    cut_edge_model_by_coord, cut_face_model_by_coord, export_face_cut)


def cut_and_plot_model(title,
                       p1,
                       p2,
                       zaxis,
                       model,
                       coord,
                       nodal_result,
                       log,
                       ytol,
                       plane_atol=1e-5,
                       csv_filename=None,
                       invert_yaxis=False,
                       cut_type='edge',
                       plot=True,
                       show=True):