René's URL Explorer Experiment


Title: converted assert into exception by montefra · Pull Request #3060 · matplotlib/matplotlib · GitHub

Open Graph Title: converted assert into exception by montefra · Pull Request #3060 · matplotlib/matplotlib

X Title: converted assert into exception by montefra · Pull Request #3060 · matplotlib/matplotlib

Description: A few days I ago I was experimenting for a possible answer to this question. While trying fig1, ax1 = plt.subplots() fig2, ax2 = plt.subplots() fig2.add_axes(ax1) I stumbled into an AssertionError without any explanation (I had to get the doc of add_axes). My understanding is that assert should be reserved for debugging, not to throw errors if the user give a wrong parameter. So I've converted them to exception. I've also noticed that assert is used all over the places. If there are no strong opinions in the next weeks I'll to go through the code and convert them to exceptions.

Open Graph Description: A few days I ago I was experimenting for a possible answer to this question. While trying fig1, ax1 = plt.subplots() fig2, ax2 = plt.subplots() fig2.add_axes(ax1) I stumbled into an AssertionError...

X Description: A few days I ago I was experimenting for a possible answer to this question. While trying fig1, ax1 = plt.subplots() fig2, ax2 = plt.subplots() fig2.add_axes(ax1) I stumbled into an AssertionError...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:259d741d-461a-afe3-f61f-f7008200ec5f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB7A6:1C7F18:1BFCC72:2663FE6:6A654DA5
html-safe-nonce88a3c78aa565fd737ac5916e87b8cfe3c18d9baad0c0a7053a2465e4d11f7eb5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0E2OjFDN0YxODoxQkZDQzcyOjI2NjNGRTY6NkE2NTREQTUiLCJ2aXNpdG9yX2lkIjoiNjg4NjY4OTQyMDQ4NDEwMzU5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1d9a014f34892bd38020675fdad6c5212c101a1f20e970e18be39a91c28dbd25
hovercard-subject-tagpull_request:15844416
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
twitter:imagehttps://avatars.githubusercontent.com/u/1394820?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1394820?s=400&v=4
og:image:altA few days I ago I was experimenting for a possible answer to this question. While trying fig1, ax1 = plt.subplots() fig2, ax2 = plt.subplots() fig2.add_axes(ax1) I stumbled into an AssertionError...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release309153364422b3c499922d1a2a6404910a58ed8e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F3060%2Fcommits%2F7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2F3060%2Fcommits%2F7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
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%2Fcommits&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
Reloadhttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
Reloadhttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
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 416 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
Conversation 82 https://github.com/matplotlib/matplotlib/pull/3060
Commits 36 https://github.com/matplotlib/matplotlib/pull/3060/commits
Checks 0 https://github.com/matplotlib/matplotlib/pull/3060/checks
Files changed https://github.com/matplotlib/matplotlib/pull/3060/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
converted assert into exception https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#top
Show all changes 36 commits https://github.com/matplotlib/matplotlib/pull/3060/files
873e91d converted assert into exception montefra May 13, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/873e91d6c9efd65fe965c9e3063787be31c9705b
b297f41 Exception type modified according to @pelson comment montefra May 26, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/b297f415639868d0894623cdcba4bb4dbc9c23eb
187f584 removed assert in `draw_artist` and `redraw_in_frame` montefra May 26, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/187f5846f6019525254e7bd3b0342daede98ca81
34c6a5f most asserts modified to ValueError montefra May 26, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/34c6a5f4ce71e7e54383a87bea43e07b00ecaf4e
0c1f9f7 All asserts substituted by ValueError montefra May 28, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/0c1f9f775a2c57fbafe4249b7e6fd1b05c428fd5
4cfa781 method name explicitly written in the message montefra May 28, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/4cfa781ab566c5501aa45dfde5317edf250ccb4f
aba9d99 Most asserts changed to ValueErrors. Two changed to warning montefra May 28, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/aba9d99b9ff780eba9b4cf578dbf3d357dc12e69
8fbb652 c* files done montefra May 30, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/8fbb652bf4ebe1c57da761246d746c1705b9e22e
5a45046 assert removed montefra May 30, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/5a450464a5a056c4ecb9d7b047bf2524cba5d5af
33fdabe Asserts removed. Side effect: function to check that the inputs have … montefra May 30, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/33fdabea7b0b2a09efb6203e48333dcc650e18d3
67bdfea Asserts removed throughout the files m* montefra Jun 3, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/67bdfea8b73210a620866f69dcfddbc182555f90
531004c Asserts removed throughout the files r* montefra Jun 3, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/531004c5de580673199371e0a46f8aade43248aa
eaca138 SyntaxError from Travis corrected montefra Jun 3, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/eaca138b0ce2ca6d47150bf67eb0f816a484ec38
9e4b911 assert removed from files s* montefra Jun 3, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/9e4b911e83eb7ac54c99ac267aba5b68da18fc3b
d12fbb8 asserts removed from t* file. test and tri directories ignored montefra Jun 4, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/d12fbb8b7b217fe967f6535993a40eb2b35a690d
7f80628 asserts removed from [u-z]* files montefra Jun 4, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
4fc36c6 the only assert in a python public function removed montefra Jun 4, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/4fc36c64dc0c6898868dca1baad47a6bd67b47a7
617b622 Bug introduced while getting rid of the asserts fixed montefra Jun 18, 2014 https://github.com/matplotlib/matplotlib/pull/3060/commits/617b62279e9d9078b1ea1f0103877dcac2884b7c
2cbb326 typo fixed (broke building documentation) montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/2cbb3265173cd6dd55223a55b36b853b876940a5
20966e9 pep8 fixed. plot_day_summary2 removed (retained by error when rebasing) montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/20966e93bc8b54d722c65fb45024f04c53ef3dc0
96c733e PEP8 fixed montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/96c733e9fe3b6473b8ee35b5cb0db4bc6f10c8e9
140210f PEP8 fixed - image.py montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/140210fb73866d8fe5d9045c59a796d83e8e7940
a2abc7b PEP 8 fixed - mlab.py montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/a2abc7bf929fc7f81d1caff5ac2190950f5954ac
25cec22 PEP 8 fixed - patches.py montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/25cec2290a6f467fbe1a4168657b9b399b818c85
06aedf7 PEP8 fixed - path.py montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/06aedf761f0897b197ac4ee12d54739bacf82928
77da3b6 PEP8 fixed - sankey.py montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/77da3b6bde47121214fc544c7d2e1a2bebc9c18f
95ae2cd PEP8 fixed - spines.py, table.py montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/95ae2cd715f4869a16d5d489417f115fbe26f0ed
b167c0c test adapted to code change (AssertionError -> ValueError) montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/b167c0c681990266e757daa8bdc161b36afa0fea
f9792a9 fixed according to #3060 comment montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/f9792a9c6553b6ea95f6872f0baea6ca493a785d
850178e Two bugs in assert -> exception transformation fixed montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/850178e4243ba91c49229c61dd82b9aac3e30350
c0ebd4f Typo fixed montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/c0ebd4ff8b34da3d42b9ce2c8b5bf9bc8e0af82b
6b6d2de Bug in assert -> exception transformation fixed montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/6b6d2de012ddabf108dd039b51d06d9aeeca4160
088542e Typo fixed montefra Mar 5, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/088542ebc29147dd6cc025619a098695065c0948
41bf6b5 Modified according to @tacaswell comments montefra Mar 16, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/41bf6b5c6e783eb8861ba75e8daf3f670d2bbfb6
7ea5c1a fixed pep8 Travis failure montefra Mar 16, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/7ea5c1a8677f9582f54aafc1b3293ef3aaf243bf
d6c3c32 python2.6 string formatting. style more uniform montefra Mar 22, 2015 https://github.com/matplotlib/matplotlib/pull/3060/commits/d6c3c32ca19bfa974a24cce3567383ee5b905fce
Clear filters https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
Prev https://github.com/matplotlib/matplotlib/pull/3060/commits/d12fbb8b7b217fe967f6535993a40eb2b35a690d
Next https://github.com/matplotlib/matplotlib/pull/3060/commits/4fc36c64dc0c6898868dca1baad47a6bd67b47a7
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
https://github.com/montefra
montefrahttps://github.com/matplotlib/matplotlib/commits?author=montefra
lib/matplotlib/widgets.pyhttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#diff-7e2b57811ea0cf4c29c147f61cff569194cdddfa9fea35eb897b4d786dca06ce
View file https://github.com/matplotlib/matplotlib/blob/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c/lib/matplotlib/widgets.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/3060/commits/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#diff-7e2b57811ea0cf4c29c147f61cff569194cdddfa9fea35eb897b4d786dca06ce
tacaswellhttps://github.com/tacaswell
Mar 16, 2015https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#r26456327
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#diff-7e2b57811ea0cf4c29c147f61cff569194cdddfa9fea35eb897b4d786dca06ce
https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#diff-7e2b57811ea0cf4c29c147f61cff569194cdddfa9fea35eb897b4d786dca06ce
tacaswellhttps://github.com/tacaswell
Mar 22, 2015https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#r26899506
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c
https://github.com/matplotlib/matplotlib/pull/3060/commits/7f8062802beb57cc71e7ad7f622d8d7b3c19fc0c#diff-7e2b57811ea0cf4c29c147f61cff569194cdddfa9fea35eb897b4d786dca06ce
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.