Ejemplo n.º 1
0
    def __init__(self, **kwargs):
        """Initialize the itkwidgets plotter."""
        itk_import_err = ImportError("Please install `itkwidgets>=0.25.2`")
        if not HAS_ITK:
            raise itk_import_err

        from itkwidgets import __version__
        if not meets_version(__version__, "0.25.2"):
            raise itk_import_err

        self._actors = []
        self._point_sets = []
        self._geometries = []
        self._geometry_colors = []
        self._geometry_opacities = []
        self._point_set_colors = []
Ejemplo n.º 2
0
    def __init__(self, **kwargs):
        """Initialize the itkwidgets plotter."""
        try:
            import itkwidgets
        except ImportError:
            raise ImportError("Please install `itkwidgets>=0.25.2`")

        from itkwidgets import __version__
        from scooby import meets_version
        if not meets_version(__version__, "0.25.2"):  # pragma: no cover
            raise itk_import_err

        self._point_sets = []
        self._geometries = []
        self._geometry_colors = []
        self._geometry_opacities = []
        self._point_set_colors = []
        self._background_color = None
        self._camera_position = None
        self._point_set_sizes = []
        self._point_set_representations = []
Ejemplo n.º 3
0
    def __init__(self, **kwargs):
        """Initialize the itkwidgets plotter."""
        if not HAS_ITK:  # pragma: no cover
            itk_import_err = ImportError(
                "Please install `itkwidgets>=0.25.2`:\n%s" %
                str(ITK_EXCEPTION))
            raise itk_import_err

        from itkwidgets import __version__
        if not meets_version(__version__, "0.25.2"):  # pragma: no cover
            raise itk_import_err

        self._point_sets = []
        self._geometries = []
        self._geometry_colors = []
        self._geometry_opacities = []
        self._point_set_colors = []
        self._background_color = None
        self._camera_position = None
        self._point_set_sizes = []
        self._point_set_representations = []
Ejemplo n.º 4
0
def test_version_compare():
    assert scooby.meets_version('2', '1')
    assert not scooby.meets_version('1', '2')

    assert scooby.meets_version('1', '1')
    assert scooby.meets_version('0.1', '0.1')
    assert scooby.meets_version('0.1.0', '0.1.0')

    assert scooby.meets_version('1.0', '0.9')
    assert not scooby.meets_version('0.9', '1.0')

    assert scooby.meets_version('0.2.5', '0.1.8')
    assert not scooby.meets_version('0.1.8', '0.2.5')

    assert not scooby.meets_version('0.25.1', '0.25.2')
    assert scooby.meets_version('0.26.0', '0.25.2')
    assert scooby.meets_version('0.25.2', '0.25.2')

    assert not scooby.meets_version('0.25.2', '0.26')

    assert scooby.meets_version('0.28.0dev0', '0.25.2')

    with pytest.raises(ValueError):
        scooby.meets_version('0.25.2.0', '0.26')