Skip to content
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

ENH: add by_key #26

Merged
merged 4 commits into from
Dec 13, 2015
Merged

ENH: add by_key #26

merged 4 commits into from
Dec 13, 2015

Conversation

tacaswell
Copy link
Member

Promote _transpose to the public method by_key.

Promote `_transpose` to the public method `by_key`.
@tacaswell
Copy link
Member Author

@efiring @mdboom @jenshnielsen

I think this takes care of the cycler side of what we discussed. We probably should do a new cycler release very soon.

@WeatherGod
Copy link
Member

Will this still work even with other operators that I plan to add soon?
http://www.cs.odu.edu/~toida/nerzic/content/set/set_op_prop.html

On Mon, Nov 30, 2015 at 5:27 PM, Thomas A Caswell notifications@github.com
wrote:

@efiring https://github.com/efiring @mdboom https://github.com/mdboom
@jenshnielsen https://github.com/jenshnielsen

I think this takes care of the cycler side of what we discussed. We
probably should do a new cycler release very soon.


Reply to this email directly or view it on GitHub
#26 (comment).

@tacaswell
Copy link
Member Author

It should be because under the hood it just does list(self) which exercises all of the operations and gives you back a dict of lists which if you compose with only + is equivalent.

Doing this costs you all of your operator logic, but it works.

@WeatherGod
Copy link
Member

yup, I think you are right. For some reason, I had a thought over the vacation that this wouldn't work, but I can't for the life of me remember why I thought that...

@tacaswell tacaswell added this to the v1.0 milestone Dec 1, 2015
@@ -371,6 +375,9 @@ def _transpose(self):
out[k].append(d[k])
return out

# for back compatibility
_transpose = by_key
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this, since it was private to begin with?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was 50/50 on this. I was thinking of being semi-evil and using the private _transpose in mpl so that it will work with current tagged version of cycler so we don't have to do a full release cycle on cycler before implementing the key introspection on mpl.

Copy link
Member

Choose a reason for hiding this comment

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

Ah -- that seems like more than a good enough reason.

@mdboom
Copy link
Member

mdboom commented Dec 1, 2015

This should probably have a test. Other than that, 👍 from me.

@tacaswell
Copy link
Member Author

bump this should be merged.

efiring added a commit that referenced this pull request Dec 13, 2015
@efiring efiring merged commit 233c66d into matplotlib:master Dec 13, 2015
@tacaswell tacaswell deleted the enh_by_key branch December 13, 2015 05:21
QuLogic added a commit to QuLogic/cycler that referenced this pull request Oct 29, 2021
This is the first Cycler feature release in some years. New features
include:

* Added `Cycler.by_key`, which produces values by key (matplotlib#26)
* Added `Cycler.__contains__`, which adds support for `in` checks (matplotlib#34)
* Wheels now includes the LICENSE file (matplotlib#48)
* The sdist now includes the LICENSE (matplotlib#58) and tests (matplotlib#32)
* Cycler no longer supports Python 2. Supported versions of Python are
  3.6 and above.
QuLogic added a commit to QuLogic/cycler that referenced this pull request Oct 29, 2021
This is the first Cycler feature release in some years. New features
include:

* Added `Cycler.by_key`, which produces values by key (matplotlib#26)
* Added `Cycler.__contains__`, which adds support for `in` checks (matplotlib#34)
* Wheels now includes the LICENSE file (matplotlib#48)
* The sdist now includes the LICENSE (matplotlib#58) and tests (matplotlib#32)
* Cycler no longer supports Python 2. Supported versions of Python are
  3.6 and above.
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.

4 participants