René's URL Explorer Experiment


Title: Formalize axis matching rules · Issue #464 · larray-project/larray · GitHub

Open Graph Title: Formalize axis matching rules · Issue #464 · larray-project/larray

X Title: Formalize axis matching rules · Issue #464 · larray-project/larray

Description: After much thoughts, I have progressed only a little. For context, the central point in all this is the behaviour of AxisCollection.union, which is used in stack, binary ops (via make_numpy_broadcastable) and getitem (via broadcast_with)...

Open Graph Description: After much thoughts, I have progressed only a little. For context, the central point in all this is the behaviour of AxisCollection.union, which is used in stack, binary ops (via make_numpy_broadca...

X Description: After much thoughts, I have progressed only a little. For context, the central point in all this is the behaviour of AxisCollection.union, which is used in stack, binary ops (via make_numpy_broadca...

Opengraph URL: https://github.com/larray-project/larray/issues/464

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Formalize axis matching rules","articleBody":"After much thoughts, I have progressed only a little.\r\n\r\nFor context, the central point in all this is the behaviour of AxisCollection.union, which is used in stack, binary ops (via make_numpy_broadcastable) and getitem (via broadcast_with).\r\n\r\nGiven arrays:\r\narr1: a (2) x b (3) x {2} (4) x d (4)\r\narr2: c (4) x a (2) x {2} (4) x {3} (3)\r\n\r\n\r\nHow do we match axes? What I am convinced of so far is:\r\n\r\n* axes with the same name should always match in the absence of duplicate name.\r\n* we should **not** use axes **absolute** positions as \"temporary name\" for anonymous axes, as this must work\r\narr1: a (2) x b (3) x c (4)\r\narr2: a (2) x {1} (3) x {2} (4)\r\n\r\nHere are a few options:\r\n\r\n* first match named axes common in both then match the remaining axes by **relative** position:\r\n  - arr1: a (2) x b (3) x c (3)\r\n    arr2: {0} (3) x {1} (3) x a (2) x d (4) \r\n    => match a, that leaves us with:\r\n    arr1: b (3) x c (3)\r\n    arr2: {0} (3) x {1} (3)\r\n    => result is a (2) x b (3) x c (3) x d (4)\r\n\r\n  - arr1: a (2) x b (3) x c (3)\r\n    arr2: d (4) x {1} (3) x {2} (3) x a (2)\r\n    => match a, that leaves us with:\r\n    arr1: b (3) x c (3)\r\n    arr2: d (4) x {1} (3) x {2} (3)\r\n    => result is error d(4) is incompatible with b(3)\r\n  \r\n  **problem**: we need \r\n  - arr1: a (2) x b (3) x c (3)\r\n    arr2: d (4)\r\n    to result in a (2) x b (3) x c (3) x d (4)\r\n\r\n* current situation: self[axis] (=> axis.equals for anonymous) then by absolute position. Equals => anonymous cannot match non anonymous except by **absolute** position.\r\n\r\n* match with **first compatible** axis\r\n\r\n  res = self[:]\r\n  for other_axis in other_axes:\r\n      if not any(axis.iscompatible(other_axis) for axis in self):\r\n          res.append(other_axis)\r\n \r\n  - arr1: a (2) x b (3) x c (3)\r\n    arr2: {0} (3) x {1} (3) x a (2) x d (4) \r\n    => result is a (2) x b (3) x c (3) x d (4) (assuming no wildcard axis)\r\n  problem: several axes can match the same axis which will break (probably in transpose\r\n     eg. if {0} and {1} are wildcard axes, the result will probably be an error somewhere because it is ambiguous whether {0}* refers to b or c\r\n    => an anonymous wildcard axis of length 1 would match with all axes so it would always generate ambiguous errors.\r\n    => unsure it plays well with alignment by default.\r\n\r\n* match with **first unmatched compatible** axis (ie by compatible and relative position)\r\n  **problem**: can prevent a named axis from matching with a corresponding named axis, if the first axis in other is compatible with. \r\n\r\n* first match all named axes (and align them) then match remaining axes with first unmatched compatible axis (ie by compatible and relative position)\r\n\r\n  problem: we can still get some annoying results. eg, suppose that after matching named axes, we are left with the following anonymous (but non- wildcard except for 1) axes: \r\n  arr1: 4 5 2\r\n  arr2: 1* 4 5\r\n  arr2.1* would be matched with arr1.4 and then arr2.4 will fail to be matched with anything even though it got an exact copy of itself in arr1.\r\n\r\n* first match all named axes (and align them) then match remaining non wildcard axes (or only exclude wildcard of length 1?) with first unmatched compatible axis (ie by compatible and relative position) then match wildcard (or only length 1 wildcards?) axes to anything left.  I need to throw a few use cases at this algorithm and see how it behaves. \r\n   problem: this is getting complex to explain (I think the implementation would not be too bad).","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2017-10-06T11:47:56Z","url":"https://github.com/larray-project/larray/issues/464"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ba77a256-0984-2d36-8351-d045c55af3ab
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id90FC:609A0:3057F8C:3F8051C:6B001F44
html-safe-nonce8f0ba32df8c8c2119045b6fd1d0d3b95a80f1838b1197037d721f4dd8a894036
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEZDOjYwOUEwOjMwNTdGOEM6M0Y4MDUxQzo2QjAwMUY0NCIsInZpc2l0b3JfaWQiOiI1OTM2MjE4NDE5MjI0Mzg3Mzk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac36e74b1d180addf08473a8dc961774528f77509c1337168eecde39f6dba66a3d
hovercard-subject-tagissue:263419880
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/larray-project/larray/464/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1a747f80142739a016299a1b2ec7bb2e35bd31853fce324320b5b1fe548aa275/larray-project/larray/issues/464
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1a747f80142739a016299a1b2ec7bb2e35bd31853fce324320b5b1fe548aa275/larray-project/larray/issues/464
og:image:altAfter much thoughts, I have progressed only a little. For context, the central point in all this is the behaviour of AxisCollection.union, which is used in stack, binary ops (via make_numpy_broadca...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegdementen
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-preview
go-importgithub.com/larray-project/larray git https://github.com/larray-project/larray.git
octolytics-dimension-user_id26460981
octolytics-dimension-user_loginlarray-project
octolytics-dimension-repository_id16981067
octolytics-dimension-repository_nwolarray-project/larray
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id16981067
octolytics-dimension-repository_network_root_nwolarray-project/larray
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/larray-project/larray/issues/464#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flarray-project%2Flarray%2Fissues%2F464
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flarray-project%2Flarray%2Fissues%2F464
Sign uphttps://github.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=larray-project%2Flarray
Reloadhttps://github.com/larray-project/larray/issues/464
Reloadhttps://github.com/larray-project/larray/issues/464
Reloadhttps://github.com/larray-project/larray/issues/464
larray-projecthttps://github.com/larray-project
larrayhttps://github.com/larray-project/larray
Codehttps://github.com/larray-project/larray
Issues279 (279)https://github.com/larray-project/larray/issues
Pull requests6 (6)https://github.com/larray-project/larray/pulls
Actionshttps://github.com/larray-project/larray/actions
Security and qualityhttps://github.com/larray-project/larray/security
Insightshttps://github.com/larray-project/larray/insights
https://github.com/larray-project/larray
New issuehttps://github.com/login?return_to=https://github.com/larray-project/larray/issues/464
New issuehttps://github.com/login?return_to=https://github.com/larray-project/larray/issues/464
Formalize axis matching ruleshttps://github.com/larray-project/larray/issues/464#top
https://github.com/gdementen
difficulty: highhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22difficulty%3A%20high%22
enhancementhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22enhancement%22
priority: highhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22priority%3A%20high%22
size: bighttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22size%3A%20big%22
work in progresshttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22work%20in%20progress%22
https://github.com/gdementen
gdementenhttps://github.com/gdementen
on Oct 6, 2017https://github.com/larray-project/larray/issues/464#issue-263419880
gdementenhttps://github.com/gdementen
enhancementhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22enhancement%22
priority: highhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22priority%3A%20high%22
work in progresshttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22work%20in%20progress%22
on Oct 6, 2017https://github.com/larray-project/larray/issues/464#event-1281622118
gdementenhttps://github.com/gdementen
on Oct 6, 2017https://github.com/larray-project/larray/issues/464#event-1281622124
https://github.com/gdementen
gdementenhttps://github.com/gdementen
on Oct 8, 2017https://github.com/larray-project/larray/issues/464#issuecomment-335003284
gdementenhttps://github.com/gdementen
difficulty: highhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22difficulty%3A%20high%22
on Oct 20, 2017https://github.com/larray-project/larray/issues/464#event-1302901478
alixdammanhttps://github.com/alixdamman
nice_to_havehttps://github.com/larray-project/larray/milestone/20
on Mar 7, 2018https://github.com/larray-project/larray/issues/464#event-1508453239
alixdammanhttps://github.com/alixdamman
on Apr 26, 2019https://github.com/larray-project/larray/issues/464#event-2302235124
alixdammanhttps://github.com/alixdamman
on Aug 1, 2019https://github.com/larray-project/larray/issues/464#event-2525891976
gdementenhttps://github.com/gdementen
size: bighttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22size%3A%20big%22
on Aug 1, 2019https://github.com/larray-project/larray/issues/464#event-2526305151
alixdammanhttps://github.com/alixdamman
0.32https://github.com/larray-project/larray/milestone/19
on Aug 13, 2019https://github.com/larray-project/larray/issues/464#event-2553591411
gdementenhttps://github.com/gdementen
0.32https://github.com/larray-project/larray/milestone/19
on Sep 24, 2019https://github.com/larray-project/larray/issues/464#event-2657250931
alixdammanhttps://github.com/alixdamman
nice_to_havehttps://github.com/larray-project/larray/milestone/20
on Oct 10, 2019https://github.com/larray-project/larray/issues/464#event-2701969939
gdementenhttps://github.com/gdementen
nice_to_havehttps://github.com/larray-project/larray/milestone/20
on Sep 26, 2022https://github.com/larray-project/larray/issues/464#event-7457460809
Sign up for freehttps://github.com/signup?return_to=https://github.com/larray-project/larray/issues/464
Sign in to commenthttps://github.com/login?return_to=https://github.com/larray-project/larray/issues/464
gdementenhttps://github.com/gdementen
difficulty: highhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22difficulty%3A%20high%22
enhancementhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22enhancement%22
priority: highhttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22priority%3A%20high%22
size: bighttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22size%3A%20big%22
work in progresshttps://github.com/larray-project/larray/issues?q=state%3Aopen%20label%3A%22work%20in%20progress%22
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.