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

Skip to content

Update a comment re: minimum version of numpy working around bug. #16520

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
Feb 15, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 15, 2020

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.3.0 milestone Feb 15, 2020
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anybody can merge after CI pass.

@tacaswell
Copy link
Member

The failure looks real

_________________________ test_only_on_non_finite_bbox _________________________
2545[gw1] linux -- Python 3.6.7 /home/travis/virtualenv/python3.6.7/bin/python
2546
2547    def test_only_on_non_finite_bbox():
2548        fig, ax = plt.subplots()
2549        ax.annotate("", xy=(0, float('nan')))
2550        ax.set_axis_off()
2551        # we only need to test that it does not error out on save
2552>       fig.savefig(BytesIO(), bbox_inches='tight', format='png')
2553
2554lib/matplotlib/tests/test_bbox_tight.py:97: 
2555_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2556lib/matplotlib/figure.py:2168: in savefig
2557    self.canvas.print_figure(fname, **kwargs)
2558lib/matplotlib/backend_bases.py:2065: in print_figure
2559    bbox_extra_artists=bbox_artists)
2560lib/matplotlib/figure.py:2341: in get_tightbbox
2561    bbox = a.get_tightbbox(renderer)
2562lib/matplotlib/axes/_base.py:4425: in get_tightbbox
2563    bbox = a.get_tightbbox(renderer)
2564lib/matplotlib/artist.py:277: in get_tightbbox
2565    bbox = self.get_window_extent(renderer)
2566lib/matplotlib/text.py:2003: in get_window_extent
2567    return Bbox.union(bboxes)
2568lib/matplotlib/transforms.py:723: in union
2569    x0 = np.min([bbox.xmin for bbox in bboxes])
2570lib/matplotlib/transforms.py:723: in <listcomp>
2571    x0 = np.min([bbox.xmin for bbox in bboxes])
2572lib/matplotlib/transforms.py:372: in xmin
2573    return np.min(self.get_points()[:, 0])
2574../../../virtualenv/python3.6.7/lib/python3.6/site-packages/numpy/core/fromnumeric.py:2442: in amin
2575    initial=initial)
2576_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2577
2578obj = array([nan, nan]), ufunc = <ufunc 'minimum'>, method = 'min', axis = None
2579dtype = None, out = None
2580kwargs = {'initial': <no value>, 'keepdims': <no value>}, passkwargs = {}
2581k = 'initial', v = <no value>
2582
2583    def _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs):
2584        passkwargs = {}
2585        for k, v in kwargs.items():
2586            if v is not np._NoValue:
2587                passkwargs[k] = v
2588    
2589        if type(obj) is not mu.ndarray:
2590            try:
2591                reduction = getattr(obj, method)
2592            except AttributeError:
2593                pass
2594            else:
2595                # This branch is needed for reductions like any which don't
2596                # support a dtype.
2597                if dtype is not None:
2598                    return reduction(axis=axis, dtype=dtype, out=out, **passkwargs)
2599                else:
2600                    return reduction(axis=axis, out=out, **passkwargs)
2601    
2602>       return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
2603E       RuntimeWarning: invalid value encountered in reduce
2604
2605../../../virtualenv/python3.6.7/lib/python3.6/site-packages/numpy/core/fromnumeric.py:83: RuntimeWarning
2606
2607
2608

@anntzer
Copy link
Contributor Author

anntzer commented Feb 15, 2020

Yup, looks like the comment is just wrong and we'll need to wait for numpy>=1.16 per numpy/numpy#12236 (we need to wait until Jan. 2021 for the bump). I'll just update the comment instead...

@anntzer anntzer changed the title Remove a numpy<1.15 workaround (we now require >=1.15). Update a comment re: minimum version of numpy working around bug. Feb 15, 2020
@jklymak
Copy link
Member

jklymak commented Feb 15, 2020

OK, this is just a comment change, so merging....

@jklymak jklymak merged commit 6a8e39f into matplotlib:master Feb 15, 2020
@anntzer anntzer deleted the np115 branch February 16, 2020 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants