py2ls 0.2.4.24__tar.gz → 0.2.4.26__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/PKG-INFO +5 -1
  2. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.DS_Store +0 -0
  3. py2ls-0.2.4.26/py2ls/.git/index +0 -0
  4. py2ls-0.2.4.26/py2ls/correlators.py +475 -0
  5. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/.DS_Store +0 -0
  6. py2ls-0.2.4.26/py2ls/data/hyper_param_autogluon_zeroshot2024.json +2383 -0
  7. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/.DS_Store +0 -0
  8. py2ls-0.2.4.26/py2ls/data/styles/stylelib/.DS_Store +0 -0
  9. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/usages_sns.json +6 -1
  10. py2ls-0.2.4.26/py2ls/ec2ls.py +61 -0
  11. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/ips.py +496 -138
  12. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/ml2ls.py +994 -288
  13. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/netfinder.py +16 -20
  14. py2ls-0.2.4.26/py2ls/nl2ls.py +283 -0
  15. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/plot.py +1244 -158
  16. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/pyproject.toml +5 -1
  17. py2ls-0.2.4.24/py2ls/.git/index +0 -0
  18. py2ls-0.2.4.24/py2ls/data/usages_pd copy.json +0 -1105
  19. py2ls-0.2.4.24/py2ls/ml2ls copy.py +0 -2906
  20. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/README.md +0 -0
  21. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/.DS_Store +0 -0
  22. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/COMMIT_EDITMSG +0 -0
  23. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/FETCH_HEAD +0 -0
  24. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/HEAD +0 -0
  25. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/config +0 -0
  26. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/description +0 -0
  27. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/applypatch-msg.sample +0 -0
  28. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/commit-msg.sample +0 -0
  29. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/fsmonitor-watchman.sample +0 -0
  30. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/post-update.sample +0 -0
  31. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/pre-applypatch.sample +0 -0
  32. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/pre-commit.sample +0 -0
  33. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/pre-merge-commit.sample +0 -0
  34. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/pre-push.sample +0 -0
  35. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/pre-rebase.sample +0 -0
  36. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/pre-receive.sample +0 -0
  37. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/prepare-commit-msg.sample +0 -0
  38. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/push-to-checkout.sample +0 -0
  39. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/hooks/update.sample +0 -0
  40. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/info/exclude +0 -0
  41. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/logs/HEAD +0 -0
  42. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/logs/refs/heads/main +0 -0
  43. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/logs/refs/remotes/origin/HEAD +0 -0
  44. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/logs/refs/remotes/origin/main +0 -0
  45. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/.DS_Store +0 -0
  46. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/01/d5bd8065e6860c0bd23ff9fa57161806a099e1 +0 -0
  47. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/09/08da26de58c114225ad81f484b80bf5d351b34 +0 -0
  48. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/0b/409e1bc918277010f5679b402d1d1dda53e15c +0 -0
  49. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/12/c2808a1b3a4d0892a4154dfba1e2ae3770fa73 +0 -0
  50. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/14/449a0e6ba4ea2f1a73acf63ef91c9c6193f9ed +0 -0
  51. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/15/a8e468aacfcb440e090020f36d0b985d45da23 +0 -0
  52. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/1a/b4585881a6a42889f01aa0cfe25fd5acfaf46f +0 -0
  53. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/1c/3f92adda34344bcbbbf9d409c79855ae2aaea8 +0 -0
  54. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/1c/9314c5f69b9390068a2a8616875d974849d71f +0 -0
  55. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/1d/fe9d9633b24ea560354f4f93d39c6e5f163ea0 +0 -0
  56. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/20/72c28e83f4347959d29f7b3a6c1fc3e4ee6b59 +0 -0
  57. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/24/6b368b986f758630c46dc02b7fa512b53422f7 +0 -0
  58. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/25/b796accd261b9135fd32a2c00785f68edf6c46 +0 -0
  59. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/27/aa6074f652bc6f7078f8647489d9ee8e24f0e2 +0 -0
  60. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/28/c2969d785c1b892c2a96b3f00eba63a59811b3 +0 -0
  61. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/2a/ae95d517d213b660bf4f65a4e0cfae7bb893eb +0 -0
  62. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/2a/fdf45791a26d42ccead35ace76a8f0b2a56561 +0 -0
  63. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/30/a2f8da47ee947811dc8d993f5a06a45de374f4 +0 -0
  64. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/32/fd627b62fad7cf3b2f9e34ab9777126a0987ad +0 -0
  65. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/34/9e31b6a3634cea102ce5588b98c11cc1738605 +0 -0
  66. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/34/b6f3a2ee84f39bed4eee57f2c0e0afb994feb1 +0 -0
  67. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/35/1a5f491ab97eee9d1ee699478d75a8bb5d3dc2 +0 -0
  68. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/36/b4a1b7403abc6c360f8fe2cb656ab945254971 +0 -0
  69. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/36/e56a361f526eafa59c5235a5c990bf288b5f9c +0 -0
  70. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/36/ef43e50009e59db11812c258846d9e38718173 +0 -0
  71. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/39/7ead045fbbcfb17c62019eb18fe21ed05dbee5 +0 -0
  72. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/39/b13be65125556784e44c7a1d9821703c7ab67e +0 -0
  73. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/3b/507acc7f23391644cc0b824b1e79fd2677a362 +0 -0
  74. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/3b/bd972aa7ad680858f8dfbd0f7fcd97756f0d6f +0 -0
  75. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/3c/bbe5f4173d165127b9ad96119f1ec24c306ffc +0 -0
  76. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/3d/9d10d27724657a436c65a6254bfd213d4b3562 +0 -0
  77. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/3f/d6561300938afbb3d11976cf9c8f29549280d9 +0 -0
  78. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/41/dcf4b3bf0460946b2da93776cf9e836d62178f +0 -0
  79. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/43/dbd49b2ee367c5434dd545e3b5795434f2ef0b +0 -0
  80. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/45/b1b6178bacbfc997811a998b5cc60c1ea7fac8 +0 -0
  81. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/47/6cbd5a7c5e35cddef2f8a38bdc4896d403b095 +0 -0
  82. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/48/a88fc5806305d0bb0755ee6801161b79696972 +0 -0
  83. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/4f/7afb40dff2153d857fc85748c2eecb85125042 +0 -0
  84. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/50/08ddfcf53c02e82d7eee2e57c38e5672ef89f6 +0 -0
  85. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/53/e0deb1cb4c2c606bced6e7f9a66b0fda60980d +0 -0
  86. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/56/e4e8b2d5545e0256090f45aa8fc42c5fe067d0 +0 -0
  87. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/57/63d0c52f5c9c69e89d514a1f96034947abe21a +0 -0
  88. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/57/bd1c0199483ab316235b094543b85edec6c35e +0 -0
  89. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/58/20a729045d4dc7e37ccaf8aa8eec126850afe2 +0 -0
  90. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/59/380c4c26bdcd4d9b71ae3e2e35f05b3f26c5ab +0 -0
  91. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/5a/192565abf89c9d765af846ce6d53a92b1ce7ad +0 -0
  92. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/60/f273eb1c412d916fa3f11318a7da7a9911b52a +0 -0
  93. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/61/570cec8c061abe74121f27f5face6c69b98f99 +0 -0
  94. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/62/4488173ed2c8936fa5cea3cf5dd3f26a30b86e +0 -0
  95. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/62/7c81b23b4e56e87b042b650b0103653cc9e34a +0 -0
  96. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/62/d90ccf8cbefdc2e4fd475e7c6f4f76e9fdf801 +0 -0
  97. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/63/100154b27846e8010e55b6bf4b3d7762c14c5f +0 -0
  98. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/64/27a4edff08f93d98f511418423f09f2ab90bcd +0 -0
  99. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/66/6227eeeba24073e63811e89f1449f3d958f183 +0 -0
  100. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/66/c998778721d424bd0aae80602dabbffa93af2e +0 -0
  101. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/68/6df3072c8b025fb18106ed2df505994ad062a9 +0 -0
  102. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/69/13c452ca319f7cbf6a0836dc10a5bb033c84e4 +0 -0
  103. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/6a/52e747a2b349b128d1490d9e896d2323818eb7 +0 -0
  104. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/6b/7fde264d93a7a0986d394c46c7650d0ce2ab92 +0 -0
  105. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/6c/cebb29b7f3f5b0c889f6dadbf9ff066554587d +0 -0
  106. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/6d/c2cdf4a84e538e5d4777486aeff87e42f41799 +0 -0
  107. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/6d/ee29dbdcc84edeeacede105110446f3ccac963 +0 -0
  108. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/71/36b2074a2754be8b58127d82250e5b37e3c373 +0 -0
  109. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/72/245a05b0966011cb381e6b32b0465000e969ab +0 -0
  110. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/72/e4179337639859678ddaecf38b16f33aaec8e1 +0 -0
  111. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/78/063f4c863fc371ec0313303c0a81283b35d9b6 +0 -0
  112. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/78/3d4167bc95c9d2175e0df03ef1c1c880ba75ab +0 -0
  113. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/79/7ae089b2212a937840e215276005ce76881307 +0 -0
  114. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/7e/5956c806b5edc344d46dab599dec337891ba1f +0 -0
  115. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/81/8f26b7bf042269729020cf944fc362d66ba27e +0 -0
  116. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/82/70b319ce4046854fbe7dc41054b6c2d112dab2 +0 -0
  117. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/84/59071b722a255b774a80b27746033f8141ab39 +0 -0
  118. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/85/aee46f478e9afdb84d50a05242c53b04ed2e21 +0 -0
  119. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/86/e288b46f8fe179907e4413f665aeb5053fddb1 +0 -0
  120. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/87/ef1fc3f7f1ddc4d0ab9b3e65381ce9f3388621 +0 -0
  121. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/8b/84f56978e1de8f2ae82abce5f8b3e182d365cd +0 -0
  122. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/8e/55a7d2b96184030211f20c9b9af201eefcac82 +0 -0
  123. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/91/c69ad88fe0ba94aa7859fb5f7edac5e6f1a3f7 +0 -0
  124. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/94/74152b4b463d70ae5ad07f0c658be3e296026b +0 -0
  125. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/94/f7dbe88e80c4205a901b71eb8f181974376bba +0 -0
  126. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/97/1aef09ea939f46b60b9646f8d524c78a9220f4 +0 -0
  127. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/9b/ec5ee2236ee2d5532c36bfd132e23c58fdb69c +0 -0
  128. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/9d/0df52899fe95279059286d9c0ec42287edc168 +0 -0
  129. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/a1/5389729850729fc7bd78a54f26fce77f30be12 +0 -0
  130. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/a1/906da89d1174f74867800c74c43af36253bd5e +0 -0
  131. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/a4/63fdd23e5efd713db8a71f316f3a1c7bd60916 +0 -0
  132. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/a5/ec8f74642fbba27f7ea78c53b372ae0c7dedce +0 -0
  133. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/a7/3e13eafee65c5b8d73ad2d3ea46d0eee82f0d3 +0 -0
  134. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b0/56be4be89ba6b76949dd641df45bb7036050c8 +0 -0
  135. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b0/9cd7856d58590578ee1a4f3ad45d1310a97f87 +0 -0
  136. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b2/18e6a0f0f1c4df8cdefa9852058348abc713b7 +0 -0
  137. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b3/4f7f271c6d6105e35a6556ffda71d03afe8c96 +0 -0
  138. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b3/69579064bde9de9a19d114fc33e4e48cc8c0e4 +0 -0
  139. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b5/61831c7dce8ea51e7ee6b6fa35745f14d8242d +0 -0
  140. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/b7/2c9e75ab7d0afe594664650aa8f6c772f5ac64 +0 -0
  141. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/bb/81ccc0513f18fc160b54a82861e9a80d23f4f6 +0 -0
  142. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/bb/934eb33bc1a8b85630bf680caffd99560c1b8f +0 -0
  143. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/bf/67907e337021ebff434e02b19b30a741c144af +0 -0
  144. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/bf/b54d65922ce1dfda1aaa014913a54e7172d0bc +0 -0
  145. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/c1/20fc812b9ad311c34a3608512d6a9d976bb48e +0 -0
  146. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/c1/397c6ed72c4e20ef6b9ab83163e9a6baba5b45 +0 -0
  147. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/c4/cba65f1163661999ee4b8ed23342b63bc1300c +0 -0
  148. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/c6/7f17e5707313600efcb85e9a3fedea35dba591 +0 -0
  149. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/c6/f32aced880bd165a251cb52b26b0c1107e2141 +0 -0
  150. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/cc/45df1d317a2eb63ff1ff3a5f3b4a9f98fd92b5 +0 -0
  151. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/cd/822b3574a88ebdd1ed82fd6983f37e626d52b4 +0 -0
  152. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/cf/0c0d9c6fb09473aaeb7f7e2edbd770c3f2ef3d +0 -0
  153. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d2/992df305f4b56a466a2f221aeb182ddd20f418 +0 -0
  154. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d6/39e8af592cd75a318d8affddd1bcc70c2095f2 +0 -0
  155. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d6/9ab1c4aadf279936dd778e8346ba60f74705b6 +0 -0
  156. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d8/4688b54c0040a30976b3a6540bc47adf7ce680 +0 -0
  157. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d9/005f2cc7fc4e65f14ed5518276007c08cf2fd0 +0 -0
  158. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d9/c2403fd166ce791b4e9d0c6792ed8342c71fcd +0 -0
  159. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/d9/dfa5aee51e92a541b707e8e7baea6f06deff98 +0 -0
  160. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/db/141dbaa93594df2a8156182f361ee4db829359 +0 -0
  161. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/db/3f2cd643292057936230b95cf7ec3046affe11 +0 -0
  162. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/db/ffa8ea7bda721d0cee7b9e4ce5b2ef927733ff +0 -0
  163. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/dc/c2bdbafb3296e09d9ee4955cfa55d275825f94 +0 -0
  164. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/dc/cdbd4266765d840be2ae35ab1752a0fa312c16 +0 -0
  165. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/dd/87fb5f606fe380d81e6fe3a2c98f9f99e3e09b +0 -0
  166. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/de/214c626ac2dd2685bfaa0bc0fc20f528d014d7 +0 -0
  167. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/df/e0770424b2a19faf507a501ebfc23be8f54e7b +0 -0
  168. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/e2/f2f8f4c25e62a297fc55f36acc6b01cfbab76f +0 -0
  169. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/e3/1356f90ea6dd0577b5e0b40b206319adcbf085 +0 -0
  170. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/e3/5a4dafc50850cacac7bf76c56db2715cbda2c4 +0 -0
  171. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/e4/6c715352db9fe3c887a635f1916df4ca1f4ff9 +0 -0
  172. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/e5/0580a0bd1e1b3d29f834382b80fceb61d5cf0c +0 -0
  173. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/e9/391ffe371f1cc43b42ef09b705d9c767c2e14f +0 -0
  174. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/ea/3a18cc75e53792744ef754e05d3f4481768c13 +0 -0
  175. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/ec/40fd8bf8e4c342534a9fc020289e402ba6bc9d +0 -0
  176. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/ec/d980279432b13f0374b90ca439a6329cdece0f +0 -0
  177. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/ee/cee64eacaff022dcdc509c0c2b1da492f21060 +0 -0
  178. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f1/e50757fddc28b445545dc7e2759b54cdd0f42e +0 -0
  179. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f4/b64d3107b39e3ad6f540c6607004ea34e6c024 +0 -0
  180. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f4/ba7f815b886797b73fede071d86e0c134d2bc7 +0 -0
  181. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f5/61c3c1bf1c9ea9c9d1f556a7be2869f71f3bdf +0 -0
  182. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f6/44a8ff56fa035105fc517cbb1ac46c3d8e349a +0 -0
  183. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f7/c98ba5c2f903e603b1f5e63d49fbc8a43815cc +0 -0
  184. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/f9/045a08e96eb76848fc4d68e3e3e687cca39a2d +0 -0
  185. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/fa/147e6bb78a2e8db241d231295fd7f1ed061af8 +0 -0
  186. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/objects/fc/292e793ecfd42240ac43be407023bd731fa9e7 +0 -0
  187. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/refs/.DS_Store +0 -0
  188. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/refs/heads/main +0 -0
  189. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/refs/remotes/origin/HEAD +0 -0
  190. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.git/refs/remotes/origin/main +0 -0
  191. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.gitattributes +0 -0
  192. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/.gitignore +0 -0
  193. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/LICENSE +0 -0
  194. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/README.md +0 -0
  195. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/__init__.py +0 -0
  196. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/batman.py +0 -0
  197. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/bio.py +0 -0
  198. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/brain_atlas.py +0 -0
  199. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/chat.py +0 -0
  200. /py2ls-0.2.4.24/py2ls/correlators.py → /py2ls-0.2.4.26/py2ls/corr.py +0 -0
  201. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/db2ls_sql_chtsht.json +0 -0
  202. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/docs_links.json +0 -0
  203. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/email/email_html_template.html +0 -0
  204. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/lang_code_iso639.json +0 -0
  205. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/mygenes_fields_241022.txt +0 -0
  206. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/sns_info.json +0 -0
  207. {py2ls-0.2.4.24/py2ls/data/styles/stylelib → py2ls-0.2.4.26/py2ls/data/styles/example}/.DS_Store +0 -0
  208. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style1.pdf +0 -0
  209. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style2.pdf +0 -0
  210. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style3.pdf +0 -0
  211. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style4.pdf +0 -0
  212. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style5.pdf +0 -0
  213. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style6.pdf +0 -0
  214. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style7.pdf +0 -0
  215. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style8.pdf +0 -0
  216. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/example/style9.pdf +0 -0
  217. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style1.json +0 -0
  218. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style10.json +0 -0
  219. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style11.json +0 -0
  220. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style12.json +0 -0
  221. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style2.json +0 -0
  222. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style3.json +0 -0
  223. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style4.json +0 -0
  224. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style5.json +0 -0
  225. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style6.json +0 -0
  226. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style7.json +0 -0
  227. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style8.json +0 -0
  228. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/style9.json +0 -0
  229. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/grid.mplstyle +0 -0
  230. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/high-contrast.mplstyle +0 -0
  231. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/high-vis.mplstyle +0 -0
  232. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/ieee.mplstyle +0 -0
  233. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/light.mplstyl +0 -0
  234. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/muted.mplstyle +0 -0
  235. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/nature-reviews-latex.mplstyle +0 -0
  236. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/nature-reviews.mplstyle +0 -0
  237. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/nature.mplstyle +0 -0
  238. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/no-latex.mplstyle +0 -0
  239. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/notebook.mplstyle +0 -0
  240. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/paper.mplstyle +0 -0
  241. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/retro.mplstyle +0 -0
  242. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/sans.mplstyle +0 -0
  243. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/scatter.mplstyle +0 -0
  244. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/science.mplstyle +0 -0
  245. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/std-colors.mplstyle +0 -0
  246. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/styles/stylelib/vibrant.mplstyle +0 -0
  247. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/data/usages_pd.json +0 -0
  248. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/db2ls.py +0 -0
  249. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/doc.py +0 -0
  250. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/export_requirements.py +0 -0
  251. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/fetch_update.py +0 -0
  252. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/freqanalysis.py +0 -0
  253. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/ich2ls.py +0 -0
  254. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/mol.py +0 -0
  255. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/ocr.py +0 -0
  256. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/setuptools-70.1.0-py3-none-any.whl +0 -0
  257. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/sleep_events_detectors.py +0 -0
  258. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/stats.py +0 -0
  259. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/translator.py +0 -0
  260. {py2ls-0.2.4.24 → py2ls-0.2.4.26}/py2ls/wb_detector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2ls
