René's URL Explorer Experiment


Title: difference in promotion between py2 and py3 · Issue #41 · ndarray/ndarray · GitHub

Open Graph Title: difference in promotion between py2 and py3 · Issue #41 · ndarray/ndarray

X Title: difference in promotion between py2 and py3 · Issue #41 · ndarray/ndarray

Description: Here's a weird one. I have a histogram class that overloads += operator: bp::class_ ("histogram", bp::init ( (bp::arg ("min"), bp::arg ("max"), bp::arg ("delta"), bp::arg ("clip")=true ))) .def (bp::ini...

Open Graph Description: Here's a weird one. I have a histogram class that overloads += operator: bp::class_ ("histogram", bp::init ( (bp::arg ("min"), bp::arg ("max"), bp::arg ("delta"),...

X Description: Here's a weird one. I have a histogram class that overloads += operator: bp::class_<hist_t> ("histogram", bp::init<double,double,double,bool> ( (bp::arg ("min"),...

Opengraph URL: https://github.com/ndarray/ndarray/issues/41

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"difference in promotion between py2 and py3","articleBody":"Here's a weird one.  I have a histogram class that overloads += operator:\n\n``` python\n  bp::class_\u003chist_t\u003e (\"histogram\", bp::init\u003cdouble,double,double,bool\u003e (\n                                          (bp::arg (\"min\"),\n                                           bp::arg (\"max\"),\n                                           bp::arg (\"delta\"),\n                                           bp::arg (\"clip\")=true\n                                           )))\n    .def (bp::init\u003cnd::Array\u003cint64_t,1,1\u003e,double,double,double,bool\u003e())\n    .def (bp::self += hist_t::value_type())\n    .def (bp::self += nd::Array\u003cdouble,1,0\u003e())\n    .def (\"__call__\", \u0026hist_t::operator())\n    .def_readwrite (\"results\", \u0026hist_t::buckets)\n    .add_property (\"buckets\", \u0026get_buckets\u003chist_t,nd::Array\u003cdouble,1,1\u003e \u003e)\n    .def (\"mean\", \u0026hist_t::Mean)\n    .def (\"rms\", \u0026hist_t::RMS)\n    .def (\"cumulative\", \u0026hist_t::Cumulative\u003cnd::Array\u003cdouble,1,1\u003e \u003e)\n    .def (\"inv_cumulative\", \u0026hist_t::OneMinusCumulative\u003cnd::Array\u003cdouble,1,1\u003e \u003e)\n    .def_pickle(hist_pickle_suite\u003chist_t\u003e())\n\n    .def_readonly (\"min\", \u0026hist_t::min)\n    .def_readonly (\"max\", \u0026hist_t::max)\n    .def_readonly (\"delta\", \u0026hist_t::delta)\n    .add_property (\"rc\", \u0026getrc\u003chist_t\u003e) // just for info\n    ;\n```\n\nI call it:\n        remod_out_hist += np.sum (np.max (remod_out_cnts, axis=1))\n\nNow if we print out the type (np.sum (np.max ...)) on \npy2: `\u003ctype 'numpy.int64'\u003e`\n\nbut on py3: `\u003cclass 'numpy.int64'\u003e`\n\nWhen run on py2, the type numpy.int64 seems to be promoted to double, which matches the 1st self += (value_type should be double).\n\nBut when run on py3, the promotion fails:\nBoost.Python.ArgumentError: Python argument types in\n    histogram.**iadd**(histogram, numpy.int64)\ndid not match C++ signature:\n    **iadd**(boost::python::back_reference\u003cHistogram\u003clong, double, ndarray::Array\u003clong, 1, 1\u003e \u003e\u0026\u003e, ndarray::Array\u003cdouble, 1, 0\u003e)\n    **iadd**(boost::python::back_reference\u003cHistogram\u003clong, double, ndarray::Array\u003clong, 1, 1\u003e \u003e\u0026\u003e, double)\n\nIf I explicitly write\n        remod_out_hist += float(np.sum (np.max (remod_out_cnts, axis=1)))\n\nthen it runs on py3\n\nI'm wondering if the difference in type() on py2 and py3 might explain the different behavior.\n","author":{"url":"https://github.com/nbecker","@type":"Person","name":"nbecker"},"datePublished":"2015-06-11T18:02:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/41/ndarray/issues/41"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f5b7ab3f-f4cc-6dff-d9dd-3711db4c95c8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA846:2FC763:17635B0:20C6530:6970D6BA
html-safe-nonce35165f02530d471252833aaedfbe4c11ceb02f4ab8924225c177eff7a9488b6c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODQ2OjJGQzc2MzoxNzYzNUIwOjIwQzY1MzA6Njk3MEQ2QkEiLCJ2aXNpdG9yX2lkIjoiMzYwMjIwMjk5NzIwODE3NjMxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac63b6ea5f78094f6a8923a968010ac8dbcff263febf12b946350dafc35f11217b
hovercard-subject-tagissue:87431963
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ndarray/ndarray/41/issue_layout
twitter:imagehttps://opengraph.githubassets.com/136d2de81747a1e42f98cb26edffa076f195b5519f3c03624525fdfbb925f5b9/ndarray/ndarray/issues/41
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/136d2de81747a1e42f98cb26edffa076f195b5519f3c03624525fdfbb925f5b9/ndarray/ndarray/issues/41
og:image:altHere's a weird one. I have a histogram class that overloads += operator: bp::class_ ("histogram", bp::init ( (bp::arg ("min"), bp::arg ("max"), bp::arg ("delta"),...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenbecker
hostnamegithub.com
expected-hostnamegithub.com
None034aaee9edccd455c18591b13122193c6e12dc773e8a203be73abe934f3e3a72
turbo-cache-controlno-preview
go-importgithub.com/ndarray/ndarray git https://github.com/ndarray/ndarray.git
octolytics-dimension-user_id1451802
octolytics-dimension-user_loginndarray
octolytics-dimension-repository_id3487413
octolytics-dimension-repository_nwondarray/ndarray
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3487413
octolytics-dimension-repository_network_root_nwondarray/ndarray
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
release52d1d534d0b88c64972e852deb460d09b433b8b2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/ndarray/ndarray/issues/41#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fndarray%2Fndarray%2Fissues%2F41
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fndarray%2Fndarray%2Fissues%2F41
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=ndarray%2Fndarray
Reloadhttps://patch-diff.githubusercontent.com/ndarray/ndarray/issues/41
Reloadhttps://patch-diff.githubusercontent.com/ndarray/ndarray/issues/41
Reloadhttps://patch-diff.githubusercontent.com/ndarray/ndarray/issues/41
ndarray https://patch-diff.githubusercontent.com/ndarray
ndarrayhttps://patch-diff.githubusercontent.com/ndarray/ndarray
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fndarray%2Fndarray
Fork 36 https://patch-diff.githubusercontent.com/login?return_to=%2Fndarray%2Fndarray
Star 163 https://patch-diff.githubusercontent.com/login?return_to=%2Fndarray%2Fndarray
Code https://patch-diff.githubusercontent.com/ndarray/ndarray
Issues 22 https://patch-diff.githubusercontent.com/ndarray/ndarray/issues
Pull requests 4 https://patch-diff.githubusercontent.com/ndarray/ndarray/pulls
Actions https://patch-diff.githubusercontent.com/ndarray/ndarray/actions
Projects 0 https://patch-diff.githubusercontent.com/ndarray/ndarray/projects
Wiki https://patch-diff.githubusercontent.com/ndarray/ndarray/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/ndarray/ndarray/security
Please reload this pagehttps://patch-diff.githubusercontent.com/ndarray/ndarray/issues/41
Insights https://patch-diff.githubusercontent.com/ndarray/ndarray/pulse
Code https://patch-diff.githubusercontent.com/ndarray/ndarray
Issues https://patch-diff.githubusercontent.com/ndarray/ndarray/issues
Pull requests https://patch-diff.githubusercontent.com/ndarray/ndarray/pulls
Actions https://patch-diff.githubusercontent.com/ndarray/ndarray/actions
Projects https://patch-diff.githubusercontent.com/ndarray/ndarray/projects
Wiki https://patch-diff.githubusercontent.com/ndarray/ndarray/wiki
Security https://patch-diff.githubusercontent.com/ndarray/ndarray/security
Insights https://patch-diff.githubusercontent.com/ndarray/ndarray/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/ndarray/ndarray/issues/41
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/ndarray/ndarray/issues/41
difference in promotion between py2 and py3https://patch-diff.githubusercontent.com/ndarray/ndarray/issues/41#top
https://github.com/nbecker
https://github.com/nbecker
nbeckerhttps://github.com/nbecker
on Jun 11, 2015https://github.com/ndarray/ndarray/issues/41#issue-87431963
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.