René's URL Explorer Experiment


Title: Cycler by tacaswell · Pull Request #4258 · matplotlib/matplotlib · GitHub

Open Graph Title: Cycler by tacaswell · Pull Request #4258 · matplotlib/matplotlib

X Title: Cycler by tacaswell · Pull Request #4258 · matplotlib/matplotlib

Description: a = SingleCycler('c', ['r', 'purple', 'lime']) b = SingleCycler('lw', [1, 5]) c = SingleCycler('markevery', [10, 50]) m = SingleCycler('marker', 'o') # note length 1 fig, ax_lst = plt.subplots(2, 2) def cycle_demo(ax, cycler): c_len = len(cycler) th = np.linspace(0, 2*np.pi, 1024) y = np.sin(th) for j, p in zip(range(2*c_len), cycler): ax.plot(th, j + y, **p) for ax, cc in zip(ax_lst.ravel(), [a, a + b, a*b, (c*m)*a]): cycle_demo(ax, cc) As discussed in several places the problem of doing arbitrary style cycles over arbitrary parameters and inputs is a bit vexing. Inspired by Holoviews and sensible composable objects, I have implemented Cyclers which give an easy API to construct these cycles. There are two types of composition + which is an 'inner' product implemented by zipping the two cycles together and * which is an 'outer' product which is implemented with itertools.product. There are two implementation (one of which will be deleted), but am a bit torn on which one I like better. The Cycler class is a stand alone class which handles both 'single' cycles and 'compound' cycles via a classmethod constructor and some implicit magic. The other is a set of three classes {_base_cycler, SingleCycler, and CompoundCycler} which handle respectively the composition logic, 'single' cycles and compound cycles. I am leaning towards the 3 class implementation because it has less implicit magic and users don't have to use a class method to get useful objects. In both cases, the objects have len, __iter__ (which is infinite), finite_iter (which in __iter__, but finite), and keys (which says what properties the cycle is over). The composition fails if the same property appears on both sides. These are useful on their own, but I think replacing the color cycle on Axes with one of these would be a major usability gain. I am not wedded to any of the class names. Documentation, examples, and testing will come later if people think this is a good idea. Should probably also add an in-place version of + and * as well. attn @WeatherGod @efiring @mdboom @pelson @danielballan

