Title: check that key is valid on axis[key] · Issue #596 · larray-project/larray · GitHub
Open Graph Title: check that key is valid on axis[key] · Issue #596 · larray-project/larray
X Title: check that key is valid on axis[key] · Issue #596 · larray-project/larray
Description: Currently, keys are only checked when used in an array, so when creating a group, it happily accepts keys which do not exist. >>> arr = ndtest((2, 3)) >>> # this should fail ... g = arr.a['yada'] >>> g a['yada'] >>> arr[g] ValueError: a[...
Open Graph Description: Currently, keys are only checked when used in an array, so when creating a group, it happily accepts keys which do not exist. >>> arr = ndtest((2, 3)) >>> # this should fail ... g = arr.a['yada'] >...
X Description: Currently, keys are only checked when used in an array, so when creating a group, it happily accepts keys which do not exist. >>> arr = ndtest((2, 3)) >>> # this should fail ... g...
Opengraph URL: https://github.com/larray-project/larray/issues/596
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"check that key is valid on axis[key]","articleBody":"Currently, keys are only checked when used in an array, so when creating a group, it happily accepts keys which do not exist. \r\n\r\n```python\r\n>>> arr = ndtest((2, 3))\r\n>>> # this should fail\r\n... g = arr.a['yada']\r\n>>> g\r\na['yada']\r\n>>> arr[g]\r\nValueError: a['yada'] is not a valid label for any axis\r\n```\r\nFWIW, it was done this way initially for two reasons: \r\n1) performance (to avoid translating the key if it is not used), but in the end, it is better to be correct than fast and, in the usual case where the resulting group is actually used, it would be even faster this way (assuming we translate it directly to positional).\r\n2) to be correct in case the axis labels are modified in-place. But I now think we should either forbid this anyway, or allow this with a big fat warning that you might be shooting yourself in the foot.\r\n\r\n\r\nrelated to #200. Please see the comments there.","author":{"url":"https://github.com/gdementen","@type":"Person","name":"gdementen"},"datePublished":"2018-03-01T09:57:26Z","url":"https://github.com/larray-project/larray/issues/596"}
| 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:1323ac34-2aaf-5455-6341-4f572d760811 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5CE:2C0A92:2E22D3C:3CBE1B7:6B001EC6 |
| html-safe-nonce | 26935ca51ca581f9229fd8fb57d33534659447df40f055e860c420816d534134 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUNFOjJDMEE5MjoyRTIyRDNDOjNDQkUxQjc6NkIwMDFFQzYiLCJ2aXNpdG9yX2lkIjoiMjYyMTIyMzgyMTA1ODc3Njc3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a3a7822bc639627958174f6f91b4b604fcb55278af8485125c5eb600c46f8fcd |
| hovercard-subject-tag | issue:301342146 |
| 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/596/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d83899f194d5e8a2fbd6ebf0a3f02f28f453e128878fe4550bfd90e6f83c94c5/larray-project/larray/issues/596 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d83899f194d5e8a2fbd6ebf0a3f02f28f453e128878fe4550bfd90e6f83c94c5/larray-project/larray/issues/596 |
| og:image:alt | Currently, keys are only checked when used in an array, so when creating a group, it happily accepts keys which do not exist. >>> arr = ndtest((2, 3)) >>> # this should fail ... g = arr.a['yada'] >... |
| 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