René's URL Explorer Experiment


Title: Fix inplace arithmetic operators for numpy>=2 by apdavison · Pull Request #271 · python-quantities/python-quantities · GitHub

Open Graph Title: Fix inplace arithmetic operators for numpy>=2 by apdavison · Pull Request #271 · python-quantities/python-quantities

X Title: Fix inplace arithmetic operators for numpy>=2 by apdavison · Pull Request #271 · python-quantities/python-quantities

Description: The reason for the broken in-place behaviour reported in #254 and #258 is that with NumPy 1.x, super().__imul__(other) calls self.__array_prepare__(self, context), which calculates the correct units, but _array_prepare__ was removed from NumPy in NumPy 2.0. This is an inelegant quick fix, calling self.__array_prepare__(self, context) explicitly. It's inelegant because we have to reconstruct context, and we have similar code in multiple places. This will hopefully be enough to get a release out quickly, then we can revisit this when we have more time and fix it properly, probably by implementing __array_ufunc__. See: https://numpy.org/devdocs/release/2.0.0-notes.html#array-prepare-is-removed https://numpy.org/neps/nep-0013-ufunc-overrides.html

Open Graph Description: The reason for the broken in-place behaviour reported in #254 and #258 is that with NumPy 1.x, super().__imul__(other) calls self.__array_prepare__(self, context), which calculates the correct unit...

X Description: The reason for the broken in-place behaviour reported in #254 and #258 is that with NumPy 1.x, super().__imul__(other) calls self.__array_prepare__(self, context), which calculates the correct unit...

