Title: tuple unpacking in permutationTesting.py no longer compatible w/python3. Potential solution included. · Issue #2 · ColeLab/MultipleComparisonsPermutationTesting · GitHub
Open Graph Title: tuple unpacking in permutationTesting.py no longer compatible w/python3. Potential solution included. · Issue #2 · ColeLab/MultipleComparisonsPermutationTesting
X Title: tuple unpacking in permutationTesting.py no longer compatible w/python3. Potential solution included. · Issue #2 · ColeLab/MultipleComparisonsPermutationTesting
Description: Hello, I noticed the arguments for _maxTpermutation() from permutationTesting.py includes the tuple [diff_arr, nullmean, tail, seed] as our input. Tuple unpacking is no longer compatible with python3, but the code still works in python2....
Open Graph Description: Hello, I noticed the arguments for _maxTpermutation() from permutationTesting.py includes the tuple [diff_arr, nullmean, tail, seed] as our input. Tuple unpacking is no longer compatible with pytho...
X Description: Hello, I noticed the arguments for _maxTpermutation() from permutationTesting.py includes the tuple [diff_arr, nullmean, tail, seed] as our input. Tuple unpacking is no longer compatible with pytho...
Opengraph URL: https://github.com/ColeLab/MultipleComparisonsPermutationTesting/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tuple unpacking in permutationTesting.py no longer compatible w/python3. Potential solution included.","articleBody":"Hello,\r\nI noticed the arguments for `_maxTpermutation()` from [permutationTesting.py](https://github.com/ColeLab/MultipleComparisonsPermutationTesting/blob/master/pythonCode/permutationTesting.py) includes the tuple` [diff_arr, nullmean, tail, seed]` as our input. \r\n\r\nTuple unpacking is no longer compatible with python3, but the code still works in python2. I developed, however, a workaround for this fantastic script to run in python3:\r\n\r\n**Old code:**\r\n```\r\ndef _maxTpermutation((diff_arr,nullmean,tail,seed)):\r\n \"\"\"\r\n Helper function to perform a single permutation\r\n \"\"\"\r\n\r\n np.random.seed(seed)\r\n```\r\n\r\n**New code:**\r\n```\r\ndef _maxTpermutation(t_tuple: tuple): -\u003e int:\r\n \"\"\"\r\n Helper function to perform a single permutation\r\n \"\"\" \r\n\r\n diff_arr = t_tuple[0]\r\n nullmean = t_tuple[1]\r\n tail = t_tuple[2]\r\n seed = t_tuple[3]\r\n \r\n np.random.seed(seed)\r\n```\r\nI understand one solution could be to pass individual arguments, but our inputs is of variable length and incorporating type annotations allows your list of inputs to successfully pass through `map_async()`. Therefore, this solution should remain faithful to the logic of the original script. \r\n\r\nI was able to successfully run [pythonMaxT_Test.py](https://github.com/ColeLab/MultipleComparisonsPermutationTesting/blob/master/testCode/pythonMaxT_Test.py) with the new code. Hope this helps! I can submit a pull request for [permutationTesting.py](https://github.com/ColeLab/MultipleComparisonsPermutationTesting/blob/master/pythonCode/permutationTesting.py) too, if you like.","author":{"url":"https://github.com/lindsayshaffer","@type":"Person","name":"lindsayshaffer"},"datePublished":"2022-12-29T17:56:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2/MultipleComparisonsPermutationTesting/issues/2"}
| 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:1ebaea28-ff94-9fdf-3db1-4976b1d4cc75 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EFC:272222:BBF369:F1AAA7:69905FA5 |
| html-safe-nonce | 3376c7ec2c8fd3f2960c8d1c2970cf66cebcb9fa6e9ce5267bae3b4622a94408 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUZDOjI3MjIyMjpCQkYzNjk6RjFBQUE3OjY5OTA1RkE1IiwidmlzaXRvcl9pZCI6Ijg5MTE5NjUwNjU0NjIxNzc3MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b2a980abed3b9c8bc1fe4585b1a8fe104425ecc2398cd4f2bfd7d91694f475d4 |
| hovercard-subject-tag | issue:1513939511 |
| 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/ColeLab/MultipleComparisonsPermutationTesting/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2daf1b1bca1d5bf3b7ef10fb3725cc428c73c2fa5c57f626a33a047487590f91/ColeLab/MultipleComparisonsPermutationTesting/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2daf1b1bca1d5bf3b7ef10fb3725cc428c73c2fa5c57f626a33a047487590f91/ColeLab/MultipleComparisonsPermutationTesting/issues/2 |
| og:image:alt | Hello, I noticed the arguments for _maxTpermutation() from permutationTesting.py includes the tuple [diff_arr, nullmean, tail, seed] as our input. Tuple unpacking is no longer compatible with pytho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lindsayshaffer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/ColeLab/MultipleComparisonsPermutationTesting git https://github.com/ColeLab/MultipleComparisonsPermutationTesting.git |
| octolytics-dimension-user_id | 6795537 |
| octolytics-dimension-user_login | ColeLab |
| octolytics-dimension-repository_id | 94452961 |
| octolytics-dimension-repository_nwo | ColeLab/MultipleComparisonsPermutationTesting |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 94452961 |
| octolytics-dimension-repository_network_root_nwo | ColeLab/MultipleComparisonsPermutationTesting |
| 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 | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width