3
- Version: 0.2.4.24
3
+ Version: 0.2.4.26
4
4
  Summary: py(thon)2(too)ls
5
5
  Author: Jianfeng
6
6
  Author-email: Jianfeng.Liu0413@gmail.com
@@ -38,6 +38,7 @@ Requires-Dist: XlsxWriter (>=3.2.0)
38
38
  Requires-Dist: asciitree (>=0.3.3)
39
39
  Requires-Dist: asttokens (>=2.4.1)
40
40
  Requires-Dist: attrs (>=23.2.0)
41
+ Requires-Dist: autogluon (>=1.2)
41
42
  Requires-Dist: beautifulsoup4 (>=4.12.3)
42
43
  Requires-Dist: bleach (>=6.1.0)
43
44
  Requires-Dist: build (>=0.10.0)
@@ -77,6 +78,7 @@ Requires-Dist: fpdf (>=1.7.2)
77
78
  Requires-Dist: fsspec (>=2024.6.1)
78
79
  Requires-Dist: fuzzywuzzy (>=0.18.0)
79
80
  Requires-Dist: ghp-import (>=2.1.0)
81
+ Requires-Dist: gluoncv (>=0.10.5)
80
82
  Requires-Dist: googletrans (>=4.0.0rc1)
81
83
  Requires-Dist: h11 (>=0.9.0)