Opengraph URL: https://github.com/python-quantities/python-quantities/pull/271

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/checks(.:format)
route-controllerpull_requests
route-actionchecks
fetch-noncev2:f0b37478-58a5-4257-0aeb-aedf5109000f
current-catalog-service-hash87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a
request-id9F98:DEDFE:A59DB5:E0240C:696ABC0A
html-safe-noncee75623724e9eca81464b90167f2256d97fc8b3f9ce738ca0092e7e5b2bff979c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Rjk4OkRFREZFOkE1OURCNTpFMDI0MEM6Njk2QUJDMEEiLCJ2aXNpdG9yX2lkIjoiMjE2NTYzOTM2OTg4MTk5MjIwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0ca183ccdd0ed432600af137a67151df71eee17e1592307b8cfc4b045219e9ac
hovercard-subject-tagpull_request:3178810386
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/checks
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-quantities/python-quantities/pull/271/checks
twitter:imagehttps://avatars.githubusercontent.com/u/260552?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/260552?s=400&v=4
og:image:altThe reason for the broken in-place behaviour reported in #254 and #258 is that with NumPy 1.x, super().__imul__(other) calls self.__array_prepare__(self, context), which calculates the correct unit...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None46ce962e0e18113ea447391b6ace8b02d4d2861e57b4fbab3658698f73d8855b
turbo-cache-controlno-cache
go-importgithub.com/python-quantities/python-quantities git https://github.com/python-quantities/python-quantities.git
octolytics-dimension-user_id222003
octolytics-dimension-user_loginpython-quantities
octolytics-dimension-repository_id560911
octolytics-dimension-repository_nwopython-quantities/python-quantities
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id560911
octolytics-dimension-repository_network_root_nwopython-quantities/python-quantities
turbo-body-classeslogged-out env-production page-responsive full-width full-width-p-0
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release30300f30bb3949de255e84a146706a3bdb5c19c9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-quantities/python-quantities/pull/271/checks#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-quantities%2Fpython-quantities%2Fpull%2F271%2Fchecks
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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%2Fpython-quantities%2Fpython-quantities%2Fpull%2F271%2Fchecks
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%2Fchecks&source=header-repo&source_repo=python-quantities%2Fpython-quantities
Reloadhttps://github.com/python-quantities/python-quantities/pull/271/checks
Reloadhttps://github.com/python-quantities/python-quantities/pull/271/checks
Reloadhttps://github.com/python-quantities/python-quantities/pull/271/checks
python-quantities https://github.com/python-quantities
python-quantitieshttps://github.com/python-quantities/python-quantities
Notifications https://github.com/login?return_to=%2Fpython-quantities%2Fpython-quantities
Fork 77 https://github.com/login?return_to=%2Fpython-quantities%2Fpython-quantities
Star 216 https://github.com/login?return_to=%2Fpython-quantities%2Fpython-quantities
Code https://github.com/python-quantities/python-quantities
Issues 73 https://github.com/python-quantities/python-quantities/issues
Pull requests 4 https://github.com/python-quantities/python-quantities/pulls
Actions https://github.com/python-quantities/python-quantities/actions
Projects 0 https://github.com/python-quantities/python-quantities/projects
Wiki https://github.com/python-quantities/python-quantities/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python-quantities/python-quantities/security
Please reload this pagehttps://github.com/python-quantities/python-quantities/pull/271/checks
Insights https://github.com/python-quantities/python-quantities/pulse
Code https://github.com/python-quantities/python-quantities
Issues https://github.com/python-quantities/python-quantities/issues
Pull requests https://github.com/python-quantities/python-quantities/pulls
Actions https://github.com/python-quantities/python-quantities/actions
Projects https://github.com/python-quantities/python-quantities/projects
Wiki https://github.com/python-quantities/python-quantities/wiki
Security https://github.com/python-quantities/python-quantities/security
Insights https://github.com/python-quantities/python-quantities/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-quantities%2Fpython-quantities%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-quantities%2Fpython-quantities%2Fissues%2Fnew%2Fchoose
apdavisonhttps://github.com/apdavison
python-quantities:masterhttps://github.com/python-quantities/python-quantities/tree/master
apdavison:fix-inplacehttps://github.com/apdavison/python-quantities/tree/fix-inplace
Conversation 2 https://github.com/python-quantities/python-quantities/pull/271
Commits 3 https://github.com/python-quantities/python-quantities/pull/271/commits
Checks 58 https://github.com/python-quantities/python-quantities/pull/271/checks
Files changed https://github.com/python-quantities/python-quantities/pull/271/files
Please reload this pagehttps://github.com/python-quantities/python-quantities/pull/271/checks
Please reload this pagehttps://github.com/python-quantities/python-quantities/pull/271/checks
Sign in for the full log viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-quantities%2Fpython-quantities%2Fpull%2F271%2Fchecks
Fix inplace arithmetic operators for numpy>=2 https://github.com/python-quantities/python-quantities/pull/271/checks#top
Please reload this pagehttps://github.com/python-quantities/python-quantities/pull/271/checks
Test on: pull_request https://github.com/python-quantities/python-quantities/actions/runs/21061110264
test (ubuntu-latest, 3.10, 1.24) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427234?pr=271
test (ubuntu-latest, 3.10, 1.25) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427237?pr=271
test (ubuntu-latest, 3.10, 1.26) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427238?pr=271
test (ubuntu-latest, 3.10, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427219?pr=271
test (ubuntu-latest, 3.10, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427252?pr=271
test (ubuntu-latest, 3.10, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427246?pr=271
test (ubuntu-latest, 3.11, 1.24) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427298?pr=271
test (ubuntu-latest, 3.11, 1.25) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427289?pr=271
test (ubuntu-latest, 3.11, 1.26) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427245?pr=271
test (ubuntu-latest, 3.11, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427241?pr=271
test (ubuntu-latest, 3.11, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427278?pr=271
test (ubuntu-latest, 3.11, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427296?pr=271
test (ubuntu-latest, 3.11, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427355?pr=271
test (ubuntu-latest, 3.12, 1.26) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427273?pr=271
test (ubuntu-latest, 3.12, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427353?pr=271
test (ubuntu-latest, 3.12, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427292?pr=271
test (ubuntu-latest, 3.12, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427268?pr=271
test (ubuntu-latest, 3.12, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427322?pr=271
test (ubuntu-latest, 3.12, 2.4) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427291?pr=271
test (ubuntu-latest, 3.13, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427287?pr=271
test (ubuntu-latest, 3.13, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427319?pr=271
test (ubuntu-latest, 3.13, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427314?pr=271
test (ubuntu-latest, 3.13, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427334?pr=271
test (ubuntu-latest, 3.13, 2.4) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427335?pr=271
test (ubuntu-latest, 3.14, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427321?pr=271
test (ubuntu-latest, 3.14, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427295?pr=271
test (ubuntu-latest, 3.14, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427309?pr=271
test (ubuntu-latest, 3.14, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427312?pr=271
test (ubuntu-latest, 3.14, 2.4) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427316?pr=271
type-check (ubuntu-latest, 3.10, 1.24) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427306?pr=271
type-check (ubuntu-latest, 3.10, 1.25) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427339?pr=271
type-check (ubuntu-latest, 3.10, 1.26) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427376?pr=271
type-check (ubuntu-latest, 3.10, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427323?pr=271
type-check (ubuntu-latest, 3.10, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427329?pr=271
type-check (ubuntu-latest, 3.10, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427351?pr=271
type-check (ubuntu-latest, 3.11, 1.24) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427325?pr=271
type-check (ubuntu-latest, 3.11, 1.25) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427361?pr=271
type-check (ubuntu-latest, 3.11, 1.26) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427368?pr=271
type-check (ubuntu-latest, 3.11, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427336?pr=271
type-check (ubuntu-latest, 3.11, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427308?pr=271
type-check (ubuntu-latest, 3.11, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427354?pr=271
type-check (ubuntu-latest, 3.11, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427327?pr=271
type-check (ubuntu-latest, 3.12, 1.26) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427385?pr=271
type-check (ubuntu-latest, 3.12, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427362?pr=271
type-check (ubuntu-latest, 3.12, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427448?pr=271
type-check (ubuntu-latest, 3.12, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427372?pr=271
type-check (ubuntu-latest, 3.12, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427374?pr=271
type-check (ubuntu-latest, 3.12, 2.4) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427346?pr=271
type-check (ubuntu-latest, 3.13, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427343?pr=271
type-check (ubuntu-latest, 3.13, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427377?pr=271
type-check (ubuntu-latest, 3.13, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427366?pr=271
type-check (ubuntu-latest, 3.13, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427429?pr=271
type-check (ubuntu-latest, 3.13, 2.4) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427378?pr=271
type-check (ubuntu-latest, 3.14, 2.0) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427387?pr=271
type-check (ubuntu-latest, 3.14, 2.1) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427365?pr=271
type-check (ubuntu-latest, 3.14, 2.2) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427394?pr=271
type-check (ubuntu-latest, 3.14, 2.3) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427363?pr=271
type-check (ubuntu-latest, 3.14, 2.4) https://github.com/python-quantities/python-quantities/actions/runs/21061110264/job/60567427389?pr=271
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.