Open Graph Description: a = SingleCycler('c', ['r', 'purple', 'lime']) b = SingleCycler('lw', [1, 5]) c = SingleCycler('markevery', [10, 50]) m = SingleCycler('marker...

X Description: a = SingleCycler('c', ['r', 'purple', 'lime']) b = SingleCycler('lw', [1, 5]) c = SingleCycler('markevery&...

Opengraph URL: https://github.com/matplotlib/matplotlib/pull/4258

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c5bcc603-e4a7-d5ae-84e3-33b8c3ea13fe
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE232:1BECEB:15CCEBC:1CE7EC7:6A534C93
html-safe-nonce3f5c3ea58b2f5501162418fbd7e007e02fac4fc4c05f8f17a4811c8fd2f69acb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjMyOjFCRUNFQjoxNUNDRUJDOjFDRTdFQzc6NkE1MzRDOTMiLCJ2aXNpdG9yX2lkIjoiNDAzOTU4NzE4OTQ0ODk4NTc0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd6ac24ef7b2b5246282fd805ab8ec6bec22994c8ca1e191c047c59811a887bb0
hovercard-subject-tagpull_request:31680038
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/4258/files
twitter:imagehttps://avatars.githubusercontent.com/u/199813?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/199813?s=400&v=4
og:image:alta = SingleCycler('c', ['r', 'purple', 'lime']) b = SingleCycler('lw', [1, 5]) c = SingleCycler('markevery', [10, 50]) m = SingleCycler('marker...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/4258/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F4258%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F4258%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/pull/4258/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/4258/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/4258/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4258/files
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4258/files
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
tacaswellhttps://github.com/tacaswell
matplotlib:masterhttps://github.com/matplotlib/matplotlib/tree/master
tacaswell:cyclerhttps://github.com/tacaswell/matplotlib/tree/cycler
Conversation 28 https://github.com/matplotlib/matplotlib/pull/4258
Commits 25 https://github.com/matplotlib/matplotlib/pull/4258/commits
Checks 0 https://github.com/matplotlib/matplotlib/pull/4258/checks
Files changed 5 https://github.com/matplotlib/matplotlib/pull/4258/files
Cycler https://github.com/matplotlib/matplotlib/pull/4258/files#top
Show all changes 25 commits https://github.com/matplotlib/matplotlib/pull/4258/files
5e23ba2 WIP : first pass at adding a Cycler tacaswell Mar 21, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/5e23ba2f1175ff971203001b9f0eb035446b3a8d
5539698 WIP : version 2 of cycler classes tacaswell Mar 21, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/5539698582638303e06be85364d0497c39e2821c
958b0b6 MNT : tweak Cycler API tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/958b0b63f53a173bc424e94e3f8637b350ce1f4f
6b0696d MNT : Cycler-family API tweaks tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/6b0696defe0a99b0f716823a4b6f5cd1b4a97a51
2f57756 ENH : added in-place operations tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/2f57756804bb8713408e6682e40a516ec7f6ac26
4aef726 ENH : added verbose repr tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/4aef726ffdc889de01af3d5cd22455aadad286fe
105fcd6 MNT : make keys property return a copy tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/105fcd68d62623dcc340173ca7cf6ff63ebb5e38
a0c387a MNT : simplify repr tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/a0c387acce99fcaa6c3108db88f130b6b2f77be8
2355776 ENH : make `cycler` deal with Cycler input tacaswell Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/23557765f33a831de44ae4d154e35a605b8add97
74e61e1 MNT : remove second version of Cycler classes tacaswell Mar 23, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/74e61e1db1ee8c053aae328ae925501ee4934bb8
e6910e4 ENH : add to_list method tacaswell Mar 23, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/e6910e4db632e9ff317f8b7bac85d8c78a0ec983
1532863 PRF : make __len__ more efficient tacaswell Mar 23, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/1532863ae9176f71b7a1c51e9ff6ef00cba6642c
d5ec6d8 TST : first round of tests for Cycler tacaswell Apr 22, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/d5ec6d8cef088b0e56a3e3face01f280ad14bd26
0da274f API : make __iter__ be finite tacaswell Apr 27, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/0da274f6e5e792f57228c3fa9b101d59d47eca13
52b5dfd DOC/WIP : first draft a docs for cycler tacaswell Apr 27, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/52b5dfd01f5c6a7533bb59d4d529d94369b1a3b0
d4195f7 WIP : more edits to docs tacaswell May 5, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/d4195f75f109758f80fb96a19b8b90b1101a95bd
3e8bd8e ENH : add simplify tacaswell May 6, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/3e8bd8e832c452cd28ecee97bf2bd0b0af7297c8
6fea7a4 ENH : add integer multiplication tacaswell May 6, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/6fea7a46446327c6de8ba551cfc2b2d3b42ae5df
2ffc5e1 TST : test commutativity of cycler addition tacaswell May 6, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/2ffc5e1e7b308287fd7f7b13505324b2d1da020e
126d7df ENH : implement `__getitem__` for Cycler tacaswell May 6, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/126d7df45a5cde9cdff8c04c6665b956d3ab683d
a56ea63 API : Only allow addition of equal length cycles tacaswell May 6, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/a56ea63d1bec846cd4b7ad9b3f1d6fe1ae216a98
58610f4 DOC : more edits to docs tacaswell May 6, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/58610f49bea768e9ec1aca42e857247591c9a6ca
c76b976 DOC : more work on documentation tacaswell May 7, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/c76b976330dec0f09a393303432baf0f521a6d0f
14df70f ENH: Add a rich display hook to Cycler. danielballan May 7, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/14df70f14eccfac02473ee6d52a989fc7f120320
2600179 Merge pull request #11 from danielballan/cycler-html tacaswell May 7, 2015 https://github.com/matplotlib/matplotlib/pull/4258/commits/26001791d1eefd2b7fcce05900ab679ce4e54a48
Clear filters https://github.com/matplotlib/matplotlib/pull/4258/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4258/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4258/files
conf.py https://github.com/matplotlib/matplotlib/pull/4258/files#diff-e170e9a7d787c21095c6c11bb25f0f1ff0294a42a46d45ba6fb5ed794e457624
cycler.rst https://github.com/matplotlib/matplotlib/pull/4258/files#diff-e21151b51f1368942c2600ccf3baa265d049dd713b4732862cddf05dd38d063f
index.rst https://github.com/matplotlib/matplotlib/pull/4258/files#diff-fc36104772a391eb28db0dbf6d8a1c4229e694719d6b5ebc5c9675b26b07ee1f
cycler.py https://github.com/matplotlib/matplotlib/pull/4258/files#diff-15abc7c8f2b128b34b72253ff65171c6e7d65608ce919e697ecff1d58b0257c1
test_cycler.py https://github.com/matplotlib/matplotlib/pull/4258/files#diff-99ff6a2fc68dccd896c995215f180a186a3c306bade5bbafc8ccff2a28bdb090
doc/conf.pyhttps://github.com/matplotlib/matplotlib/pull/4258/files#diff-e170e9a7d787c21095c6c11bb25f0f1ff0294a42a46d45ba6fb5ed794e457624
View file https://github.com/tacaswell/matplotlib/blob/26001791d1eefd2b7fcce05900ab679ce4e54a48/doc/conf.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/4258/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/4258/files#diff-e170e9a7d787c21095c6c11bb25f0f1ff0294a42a46d45ba6fb5ed794e457624
https://github.com/matplotlib/matplotlib/pull/4258/files#diff-e170e9a7d787c21095c6c11bb25f0f1ff0294a42a46d45ba6fb5ed794e457624
doc/users/cycler.rsthttps://github.com/matplotlib/matplotlib/pull/4258/files#diff-e21151b51f1368942c2600ccf3baa265d049dd713b4732862cddf05dd38d063f
View file https://github.com/tacaswell/matplotlib/blob/26001791d1eefd2b7fcce05900ab679ce4e54a48/doc/users/cycler.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/4258/{{ revealButtonHref }}
doc/users/index.rsthttps://github.com/matplotlib/matplotlib/pull/4258/files#diff-fc36104772a391eb28db0dbf6d8a1c4229e694719d6b5ebc5c9675b26b07ee1f
View file https://github.com/tacaswell/matplotlib/blob/26001791d1eefd2b7fcce05900ab679ce4e54a48/doc/users/index.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/4258/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/4258/files#diff-fc36104772a391eb28db0dbf6d8a1c4229e694719d6b5ebc5c9675b26b07ee1f
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4258/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.