Title: make (partial) disaggregation easier · Issue #199 · larray-project/larray · GitHub
Open Graph Title: make (partial) disaggregation easier · Issue #199 · larray-project/larray
X Title: make (partial) disaggregation easier · Issue #199 · larray-project/larray
Description: We need to find some way to make this easier (and fix all the bugs I just came across) -- I will open separate issues for each bug, but the main feature request will remain: >>> arr = ndtest(10) >>> a = arr.a >>> agg = arr.sum(a.by(2)).r...
Open Graph Description: We need to find some way to make this easier (and fix all the bugs I just came across) -- I will open separate issues for each bug, but the main feature request will remain: >>> arr = ndtest(10) >>...
X Description: We need to find some way to make this easier (and fix all the bugs I just came across) -- I will open separate issues for each bug, but the main feature request will remain: >>> arr = ndte...
Opengraph URL: https://github.com/larray-project/larray/issues/199
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"make (partial) disaggregation easier","articleBody":"We need to find some way to make this easier (and fix all the bugs I just came across) -- I will open separate issues for each bug, but the main feature request will remain:\r\n```python\r\n>>> arr = ndtest(10)\r\n>>> a = arr.a\r\n>>> agg = arr.sum(a.by(2)).rename('a', 'group')\r\n>>> agg\r\ngroup | a0:a1 | a2:a3 | a4:a5 | a6:a7 | a8:a9\r\n | 1 | 5 | 9 | 13 | 17\r\n>>> group = agg.group\r\n>>> expand = zeros(group, a)\r\n>>> expand\r\ngroup | a0:a1 | a2:a3 | a4:a5 | a6:a7 | a8:a9\r\n | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n>>> expand = zeros((group, a))\r\n>>> expand\r\ngroup\\a | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n a0:a1 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a2:a3 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a4:a5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a6:a7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a8:a9 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n>>> expand['a0:a1', 'a0':'a1'] = 0.5\r\nValueError Traceback (most recent call last)\r\n...\r\nValueError: a0:a1 is ambiguous (valid in group, a)\r\n>>> expand[group['a0:a1'], 'a0':'a1'] = 0.5\r\nValueError Traceback (most recent call last)\r\n...\r\nValueError: group['a0':'a1'] is not a valid label for any axis\r\n>>> expand[x.group['a0:a1'], 'a0':'a1'] = 0.5\r\n>>> expand\r\ngroup\\a | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n a0:a1 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a2:a3 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a4:a5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a6:a7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a8:a9 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n>>> for g in group:\r\n... print(g.split(':'))\r\nAttributeError Traceback (most recent call last)\r\n...\r\nAttributeError: 'PGroup' object has no attribute 'split'\r\n>>> for g in group:\r\n... print(g.eval().split(':'))\r\n['a0', 'a1']\r\n['a2', 'a3']\r\n['a4', 'a5']\r\n['a6', 'a7']\r\n['a8', 'a9']\r\n>>> for g in group:\r\n... expand[g, slice(*g.eval().split(':'))] = 1 / len(g)\r\n>>> expand\r\ngroup\\a | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n a0:a1 | 0.2 | 0.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a2:a3 | 0.0 | 0.0 | 0.2 | 0.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a4:a5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.2 | 0.2 | 0.0 | 0.0 | 0.0 | 0.0\r\n a6:a7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.2 | 0.2 | 0.0 | 0.0\r\n a8:a9 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.2 | 0.2\r\n>>> len(group.i[0])\r\n5\r\n>>> for g in group:\r\n... expand[g, slice(*g.eval().split(':'))] = 0.5\r\n>>> expand\r\ngroup\\a | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n a0:a1 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a2:a3 | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a4:a5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0\r\n a6:a7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 0.0\r\n a8:a9 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.5 | 0.5\r\n>>> agg\r\ngroup | a0:a1 | a2:a3 | a4:a5 | a6:a7 | a8:a9\r\n | 1 | 5 | 9 | 13 | 17\r\n>>> agg * expand\r\ngroup\\a | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n a0:a1 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a2:a3 | 0.0 | 0.0 | 2.5 | 2.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0\r\n a4:a5 | 0.0 | 0.0 | 0.0 | 0.0 | 4.5 | 4.5 | 0.0 | 0.0 | 0.0 | 0.0\r\n a6:a7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 6.5 | 6.5 | 0.0 | 0.0\r\n a8:a9 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 8.5 | 8.5\r\n>>> (agg * expand).sum(group)\r\na | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n | 0.5 | 0.5 | 2.5 | 2.5 | 4.5 | 4.5 | 6.5 | 6.5 | 8.5 | 8.5\r\n>>> arr\r\na | a0 | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9\r\n | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9\r\n```","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2017-04-04T08:50:58Z","url":"https://github.com/larray-project/larray/issues/199"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ebba45bb-9722-f02c-99e8-84d0a280a16e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF0A:1833B7:20D210B:2C6D348:6B001E38 |
| html-safe-nonce | 2e842978eecfbead3df6f78babb45bcc21b70a781531bed3173a4526c897f904 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjBBOjE4MzNCNzoyMEQyMTBCOjJDNkQzNDg6NkIwMDFFMzgiLCJ2aXNpdG9yX2lkIjoiNzc5MjA5NjE1MTcyMDY5NzQwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f16033f82fe5ce720fb04e9ec3791f103c787042d8b0782394b0f29590fa9757 |
| hovercard-subject-tag | issue:219180715 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/larray-project/larray/199/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5c70ba15a03051ac73768df3318e6ea14ed9fb629ba836f899c17b527f97e542/larray-project/larray/issues/199 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5c70ba15a03051ac73768df3318e6ea14ed9fb629ba836f899c17b527f97e542/larray-project/larray/issues/199 |
| og:image:alt | We need to find some way to make this easier (and fix all the bugs I just came across) -- I will open separate issues for each bug, but the main feature request will remain: >>> arr = ndtest(10) >>... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gdementen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/larray-project/larray git https://github.com/larray-project/larray.git |
| octolytics-dimension-user_id | 26460981 |
| octolytics-dimension-user_login | larray-project |
| octolytics-dimension-repository_id | 16981067 |
| octolytics-dimension-repository_nwo | larray-project/larray |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16981067 |
| octolytics-dimension-repository_network_root_nwo | larray-project/larray |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width