Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix #5572: Allow passing empty range to broken_barh #5600

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 3 commits into from
Dec 28, 2015

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Dec 1, 2015

No description provided.

@mdboom mdboom added this to the Critical bugfix release (1.5.1) milestone Dec 1, 2015
self._process_unit_info(xdata=xranges[0],
ydata=yrange[0],
if len(xranges):
xdata = xranges[0]
Copy link
Member

Choose a reason for hiding this comment

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

Probably safer to do xdata = next(iter(xrange)) in a try...except block. pandas Series slice on index rather than position

try:
    xdata = next(iter(xranges))
except (StopIteration, TypeError):
    xdata = None

@efiring
Copy link
Member

efiring commented Dec 3, 2015

I dimly recall seeing this sort of pre-processing prior to _process_unit_info elsewhere; does it need to be factored out? E.g., could it be added to _process_unit_info itself, perhaps activated with a kwarg? Is there also a Pandas conversion stage that we are stuck having to use now, so that we don't end up sprinkling things like six.next(iter(xxx)) all over the place?

@mdboom
Copy link
Member Author

mdboom commented Dec 22, 2015

This is now ready to merge.

self._process_unit_info(xdata=xranges[0],
ydata=yrange[0],
if len(xranges):
xdata = six.next(iter(xranges))
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just use next here https://docs.python.org/2/library/functions.html#next I think six provides it to support back to 2.4 or something like that.

efiring added a commit that referenced this pull request Dec 28, 2015
Fix #5572: Allow passing empty range to broken_barh
@efiring efiring merged commit e7c51dc into matplotlib:master Dec 28, 2015
efiring added a commit that referenced this pull request Dec 28, 2015
Fix #5572: Allow passing empty range to broken_barh
@tacaswell
Copy link
Member

backported as 8228dbd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.