Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecated matplotlib.testing.image_util. #2714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ original location:
does the exact same thing as `FormatStrFormatter`, but for new-style
formatting strings.

* Deprecated `matplotlib.testing.image_util` and the only function within,
`matplotlib.testing.image_util.autocontrast`. These will be removed
completely in v1.5.0.

* The ``fmt`` argument of :meth:`~matplotlib.axes.Axes.plot_date` has been
changed from ``bo`` to just ``o``, so color cycling can happen by default.

Expand Down
16 changes: 15 additions & 1 deletion lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ def new_function():

obj_type : str, optional
The object type being deprecated.

Example
-------
# To warn of the deprecation of "matplotlib.name_of_module"
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
obj_type='module')

"""
message = _generate_deprecation_message(
since, message, name, alternative, pending, obj_type)
Expand All @@ -129,7 +136,7 @@ def new_function():
def deprecated(since, message='', name='', alternative='', pending=False,
obj_type='function'):
"""
Used to mark a function as deprecated.
Decorator to mark a function as deprecated.

Parameters
------------
Expand Down Expand Up @@ -164,6 +171,13 @@ def new_function():
pending : bool, optional
If True, uses a PendingDeprecationWarning instead of a
DeprecationWarning.

Example
-------
@deprecated('1.4.0')
def the_function_to_deprecate():
pass

"""
def deprecate(func, message=message, name=name, alternative=alternative,
pending=pending):
Expand Down
9 changes: 8 additions & 1 deletion lib/matplotlib/testing/image_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@

import numpy as np

# TODO: Vectorize this
from matplotlib.cbook import deprecated, warn_deprecated


warn_deprecated('1.4.0', name='matplotlib.testing.image_util',
obj_type='module')


@deprecated('1.4.0')
def autocontrast(image, cutoff=0):
"""
Maximize image contrast, based on histogram. This completely
Expand Down