Exemple #1
0
def _define_deprecated_functions(ns):
    from cbook import deprecated

    # The C++ functions are not meant to be used directly.
    # Users should use the more pythonic wrappers in the Path
    # class instead.
    for func, alternative in [
            ('point_in_path', 'path.Path.contains_point'),
            ('get_path_extents', 'path.Path.get_extents'),
            ('point_in_path_collection', 'collection.Collection.contains'),
            ('path_in_path', 'path.Path.contains_path'),
            ('path_intersects_path', 'path.Path.intersects_path'),
            ('convert_path_to_polygons', 'path.Path.to_polygons'),
            ('cleanup_path', 'path.Path.cleaned'),
            ('points_in_path', 'path.Path.contains_points'),
            ('clip_path_to_rect', 'path.Path.clip_to_bbox')]:
        ns[func] = deprecated(
            since='1.3', alternative=alternative)(getattr(_path, func))
def _define_deprecated_functions(ns):
    from cbook import deprecated

    # The C++ functions are not meant to be used directly.
    # Users should use the more pythonic wrappers in the Path
    # class instead.
    for func, alternative in [
            ('point_in_path', 'path.Path.contains_point'),
            ('get_path_extents', 'path.Path.get_extents'),
            ('point_in_path_collection', 'collection.Collection.contains'),
            ('path_in_path', 'path.Path.contains_path'),
            ('path_intersects_path', 'path.Path.intersects_path'),
            ('convert_path_to_polygons', 'path.Path.to_polygons'),
            ('cleanup_path', 'path.Path.cleaned'),
            ('points_in_path', 'path.Path.contains_points'),
            ('clip_path_to_rect', 'path.Path.clip_to_bbox')]:
        ns[func] = deprecated(
            since='1.3', alternative=alternative)(getattr(_path, func))