82
84
  Requires-Dist: h2 (>=3.2.0)
@@ -149,6 +151,7 @@ Requires-Dist: patsy (>=0.5.6)
149
151
  Requires-Dist: pdf2image (>=1.17.0)
150
152
  Requires-Dist: pdf2img (>=0.1.2)
151
153
  Requires-Dist: pexpect (>=4.9.0)
154
+ Requires-Dist: phonenumbers (>=8.13.51)
152
155
  Requires-Dist: phylib (>=2.6.0)
153
156
  Requires-Dist: pikepdf (>=9.1.0)
154
157
  Requires-Dist: pillow (>=10.4.0)
@@ -225,6 +228,7 @@ Requires-Dist: trio-websocket (>=0.11.1)
225
228
  Requires-Dist: trove-classifiers (>=2024.7.2)
226
229
  Requires-Dist: typing_extensions (>=4.12.2)
227
230
  Requires-Dist: tzdata (>=2024.1)
231
+ Requires-Dist: tzlocal (>=5.2)
228
232
  Requires-Dist: urllib3 (>=2.2.2)
229
233
  Requires-Dist: virtualenv (>=20.26.3)
230
234
  Requires-Dist: watchdog (>=4.0.1)
Binary file
@@ -0,0 +1,475 @@
1
+ # correlations
2
+ import numpy as np
3
+ import pandas as pd
4
+
5
+ from scipy.interpolate import interp1d
6
+ import statsmodels.api as sm
7
+ from scipy.stats import pearsonr, spearmanr
8
+ # (1) pd.Series(data1).rolling(window=winsize).corr(pd.Series(data2))
9
+ def corr_pd_roll(x,y,window=3):
10
+ """
11
+ winsize = 10
12
+ series_1 = pd.Series(res_spin.spin["freq"])
13
+ series_2 = pd.Series(res_spin.spin["pk2pk"])
14
+ # Compute the rolling correlation coefficient
15
+ rolling_correlation = corr_pd_roll(series_1, series_2,window=winsize)
16
+ Returns:
17
+ rolling_correlation
18
+ """
19
+ # pd.Series() data1 and data2
20
+ series_1 = pd.Series(x)
21
+ series_2 = pd.Series(y)
22
+ # Compute the rolling correlation coefficient
23
+ rolling_correlation = series_1.rolling(window=window).corr(series_2)
24
+ print(f" corr_pd_roll correlation to check similarity, \nwindow is {window}, cannot be 1")
25
+ return rolling_correlation
26
+ # Sliding window: a sliding window with incremental updates. This method is computationally
27
+ # efficient compared to recalculating the correlation coefficient for each window.
28
+ def corr_sliding_window(x, y, window=1):
29
+ """
30
+ corr_sliding_window a sliding window with incremental updates.
31
+ This method is computationally efficient compared to recalculating
32
+ the correlation coefficient for each window.
33
+
34
+ series_1 = pd.Series(res_spin.spin["freq"])
35
+ series_2 = pd.Series(res_spin.spin["pk2pk"])
36
+ sliding_corr=corr_sliding_window(series_1, series_2, window=3)
37
+ Returns:
38
+ sliding_corr: r values
39
+ """
40
+ # Initialize variables
41
+ n = len(x)
42
+ sum_x = np.sum(x[:window])
43
+ sum_y = np.sum(y[:window])
44
+ sum_xy = np.sum(x[:window] * y[:window])
45
+ sum_x_sq = np.sum(x[:window] ** 2)
46
+ sum_y_sq = np.sum(y[:window] ** 2)
47
+
48
+ # Compute the initial correlation coefficient
49
+ corr = [
50
+ (n * sum_xy - sum_x * sum_y)
51
+ / np.sqrt((n * sum_x_sq - sum_x**2) * (n * sum_y_sq - sum_y**2))
52
+ ]
53
+
54
+ # Update correlation coefficient for each subsequent window
55
+ for i in range(1, n - window + 1):
56
+ sum_x += x[i + window - 1] - x[i - 1]
57
+ sum_y += y[i + window - 1] - y[i - 1]
58
+ sum_xy += np.dot(x[i : i + window], y[i : i + window]) - np.dot(
59
+ x[i - 1 : i + window - 1], y[i - 1 : i + window - 1]
60
+ )
61
+ sum_x_sq += np.sum(x[i : i + window] ** 2) - np.sum(
62
+ x[i - 1 : i + window - 1] ** 2
63
+ )
64
+ sum_y_sq += np.sum(y[i : i + window] ** 2) - np.sum(
65
+ y[i - 1 : i + window - 1] ** 2
66
+ )
67
+
68
+ # Compute the correlation coefficient for the current window
69
+ corr.append(
70
+ (window * sum_xy - sum_x * sum_y)
71
+ / np.sqrt(
72
+ (window * sum_x_sq - sum_x**2)
73
+ * (window * sum_y_sq - sum_y**2)
74
+ )
75
+ )
76
+
77
+ return np.array(corr)
78
+
79
+
80
+ # Fourier Transform for correlation analysis
81
+ # Compute the cross-power spectral density (CPSD) between the two time series.
82
+ # Compute the power spectral density (PSD) of each time series separately.
83
+ # Divide the CPSD by the square root of the product of the individual PSDs to obtain the cross-correlation function.
84
+ # Apply the inverse Fourier Transform to obtain the correlation coefficient as a function of time.
85
+ def corr_fft(x, y):
86
+ """
87
+ corr_fft _summary_
88
+
89
+ Args:
90
+ x (_type_): _description_
91
+ y (_type_): _description_
92
+ series_1 = pd.Series(res_spin.spin["freq"])
93
+ series_2 = pd.Series(res_spin.spin["pk2pk"])
94
+ r=corr_fft(series_1, series_2)
95
+ Returns:
96
+ r: r values
97
+ """
98
+ # Compute FFT of each time series
99
+ fft_x = np.fft.fft(x)
100
+ fft_y = np.fft.fft(y)
101
+
102
+ # Compute cross-power spectral density
103
+ cpsd = fft_x * np.conj(fft_y)
104
+
105
+ # Compute power spectral density of each time series
106
+ psd_x = np.abs(fft_x) ** 2
107
+ psd_y = np.abs(fft_y) ** 2
108
+
109
+ # Compute cross-correlation function
110
+ cross_corr = np.fft.ifft(cpsd / np.sqrt(psd_x * psd_y))
111
+ return cross_corr.real
112
+
113
+ # Exponentially Weighted Moving Average (EWMA)
114
+ # You can use exponentially weighted moving average to compute the correlation coefficient continuously over time. This method assigns exponentially decreasing weights
115
+ # to the past observations, giving more weight to recent observations. Here's an example of how you can implement it:
116
+ def corr_ewma(x, y, smth=0.1): # alpha is the smth factor
117
+ """
118
+ smth = 0.1 # default
119
+ # Compute the EWMA correlation coefficient
120
+ series_1 = pd.Series(res_spin.spin["freq"])
121
+ series_2 = pd.Series(res_spin.spin["pk2pk"])
122
+ ewma_correlation = corr_ewma(series_1, series_2, smth=smth)
123
+
124
+ Args:
125
+ x (_type_): data1
126
+ y (_type_): data2
127
+ smth (float, optional): alpha is the smth factor. Defaults to 0.1.
128
+
129
+ Returns:
130
+ ewma_correlation: r values
131
+ """
132
+ corr = []
133
+ corr.append(np.corrcoef(x, y)[0, 1])
134
+ for i in range(1, len(x)):
135
+ corr.append(
136
+ smth * np.corrcoef(x[: i + 1], y[: i + 1])[0, 1] + (1 - smth) * corr[i - 1]
137
+ )
138
+ return np.array(corr)
139
+
140
+ # Recursive Formulas
141
+ # where each new value is computed based on the previous one. This method is similar to
142
+ # rolling window functions but calculates each new value efficiently without re-computing
143
+ # the entire window.
144
+ def corr_recursive(x, y):
145
+ corr = []
146
+ corr.append(np.corrcoef(x[:2], y[:2])[0, 1])
147
+ for i in range(2, len(x)):
148
+ corr.append(
149
+ (i - 1) / i * corr[-1] + 1 / i * np.corrcoef(x[: i + 1], y[: i + 1])[0, 1]
150
+ )
151
+ return np.array(corr)
152
+
153
+ # adaptive or online algorithm
154
+ # One such algorithm is the Online Pearson Correlation Coefficient algorithm, which updates the correlation coefficient as new data points become available without the need for storing or reprocessing past data.
155
+ class ContinuousOnlinePearsonCorrelation:
156
+ """
157
+ x = pd.Series(res_spin.spin["freq"])
158
+ y = pd.Series(res_spin.spin["pk2pk"])
159
+
160
+ # Initialize ContinuousOnlinePearsonCorrelation
161
+ continuous_online_corr = ContinuousOnlinePearsonCorrelation()
162
+ for i, j in zip(x, y):
163
+ continuous_online_corr.update(i, j)
164
+
165
+ print("Continuous correlation coefficients:")
166
+ print(continuous_online_corr.correlation_values[:10])
167
+ """
168
+ def __init__(self):
169
+ self.n = 0
170
+ self.mean_x = 0
171
+ self.mean_y = 0
172
+ self.m2_x = 0
173
+ self.m2_y = 0
174
+ self.cov_xy = 0
175
+ self.correlation_values = []
176
+
177
+ def update(self, x, y):
178
+ self.n += 1
179
+ delta_x = x - self.mean_x
180
+ delta_y = y - self.mean_y
181
+ self.mean_x += delta_x / self.n
182
+ self.mean_y += delta_y / self.n
183
+ delta2_x = x - self.mean_x
184
+ delta2_y = y - self.mean_y
185
+ self.m2_x += delta_x * delta2_x
186
+ self.m2_y += delta_y * delta2_y
187
+ self.cov_xy += delta_x * delta_y * (self.n - 1) / self.n
188
+ if self.m2_x > 0 and self.m2_y > 0:
189
+ correlation = self.cov_xy / (self.m2_x**0.5 * self.m2_y**0.5)
190
+ self.correlation_values.append(correlation)
191
+
192
+
193
+ """
194
+ # what if the two data series with different sample rate. how to do the correlation?
195
+
196
+ If the two data series have different sample rates, you can still compute the correlation between them. However, you need to ensure that they are synchronized or resampled to a common time grid before calculating the correlation.
197
+
198
+ general approach to handle data series with different sample rates:
199
+
200
+ (1) Resample both data series to a common time grid using interpolation or other resampling techniques.
201
+
202
+ (2) Compute the correlation between the resampled data series.
203
+
204
+ example:
205
+ series_1 = pd.Series(res_spin.spin["freq"])
206
+ series_2 = pd.Series(res_spin.spin["pk2pk"])
207
+ series_3 = resample_data(res_spin.spin["freq"], 1000, 12)
208
+ series_3 = pd.Series(series_3)
209
+ series_4 = resample_data(res_spin.spin["pk2pk"], 1000, 12)
210
+ series_4 = pd.Series(series_4)
211
+ window_size = 10
212
+ resample_sliding_corr = sliding_window_corr(series_3, series_4, window_size)
213
+ """
214
+
215
+ def corr_interp_sliding(
216
+ x, y, x_timestamps, y_timestamps, window_size
217
+ ):
218
+ """
219
+ Using interpolation to align timestamps followed by sliding window computation of the correlation coefficient
220
+
221
+ Args:
222
+ x (np.array): _description_
223
+ y (_type_): _description_
224
+ x_timestamps (int): _description_
225
+ y_timestamps (int): _description_
226
+ window_size (int): sliding window
227
+ # Example data
228
+ x = np.random.randn(10000) # sampled at 1000 Hz
229
+ y = np.random.randn(120) # sampled at 12 Hz
230
+
231
+ x_timestamps = np.linspace(0, 10, 10000) # EEG timestamps
232
+ y_timestamps = np.linspace(0, 10, 120) # Glucose timestamps
233
+
234
+ # Set the window size for sliding window correlation computation
235
+ window_size = 100 # Adjust according to your needs
236
+
237
+ # Compute continuous correlation coefficients using interpolation and sliding window
238
+ continuous_correlation = corr_interp_sliding(
239
+ x, y, x_timestamps, y_timestamps, window_size
240
+ )
241
+
242
+ print("Continuous correlation coefficients:")
243
+ print(continuous_correlation)
244
+ Returns:
245
+ continuous_correlation: r value
246
+ """
247
+ # Interpolate y data onto x timestamps
248
+ interp_func = interp1d(y_timestamps, y, kind="linear", fill_value="extrapolate")
249
+ y_interp = interp_func(x_timestamps)
250
+
251
+ # Compute correlation coefficient using sliding window
252
+ n = len(x)
253
+ corr_values = []
254
+
255
+ for i in range(n - window_size + 1):
256
+ x_window = x[i : i + window_size]
257
+ y_window = y_interp[i : i + window_size]
258
+
259
+ # Calculate correlation coefficient for the current window
260
+ correlation = np.corrcoef(x_window, y_window)[0, 1]
261
+ corr_values.append(correlation)
262
+
263
+ return np.array(corr_values)
264
+
265
+
266
+ """
267
+ Autocorrelation is used in various fields and applications, including:
268
+
269
+ Time Series Analysis: Autocorrelation is fundamental in time series analysis
270
+ for understanding the structure and patterns in sequential data. It helps identify
271
+ seasonality, trends, and other repeating patterns within the data.
272
+
273
+ Modeling and Forecasting: Autocorrelation informs the selection of appropriate models
274
+ for forecasting future values of a time series. Models such as autoregressive
275
+ integrated moving average (ARIMA) and seasonal autoregressive integrated moving
276
+ average (SARIMA) rely on autocorrelation patterns to capture dependencies between
277
+ observations.
278
+
279
+ Quality Control: In manufacturing and process control, autocorrelation analysis
280
+ is used to detect correlations between successive measurements. Deviations from
281
+ expected autocorrelation patterns can indicate process instability or abnormalities.
282
+
283
+ Signal Processing: Autocorrelation is used in signal processing for tasks such as
284
+ speech recognition, audio processing, and seismic analysis to analyze time-domain
285
+ signals and extract useful information about signal characteristics.
286
+
287
+ Overall, autocorrelation provides valuable insights into the temporal dependencies
288
+ and behavior of time series data, enabling better understanding, modeling, and prediction
289
+ of sequential phenomena.
290
+ """
291
+ def autocorr_np(x, lag=1):
292
+ """
293
+ autocorr_np : use np.correlate(x)
294
+
295
+ Args:
296
+ x (_type_): _description_
297
+ lag (_type_): _description_
298
+ # Example data
299
+ data = np.random.randn(100)
300
+
301
+ # Compute autocorrelation at lag 1
302
+ lag_1_autocorr = autocorr_np(data, 1)
303
+ print("Autocorrelation at lag 1:", lag_1_autocorr)
304
+ Returns:
305
+ lag_corr: r value
306
+ """
307
+ n = len(x)
308
+ mean = np.mean(x)
309
+ var = np.var(x)
310
+ x = x - mean
311
+ lag_corr = np.correlate(x, x, mode="full") / (var * n)
312
+ return lag_corr[n - 1 : n + lag]
313
+
314
+ def autocorr_pd(data,max_lag=10):
315
+ """
316
+ Compute autocorrelation of a 1D numpy array.
317
+
318
+ Parameters:
319
+ data (numpy.ndarray): 1D array containing the data.
320
+
321
+ # Example data
322
+ data_series = np.random.randn(100)
323
+ autocorr_series = autocorr_pd(data_series)
324
+ print("Autocorrelation:", autocorr_series)
325
+ Returns:
326
+ float: Autocorrelation value.
327
+ """
328
+ # Compute mean and centered data
329
+ mean = np.mean(data)
330
+ centered_data = data - mean
331
+
332
+ # Compute autocovariance at lag 0
333
+ auto_covariance_0 = np.mean(centered_data ** 2)
334
+
335
+ # Compute autocorrelation values for a range of lags
336
+ autocorr_values = np.zeros(max_lag + 1)
337
+ for lag in range(max_lag + 1):
338
+ if lag == 0:
339
+ autocorr_values[lag] = 1.0
340
+ else:
341
+ auto_covariance_lag = np.mean(centered_data[:-lag] * centered_data[lag:])
342
+ autocorr_values[lag] = auto_covariance_lag / auto_covariance_0
343
+
344
+ return autocorr_values
345
+
346
+
347
+ def autocorr_statsmodels(data, nlags=1):
348
+ """
349
+ Compute autocorrelation of a 1D numpy array using StatsModels.
350
+
351
+ Parameters:
352
+ data (numpy.ndarray): 1D array containing the data.
353
+ nlags (int): Number of lags for which to compute autocorrelation (default: 1).
354
+ # Example data
355
+ data_array = np.random.randn(100)
356
+ autocorr_array = compute_autocorrelation(data_array, nlags=1)
357
+ print("Autocorrelation at lag 1:", autocorr_array)
358
+ Returns:
359
+ autocorr_array(float): Autocorrelation value at the specified lag.
360
+ """
361
+ # Compute autocorrelation using StatsModels
362
+ autocorr_result = sm.tsa.acf(data, nlags=nlags)
363
+
364
+ return autocorr_result
365
+
366
+
367
+ """
368
+ cross-correlation
369
+
370
+ Cross-correlation is a statistical method used to measure the similarity between two
371
+ time series by comparing them at different time lags. Unlike autocorrelation, which
372
+ measures the similarity of a time series with itself at different lags, cross-correlation
373
+ measures the similarity between two different time series.
374
+
375
+ Cross-correlation has several applications, including:
376
+ Signal Processing: In signal processing, cross-correlation is used to detect similarities
377
+ between different signals or to find the time delay between them. It is widely used in
378
+ fields such as audio processing, radar signal processing, and image processing.
379
+
380
+ Time Series Analysis: Cross-correlation helps identify relationships and dependencies between
381
+ different time series data. It is used in fields such as economics, finance, and environmental
382
+ science to analyze the interactions between various variables over time.
383
+
384
+ Pattern Recognition: Cross-correlation is used in pattern recognition tasks to match and
385
+ compare patterns in different datasets. It is employed in fields such as speech recognition,
386
+ pattern matching, and machine vision.
387
+ """
388
+
389
+ def cross_corr_np(x, y,mode='same'):
390
+ """
391
+ cross_corr_np _summary_
392
+
393
+ Args:
394
+ x (_type_): _description_
395
+ y (_type_): _description_
396
+ mode: default 'same', returns the same lengh "full", in NumPy, setting the mode parameter to "full" returns the
397
+ cross-correlation of x and y at each position of their overlap, with the result
398
+ being twice the length of the original sequences minus 1.
399
+ # Example data
400
+ x = np.random.randn(100)
401
+ y = np.random.randn(100)
402
+ cross_corr_values = cross_corr_np(x, y)
403
+ print("Cross-correlation values:", cross_corr_values[:4])
404
+ Returns:
405
+ _type_: _description_
406
+ """
407
+ n = len(x)
408
+ mean_x = np.mean(x)
409
+ mean_y = np.mean(y)
410
+ x = x - mean_x
411
+ y = y - mean_y
412
+ cross_corr_values = np.correlate(x, y, mode=mode) / (np.std(x) * np.std(y) * n)
413
+ return cross_corr_values
414
+
415
+ def cross_corr_pd(x, y):
416
+ """
417
+ Compute cross-correlation coefficient between two pandas Series.
418
+ Example:
419
+ x=np.random.randn(100)
420
+ y=np.random.randn(100)
421
+ cross_corr_values = cross_corr_pd(x,y)
422
+ print("Cross-correlation:", cross_corr_values)
423
+ Returns:
424
+ cross_corr_values(float): Cross-correlation coefficient between the two Series.
425
+ """
426
+ Series1=pd.Series(x)
427
+ Series2=pd.Series(y)
428
+ # Compute cross-correlation using pandas
429
+ cross_corr_value = Series1.corr(Series2)
430
+
431
+ return cross_corr_value
432
+
433
+ def cross_corr_scipy(x, y):
434
+ from scipy.signal import correlate
435
+ cross_corr_values = correlate(x, y)
436
+ print("Cross-correlation values:", cross_corr_values[:4])
437
+ return cross_corr_values
438
+
439
+ """Autocorrelation is used in various fields and applications, including:
440
+
441
+ Time Series Analysis: Autocorrelation is fundamental in time series analysis for understanding the structure and patterns in sequential data. It helps identify seasonality, trends, and other repeating patterns within the data.
442
+
443
+ Modeling and Forecasting: Autocorrelation informs the selection of appropriate models for forecasting future values of a time series. Models such as autoregressive integrated moving average (ARIMA) and seasonal autoregressive integrated moving average (SARIMA) rely on autocorrelation patterns to capture dependencies between observations.
444
+
445
+ Quality Control: In manufacturing and process control, autocorrelation analysis is used to detect correlations between successive measurements. Deviations from expected autocorrelation patterns can indicate process instability or abnormalities.
446
+
447
+ Signal Processing: Autocorrelation is used in signal processing for tasks such as speech recognition, audio processing, and seismic analysis to analyze time-domain signals and extract useful information about signal characteristics.
448
+
449
+ Overall, autocorrelation provides valuable insights into the temporal dependencies and behavior of time series data, enabling better understanding, modeling, and prediction of sequential phenomena."""
450
+ def autocorr(x, lag):
451
+ n = len(x)
452
+ mean = np.mean(x)
453
+ var = np.var(x)
454
+ x = x - mean
455
+ corr = np.correlate(x, x, mode="full") / (var * n)
456
+ return corr[n - 1 : n + lag]
457
+
458
+ """
459
+ General correlation
460
+ e.g., Pearson correlation or Spearman correlation
461
+ """
462
+ def corr(x, y, method='pearson'):
463
+ if method.lower() in ['pe','pear','pearson','peson','pearon']:
464
+ r, p = pearsonr(x, y)
465
+ print("Pearson correlation coefficient:", r)
466
+ print("Pearson p-value:", p)
467
+ return r,p
468
+ elif method.lower() in ['spear','sp','spea','spearman','speaman']:
469
+ r, p = spearmanr(x, y)
470
+ print("Spearman correlation coefficient:", r)
471
+ print("Spearman p-value:", p)
472
+ return r,p
473
+ else:
474
+ print(f"{method} is not supported, do you mean 'pearson' or 'spearman'")
475
+ return None, None