Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

FIX: Fix get_facecolors#11877

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
larsoner wants to merge1 commit intomatplotlib:masterfromlarsoner:fix-mplot3d

Conversation

larsoner
Copy link
Contributor

@larsonerlarsoner commentedAug 18, 2018
edited
Loading

Onmaster the added test throws:

lib/mpl_toolkits/tests/test_mplot3d.py:261: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ lib/matplotlib/cbook/__init__.py:1918: in method    return getattr(self, name)(*args, **kwargs)_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <mpl_toolkits.mplot3d.art3d.Poly3DCollection object at 0x7f80a4da6f60>    def get_facecolor(self):>       return self._facecolors2dE       AttributeError: 'Poly3DCollection' object has no attribute '_facecolors2d'

Now it passes.

I also added ar""" on a docstring inlib/matplotlib/artist.py that had a\s in it as it was raising a SyntaxError on my system without it.

@jklymak
Copy link
Member

I'm confused by this. Are you sayingget_facecolor doesn't work on master? If so, why are you adding a new method,get_facecolors that returns something different? If this is indeed the right thing to do, then should you also addget_edgecolors?

@ImportanceOfBeingErnest
Copy link
Member

Might be related:#10797

@larsoner
Copy link
ContributorAuthor

Are you saying get_facecolor doesn't work on master?

Yes indeed for PolyCollection3D, the code snippet in my top comment that shows what the smoke test does onmaster.

If so, why are you adding a new method, get_facecolors that returns something different

The method from the super classPolyCollection tries to return_facecolors2d which does not necessarily exist. I looked and saw_facecolors did so I used that, but it's possible:

  1. it should be_facecolors3d
  2. some other function needs to be called to ensure that some magic happens so that_facecolors2d does exist. It looks like_facecolors2d should be set bydo_3d_projection, so perhaps that isn't being called but should be. ThePoly3DCollection code has a comment that it does some magic with these properties, so I'm not really sure which is correct. I should double-check which one makes our code work properly.
  3. Something else entirely.

I have not donegit blame but based on how long I've been hitting this issue (months, not years) and browsing the GitHub history, it looks like this probably caused it:

7c40fdf

I'll try to do a propergit blame at some point.

If this is indeed the right thing to do, then should you also add get_edgecolors

Yes this is true, I'll add tests for a few other properties.

Might be related:#10797

#10797 looks related, but I would be surprised if it fixed this bug. But the magical aspects of Poly3DCollection might allow it to fix the bug in some way that is not immediately obvious.

@larsoner
Copy link
ContributorAuthor

I probably should have tackled this PR sooner -- we now get failures in ourmaster code, so I guess this is in the newly released 2.2.3, too:

https://travis-ci.org/mne-tools/mne-python/jobs/417532117#L2699

@ImportanceOfBeingErnest
Copy link
Member

Also see#9559. At the end this is the same as#4067. There are some comments by@WeatherGod and an attempted fix in#4090 which never made it through. Not sure what problems there were/are.

@larsoner
Copy link
ContributorAuthor

I guess this should be closed in favor of#4090, then?

@jklymak
Copy link
Member

Yes indeed for PolyCollection3D, the code snippet in my top comment that shows what the smoke test does on master.

I'm still confused. Your smoke test callsget_facecolors, whereas the error above is forget_facecolor (nos at the end). If so, I don't see how the PR gets rid of the original error message.

ping@WeatherGod

@larsoner
Copy link
ContributorAuthor

Ahh I see what you mean. In the older code / base I was working on, the plural was just an alias for the non-plural inPolyCollection. Inmaster I can't find the def ofget_facecolors anywhere, despite it being used in several examples and even incollections.py itself. So it's either just implicitly an alias now, or there are some more bugs / untested lines and examples.

In any case I'll close this for now since I found a suitable workaround, and#4090 is probably the right way to go anyway.

@larsonerlarsoner deleted the fix-mplot3d branchAugust 18, 2018 19:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@larsoner@jklymak@ImportanceOfBeingErnest

[8]ページ先頭

©2009-2025 Movatter.jp