pgsi-analyzer 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. pgsi_analyzer-1.0.0/LICENSE +21 -0
  2. pgsi_analyzer-1.0.0/MANIFEST.in +6 -0
  3. pgsi_analyzer-1.0.0/PKG-INFO +552 -0
  4. pgsi_analyzer-1.0.0/README.md +504 -0
  5. pgsi_analyzer-1.0.0/pyproject.toml +121 -0
  6. pgsi_analyzer-1.0.0/setup.cfg +4 -0
  7. pgsi_analyzer-1.0.0/src/pgsi_analyzer/__init__.py +24 -0
  8. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmark/__init__.py +19 -0
  9. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmark/builder.py +265 -0
  10. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmark/executor.py +505 -0
  11. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmark/orchestrator.py +413 -0
  12. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmark/provider.py +128 -0
  13. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmark/results_collector.py +109 -0
  14. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/__init__.py +15 -0
  15. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/README.md +85 -0
  16. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/cpython/main.py +104 -0
  17. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/ctypes/binary_tree.c +37 -0
  18. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/ctypes/main.py +73 -0
  19. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/cython/main.py +19 -0
  20. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/cython/raw.c +8855 -0
  21. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/cython/raw.pyx +88 -0
  22. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/cython/setup.py +9 -0
  23. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/py_compile/__compiler.py +8 -0
  24. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/py_compile/main.py +105 -0
  25. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/binary-trees/pypy/main.py +105 -0
  26. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/discovery.py +123 -0
  27. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/README.md +116 -0
  28. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/cpython/main.py +96 -0
  29. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/ctypes/fannkuch.c +68 -0
  30. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/ctypes/main.py +51 -0
  31. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/cython/main.py +28 -0
  32. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/cython/raw.c +13311 -0
  33. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/cython/raw.pyx +58 -0
  34. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/cython/setup.py +17 -0
  35. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/py_compile/__compiler.py +8 -0
  36. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/py_compile/main.py +96 -0
  37. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fannkuch-redux/pypy/main.py +96 -0
  38. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/README.md +61 -0
  39. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/cpython/main.py +171 -0
  40. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/ctypes/fasta.c +99 -0
  41. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/ctypes/main.py +85 -0
  42. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/cython/main.py +48 -0
  43. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/cython/raw.c +14552 -0
  44. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/cython/raw.pyx +103 -0
  45. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/cython/setup.py +17 -0
  46. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/py_compile/__compiler.py +8 -0
  47. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/py_compile/main.py +171 -0
  48. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/fasta/pypy/main.py +172 -0
  49. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/README.md +33 -0
  50. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/cpython/main.py +91 -0
  51. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/ctypes/hanoi.c +20 -0
  52. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/ctypes/main.py +62 -0
  53. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/cython/main.py +54 -0
  54. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/cython/raw.c +8536 -0
  55. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/cython/raw.pyx +22 -0
  56. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/cython/setup.py +9 -0
  57. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/py_compile/__compailer.py +8 -0
  58. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/py_compile/main.py +91 -0
  59. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/hanoi/pypy/main.py +91 -0
  60. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/README.md +93 -0
  61. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/cpython/main.py +87 -0
  62. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/ctypes/kmer_counter.c +67 -0
  63. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/ctypes/main.py +101 -0
  64. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/cython/main.py +70 -0
  65. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/cython/raw.c +8560 -0
  66. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/cython/raw.pyx +35 -0
  67. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/cython/setup.py +9 -0
  68. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/dna.txt +8 -0
  69. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/py_compile/__compiler.py +8 -0
  70. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/py_compile/main.py +87 -0
  71. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/k-nucleotide/pypy/main.py +87 -0
  72. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/README.md +47 -0
  73. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/cpython/main.py +105 -0
  74. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/ctypes/knn.c +43 -0
  75. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/ctypes/main.py +76 -0
  76. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/cython/main.py +49 -0
  77. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/cython/raw.c +30444 -0
  78. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/cython/raw.pyx +55 -0
  79. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/cython/setup.py +9 -0
  80. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/py_compile/__compiler.py +8 -0
  81. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/py_compile/main.py +117 -0
  82. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/knn/pypy/main.py +117 -0
  83. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/README.md +40 -0
  84. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/cpython/main.py +127 -0
  85. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/ctypes/main.py +70 -0
  86. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/ctypes/mandelbrot.c +33 -0
  87. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/cython/main.py +48 -0
  88. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/cython/raw.c +8122 -0
  89. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/cython/raw.pyx +36 -0
  90. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/cython/setup.py +9 -0
  91. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/py_compile/__compiler.py +8 -0
  92. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/py_compile/main.py +126 -0
  93. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/mandelbrot/pypy/main.py +128 -0
  94. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/README.md +57 -0
  95. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/cpython/main.py +181 -0
  96. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/ctypes/main.py +100 -0
  97. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/ctypes/nbody.c +84 -0
  98. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/cython/main.py +76 -0
  99. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/cython/raw.c +30596 -0
  100. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/cython/raw.pyx +90 -0
  101. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/cython/setup.py +9 -0
  102. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/py_compile/__compiler.py +8 -0
  103. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/py_compile/main.py +180 -0
  104. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-body/pypy/main.py +180 -0
  105. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/README.md +44 -0
  106. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/cpython/main.py +131 -0
  107. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/ctypes/main.py +66 -0
  108. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/ctypes/n_queens.c +76 -0
  109. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/cython/main.py +52 -0
  110. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/cython/raw.c +27786 -0
  111. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/cython/raw.pyx +64 -0
  112. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/cython/setup.py +9 -0
  113. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/py_compile/__compailer.py +8 -0
  114. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/py_compile/main.py +131 -0
  115. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/n-queens/pypy/main.py +131 -0
  116. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/README.md +56 -0
  117. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/cpython/main.py +59 -0
  118. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/ctypes/main.py +52 -0
  119. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/ctypes/pi_gauss_legendre.c +19 -0
  120. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/cython/main.py +30 -0
  121. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/cython/raw.c +8000 -0
  122. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/cython/raw.pyx +28 -0
  123. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/cython/setup.py +9 -0
  124. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/py_compile/__compiler.py +8 -0
  125. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/py_compile/main.py +59 -0
  126. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/pi-digits/pypy/main.py +59 -0
  127. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/README.md +97 -0
  128. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cpython/input_fasta.txt +2 -0
  129. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cpython/main.py +116 -0
  130. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/ctypes/input_fasta.txt +2 -0
  131. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/ctypes/main.py +71 -0
  132. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/ctypes/regex_redux.c +110 -0
  133. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cython/input_fasta.txt +2 -0
  134. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cython/main.py +68 -0
  135. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cython/raw.c +9999 -0
  136. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cython/raw.pyx +84 -0
  137. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/cython/setup.py +9 -0
  138. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/py_compile/__compiler.py +8 -0
  139. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/py_compile/input_fasta.txt +2 -0
  140. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/py_compile/main.py +116 -0
  141. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/pypy/input_fasta.txt +2 -0
  142. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/regex-redux/pypy/main.py +113 -0
  143. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/registry.py +210 -0
  144. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/README.md +93 -0
  145. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/cpython/main.py +56 -0
  146. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/ctypes/main.py +47 -0
  147. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/ctypes/reverse_comlement.c +28 -0
  148. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/cython/main.py +26 -0
  149. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/cython/raw.c +8364 -0
  150. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/cython/raw.pyx +39 -0
  151. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/cython/setup.py +9 -0
  152. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/py_compile/__compiler.py +8 -0
  153. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/py_compile/main.py +56 -0
  154. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/reverse-complement/pypy/main.py +56 -0
  155. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/README.md +67 -0
  156. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/cpython/main.py +60 -0
  157. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/ctypes/main.py +53 -0
  158. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/ctypes/sieve.c +54 -0
  159. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/cython/main.py +24 -0
  160. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/cython/raw.c +8828 -0
  161. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/cython/raw.pyx +38 -0
  162. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/cython/setup.py +9 -0
  163. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/py_compile/__compiler.py +8 -0
  164. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/py_compile/main.py +60 -0
  165. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/sieve/pypy/main.py +60 -0
  166. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/README.md +72 -0
  167. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/cpython/main.py +83 -0
  168. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/ctypes/main.py +49 -0
  169. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/ctypes/spectralnorm.c +71 -0
  170. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/cython/main.py +27 -0
  171. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/cython/raw.c +9385 -0
  172. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/cython/raw.pyx +57 -0
  173. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/cython/setup.py +9 -0
  174. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/py_compile/__compiler.py +8 -0
  175. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/py_compile/main.py +83 -0
  176. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/spectral-norm/pypy/main.py +83 -0
  177. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/README.md +113 -0
  178. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/cpython/main.py +101 -0
  179. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/ctypes/main.py +83 -0
  180. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/ctypes/strassen.c +91 -0
  181. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/cython/main.py +53 -0
  182. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/cython/raw.c +10465 -0
  183. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/cython/raw.pyx +71 -0
  184. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/cython/setup.py +9 -0
  185. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/py_compile/__compiler.py +8 -0
  186. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/py_compile/main.py +101 -0
  187. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/strassen/pypy/main.py +102 -0
  188. pgsi_analyzer-1.0.0/src/pgsi_analyzer/benchmarks/template.py +349 -0
  189. pgsi_analyzer-1.0.0/src/pgsi_analyzer/cli/__init__.py +10 -0
  190. pgsi_analyzer-1.0.0/src/pgsi_analyzer/cli/main.py +478 -0
  191. pgsi_analyzer-1.0.0/src/pgsi_analyzer/config/cpu_power.csv +4904 -0
  192. pgsi_analyzer-1.0.0/src/pgsi_analyzer/config/cpu_power.source.json +15 -0
  193. pgsi_analyzer-1.0.0/src/pgsi_analyzer/config.py +300 -0
  194. pgsi_analyzer-1.0.0/src/pgsi_analyzer/gui/__init__.py +8 -0
  195. pgsi_analyzer-1.0.0/src/pgsi_analyzer/gui/app.py +1105 -0
  196. pgsi_analyzer-1.0.0/src/pgsi_analyzer/measurement/__init__.py +15 -0
  197. pgsi_analyzer-1.0.0/src/pgsi_analyzer/measurement/cpu_power_resolver.py +215 -0
  198. pgsi_analyzer-1.0.0/src/pgsi_analyzer/measurement/energy.py +296 -0
  199. pgsi_analyzer-1.0.0/src/pgsi_analyzer/measurement/estimators.py +315 -0
  200. pgsi_analyzer-1.0.0/src/pgsi_analyzer/measurement/time.py +138 -0
  201. pgsi_analyzer-1.0.0/src/pgsi_analyzer/models/__init__.py +24 -0
  202. pgsi_analyzer-1.0.0/src/pgsi_analyzer/models/aggregation.py +246 -0
  203. pgsi_analyzer-1.0.0/src/pgsi_analyzer/models/carbon.py +85 -0
  204. pgsi_analyzer-1.0.0/src/pgsi_analyzer/models/combination.py +201 -0
  205. pgsi_analyzer-1.0.0/src/pgsi_analyzer/models/greenscore.py +190 -0
  206. pgsi_analyzer-1.0.0/src/pgsi_analyzer/platform/__init__.py +26 -0
  207. pgsi_analyzer-1.0.0/src/pgsi_analyzer/platform/detection.py +102 -0
  208. pgsi_analyzer-1.0.0/src/pgsi_analyzer/platform/hardware.py +202 -0
  209. pgsi_analyzer-1.0.0/src/pgsi_analyzer/platform/paths.py +94 -0
  210. pgsi_analyzer-1.0.0/src/pgsi_analyzer/utils/__init__.py +37 -0
  211. pgsi_analyzer-1.0.0/src/pgsi_analyzer/utils/errors.py +28 -0
  212. pgsi_analyzer-1.0.0/src/pgsi_analyzer/utils/validation.py +46 -0
  213. pgsi_analyzer-1.0.0/src/pgsi_analyzer.egg-info/PKG-INFO +552 -0
  214. pgsi_analyzer-1.0.0/src/pgsi_analyzer.egg-info/SOURCES.txt +230 -0
  215. pgsi_analyzer-1.0.0/src/pgsi_analyzer.egg-info/dependency_links.txt +1 -0
  216. pgsi_analyzer-1.0.0/src/pgsi_analyzer.egg-info/entry_points.txt +3 -0
  217. pgsi_analyzer-1.0.0/src/pgsi_analyzer.egg-info/requires.txt +22 -0
  218. pgsi_analyzer-1.0.0/src/pgsi_analyzer.egg-info/top_level.txt +1 -0
  219. pgsi_analyzer-1.0.0/tests/test_benchmark_builder.py +318 -0
  220. pgsi_analyzer-1.0.0/tests/test_benchmark_discovery.py +78 -0
  221. pgsi_analyzer-1.0.0/tests/test_benchmark_executor.py +370 -0
  222. pgsi_analyzer-1.0.0/tests/test_benchmark_orchestrator.py +529 -0
  223. pgsi_analyzer-1.0.0/tests/test_benchmark_provider.py +85 -0
  224. pgsi_analyzer-1.0.0/tests/test_benchmarks_registry.py +163 -0
  225. pgsi_analyzer-1.0.0/tests/test_cli_benchmark.py +343 -0
  226. pgsi_analyzer-1.0.0/tests/test_cpu_power_resolver.py +28 -0
  227. pgsi_analyzer-1.0.0/tests/test_energy_crossplatform.py +310 -0
  228. pgsi_analyzer-1.0.0/tests/test_estimators.py +268 -0
  229. pgsi_analyzer-1.0.0/tests/test_measurement.py +476 -0
  230. pgsi_analyzer-1.0.0/tests/test_models.py +530 -0
  231. pgsi_analyzer-1.0.0/tests/test_platform.py +281 -0
  232. pgsi_analyzer-1.0.0/tests/test_results_collector.py +124 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Md Fatin Shadab Turja
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ include README.md LICENSE
2
+ global-exclude *.py[cod]
3
+ global-exclude __pycache__
4
+ global-exclude *.dll
5
+ global-exclude *.so
6
+ global-exclude *.pyd
@@ -0,0 +1,552 @@
1
+ Metadata-Version: 2.4
2
+ Name: pgsi-analyzer
3
+ Version: 1.0.0
4
+ Summary: A comprehensive benchmarking and analysis tool for comparing energy consumption, execution time, and carbon footprint of Python execution methods using GreenScore metric
5
+ Author: Md Fatin Shadab Turja
6
+ Maintainer: Md Fatin Shadab Turja
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/FatinShadab/python-energy-microscope
9
+ Project-URL: Documentation, https://github.com/FatinShadab/python-energy-microscope
10
+ Project-URL: Repository, https://github.com/FatinShadab/python-energy-microscope
11
+ Project-URL: Issues, https://github.com/FatinShadab/python-energy-microscope/issues
12
+ Keywords: python,energy-efficiency,sustainability,benchmarking,software-performance,green-software,carbon-emissions,energy-consumption,greenscore,cpython,pypy,cython,ctypes,py-compile
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Scientific/Engineering
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: System :: Benchmark
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Operating System :: OS Independent
27
+ Classifier: Environment :: Console
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: pandas>=2.0.0
32
+ Requires-Dist: matplotlib>=3.7.0
33
+ Requires-Dist: numpy>=1.24.0
34
+ Requires-Dist: psutil>=5.9.0
35
+ Requires-Dist: codecarbon>=2.6.0
36
+ Requires-Dist: cython>=3.0.0
37
+ Requires-Dist: python-dotenv>=1.0.0
38
+ Provides-Extra: energy
39
+ Requires-Dist: pyRAPL>=0.2.3; (sys_platform == "linux" and platform_machine == "x86_64") and extra == "energy"
40
+ Provides-Extra: analysis
41
+ Requires-Dist: scipy>=1.10.0; extra == "analysis"
42
+ Requires-Dist: statsmodels>=0.14.0; extra == "analysis"
43
+ Provides-Extra: pypy
44
+ Requires-Dist: py-cpuinfo>=9.0.0; extra == "pypy"
45
+ Provides-Extra: all
46
+ Requires-Dist: pgsi-analyzer[analysis,energy]; extra == "all"
47
+ Dynamic: license-file
48
+
49
+ # PGSI Analyzer: Python GreenScore and Sustainability Analyzer
50
+
51
+ [![Docs](https://readthedocs.org/projects/pgsi/badge/?version=latest)](https://pgsi.readthedocs.io/en/latest/)
52
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](...)
53
+
54
+ 📘 Documentation: https://pgsi.readthedocs.io/en/latest/
55
+
56
+ **PGSI Analyzer** is a comprehensive benchmarking and sustainability analysis tool for Python implementations. It measures and compares the **energy consumption**, **execution time**, **carbon footprint**, and overall **sustainability** of different Python execution methods using a novel composite metric called **GreenScore**.
57
+
58
+ ## Project Overview
59
+
60
+ ### What is PGSI Analyzer?
61
+
62
+ PGSI Analyzer is a CLI-driven benchmark execution framework that runs a suite of CPU-bound algorithms across multiple Python execution methods. It automatically collects raw measurement data, aggregates results, computes carbon emissions, and produces a final **GreenScore** ranking that helps researchers and developers identify the most sustainable Python execution strategies.
63
+
64
+ ### What It Measures
65
+
66
+ - **Execution Time**: Precise runtime measurement using Python's `time.time()`
67
+ - **Energy Consumption**: Cross-platform fallback chain: `pyRAPL` (Linux x86_64) -> `codecarbon` (all platforms) -> CPU-time/TDP estimation
68
+ - **Carbon Footprint**: Derived from energy consumption using configurable carbon intensity factors
69
+ - **GreenScore**: A weighted composite metric integrating energy, carbon, and time (lower is better)
70
+
71
+ ### What It Runs
72
+
73
+ The tool executes a suite of **15 diverse CPU-bound algorithms**, each available across **5 execution methods**:
74
+
75
+ - **CPython**: Standard Python interpreter
76
+ - **PyPy**: Just-In-Time (JIT) compiler
77
+ - **Cython**: Ahead-of-Time (AOT) compiler
78
+ - **ctypes**: Foreign Function Interface to native C code
79
+ - **py_compile**: Bytecode-compiled Python
80
+
81
+ This results in **75 total benchmark combinations** (15 algorithms × 5 methods), providing comprehensive coverage of real-world Python workloads.
82
+
83
+ ## Documentation
84
+
85
+ Full documentation is available at:
86
+
87
+ https://pgsi.readthedocs.io/en/latest/
88
+
89
+ It includes:
90
+ - Installation guides
91
+ - Benchmark development workflow
92
+ - CLI reference
93
+ - GUI usage
94
+ - Architecture and audit documentation
95
+ - Contribution guidelines
96
+
97
+ ## Features
98
+
99
+ ### Benchmarks
100
+
101
+ - **15 algorithms** covering diverse computational patterns:
102
+ - `binary-trees`, `fannkuch-redux`, `fasta`, `k-nucleotide`, `mandelbrot`
103
+ - `n-body`, `n-queens`, `pi-digits`, `regex-redux`, `reverse-complement`
104
+ - `sieve`, `spectral-norm`, `strassen`, `hanoi`, `knn`
105
+ - Each algorithm available for all 5 execution methods
106
+ - Deterministic benchmark registry with automatic discovery
107
+ - Package-integrated benchmarks (no external scripts required)
108
+
109
+ ### Add a Benchmark (Developer Pattern)
110
+
111
+ End-user workflow (outside package source):
112
+
113
+ 1. Install PGSI Analyzer in your project environment:
114
+
115
+ ```bash
116
+ pip install pgsi-analyzer
117
+ ```
118
+
119
+ Recommended benchmark profile (explicit, production-oriented):
120
+
121
+ ```bash
122
+ pip install "pgsi-analyzer[energy,analysis]"
123
+ ```
124
+
125
+ 2. Generate a benchmark scaffold in your own project folder:
126
+
127
+ ```bash
128
+ pgsi-analyzer startproject my-benchmarks --algorithms hanoi
129
+ ```
130
+
131
+ Equivalent command (also supported):
132
+
133
+ ```bash
134
+ pgsi-analyzer benchmark init-template --output ./my-benchmarks --algorithms hanoi
135
+ ```
136
+
137
+ Create a single custom benchmark and auto-register it:
138
+
139
+ ```bash
140
+ pgsi-analyzer create benchmark --name A1 --benchmarks-dir ./my-benchmarks
141
+ ```
142
+
143
+ This creates `./my-benchmarks/A1/...` and updates `./my-benchmarks/pgsi_registry.json`.
144
+
145
+ Tip: when running from a project that has `./benchmarks/pgsi_registry.json`,
146
+ `benchmark list` and `benchmark run` auto-detect `./benchmarks` even if
147
+ `--benchmarks-dir` is omitted.
148
+
149
+ 3. Implement your algorithm workload by editing generated files under:
150
+ `<benchmarks_dir>/<algorithm>/<method>/main.py`
151
+ 4. Keep the PGSI decorators on your benchmark functions:
152
+ - `@measure_energy_to_csv(n=get_measurement_runs("<algorithm>"), csv_filename="<algorithm>_<method>")`
153
+ - `@measure_time_to_csv(n=get_measurement_runs("<algorithm>"), csv_filename="<algorithm>_<method>")`
154
+ 5. Run/list with `--benchmarks-dir <benchmarks_dir>` to include your custom benchmarks
155
+
156
+ The included KNN CPython benchmark is a concrete decorator example:
157
+ - `src/pgsi_analyzer/benchmarks/knn/cpython/main.py`
158
+
159
+ List algorithms including your custom folder:
160
+
161
+ ```bash
162
+ pgsi-analyzer benchmark list --algorithms --benchmarks-dir ./my-benchmarks
163
+ ```
164
+
165
+ Run your custom algorithm:
166
+
167
+ ```bash
168
+ pgsi-analyzer benchmark run \
169
+ --algorithms my-algo \
170
+ --methods cpython \
171
+ --benchmarks-dir ./my-benchmarks
172
+ ```
173
+
174
+ Generate a full template first (recommended):
175
+
176
+ ```bash
177
+ pgsi-analyzer benchmark init-template --output ./my-benchmarks --algorithms all
178
+ ```
179
+
180
+ This scaffolds the benchmark tree with commented starter files (including `cython`/`ctypes` support files), so end developers can implement directly in their own project folder.
181
+
182
+ Quick help:
183
+
184
+ ```bash
185
+ pgsi-analyzer benchmark init-template --help
186
+ ```
187
+
188
+ Example generated tree (trimmed):
189
+
190
+ ```text
191
+ my-benchmarks/
192
+ ├── README.md
193
+ ├── hanoi/
194
+ │ ├── cpython/main.py
195
+ │ ├── pypy/main.py
196
+ │ ├── py_compile/main.py
197
+ │ ├── cython/
198
+ │ │ ├── main.py
199
+ │ │ ├── raw.pyx
200
+ │ │ └── setup.py
201
+ │ └── ctypes/
202
+ │ ├── main.py
203
+ │ └── raw.c
204
+ └── knn/
205
+ └── ...
206
+ ```
207
+
208
+ ### Full Pipeline
209
+
210
+ The tool orchestrates a complete measurement and analysis pipeline:
211
+
212
+ 1. **Build**: Compiles Cython and ctypes benchmarks (if needed)
213
+ 2. **Execute**: Runs benchmarks in isolated subprocesses
214
+ 3. **Collect**: Gathers raw CSV data from measurement decorators
215
+ 4. **Aggregate**: Processes raw data per method
216
+ 5. **Combine**: Merges results across methods
217
+ 6. **Carbon**: Calculates carbon footprint from energy data
218
+ 7. **GreenScore**: Computes final sustainability ranking
219
+
220
+ ### Cross-Platform CLI
221
+
222
+ - `pgsi-analyzer benchmark list`: Lists available algorithms and methods
223
+ - `pgsi-analyzer benchmark run`: Executes benchmarks and generates results
224
+ - `pgsi-analyzer benchmark init-template`: Generates a Django-style user benchmark scaffold
225
+ - `pgsi-analyzer startproject <name>`: Django-like one-command project scaffold
226
+ - `pgsi-analyzer create benchmark --name <name>`: Creates one benchmark scaffold and registers it
227
+ - Supports flexible algorithm/method selection (`all` or specific names)
228
+ - Configurable global runs, per-algorithm run overrides, output directories, and GreenScore weights
229
+
230
+ ### Configuration
231
+
232
+ - **Tool paths** configurable via:
233
+ - `.env` file (recommended)
234
+ - Environment variables (`PGSI_PYPY_PATH`, `PGSI_CC_PATH`, `PGSI_PYTHON_PATH`)
235
+ - CLI flags (`--pypy-path`, `--cc-path`, `--python-path`)
236
+ - Priority: CLI flags > Environment variables > `.env` > Built-in defaults
237
+ - Reproducible ordering and deterministic CSV outputs
238
+
239
+ ## Installation
240
+
241
+ ### Python Requirements
242
+
243
+ - **Python 3.8+** (tested on 3.8 through 3.14)
244
+ - `pip` package manager
245
+
246
+ ### Basic Installation
247
+
248
+ Install from PyPI (or install from source):
249
+
250
+ ```bash
251
+ pip install pgsi-analyzer
252
+ ```
253
+
254
+ This automatically installs core Python dependencies including:
255
+ - `cython>=3.0.0` (for Cython benchmark compilation)
256
+ - `python-dotenv>=1.0.0` (for `.env` file support)
257
+ - `pandas`, `matplotlib`, `numpy`, `psutil` (core analysis libraries)
258
+ - `codecarbon` (default cross-platform energy fallback)
259
+
260
+ ### System Prerequisites
261
+
262
+ **Required:**
263
+
264
+ - **C Compiler** (for `ctypes` and `cython` methods):
265
+ - **Linux/macOS**: `gcc` or `clang` (install via package manager)
266
+ - **Windows**: `cl.exe` (Visual Studio Build Tools) or `gcc` (MinGW/MSYS2)
267
+
268
+ - **Python development headers** (for **Cython** on Linux): If Cython build fails with *Python.h: No such file or directory*, install e.g. `python3-dev` (Debian/Ubuntu: `sudo apt install python3-dev`). See **audit/usage_guide.md** §1.5 for details.
269
+
270
+ **Optional but Recommended:**
271
+
272
+ - **PyPy** on system PATH (for `pypy` method):
273
+ - Install from [PyPy website](https://www.pypy.org/download.html)
274
+ - Ensure `pypy` or `pypy3` is accessible in your PATH
275
+ - **Install only the dependencies used by benchmark scripts** (the runner sets `PYTHONPATH` so PyPy finds the project; you do not need to build pandas/pillow for PyPy). If PyPy has no pip, bootstrap it first:
276
+ ```bash
277
+ pypy3 -m ensurepip
278
+ pypy3 -m pip install psutil python-dotenv
279
+ ```
280
+ (See **audit/usage_guide.md** §1.4 for details.)
281
+
282
+ **Platform Limitations:**
283
+
284
+ - **Hardware energy counters** (pyRAPL) are only available on **Linux x86_64**
285
+ - When `pyRAPL` is unavailable, PGSI tries this fallback chain in order:
286
+ - `codecarbon`-based tracking (works on macOS, Windows, Linux, including ARM devices such as Raspberry Pi)
287
+ - CPU-time/TDP estimation fallback (always available)
288
+ - On macOS, Windows, Linux ARM, and Raspberry Pi, this provides an OS-independent energy path even without RAPL counters
289
+ - All platforms support time measurement and carbon footprint calculation
290
+
291
+ ### Energy Measurement Fallback Chain
292
+
293
+ PGSI uses a deterministic fallback chain so energy collection works across desktop and edge platforms:
294
+
295
+ 1. **`pyRAPL`** (preferred): used only when running on **Linux x86_64** with Intel RAPL access.
296
+ 2. **`codecarbon`**: used when `pyRAPL` is not available (for example on **macOS**, **Windows**, **Linux ARM**, and **Raspberry Pi**).
297
+ 3. **CPU-time/TDP model**: final fallback when `codecarbon` cannot return usable energy data.
298
+
299
+ ### Methodology Provenance Tags
300
+
301
+ Each energy row now includes auditable methodology tags:
302
+
303
+ - `hardware_rapl_linux`: direct pyRAPL hardware counters.
304
+ - `estimated_codecarbon`: CodeCarbon tracker returned energy.
305
+ - `dataset_tdp`: dataset-backed CPU power resolution from packaged `cpu_power.csv`.
306
+ - `generic_tdp`: last-resort generic fallback when no dataset match is found.
307
+
308
+ This means benchmark runs can continue on macOS, Windows, Linux, and Raspberry Pi without failing due to missing hardware counters.
309
+
310
+ ## Quick Start: Basic Usage
311
+
312
+ ### List Available Benchmarks
313
+
314
+ ```bash
315
+ pgsi-analyzer benchmark list
316
+ ```
317
+
318
+ This displays all 15 available algorithms and 5 execution methods.
319
+
320
+ ### Run a Small Test Benchmark
321
+
322
+ ```bash
323
+ pgsi-analyzer benchmark run \
324
+ --algorithms hanoi \
325
+ --methods cpython \
326
+ --runs 5
327
+ ```
328
+
329
+ This runs the `hanoi` algorithm using CPython for 5 runs. The tool will:
330
+ - Execute the benchmark
331
+ - Collect energy and time measurements
332
+ - Generate raw CSVs in `energy_benchmark/` and `time_benchmark/` directories
333
+ - Produce aggregated results and a `GreenScore.csv` in the default `results/` directory
334
+
335
+ ### Run Multiple Algorithms and Methods
336
+
337
+ ```bash
338
+ pgsi-analyzer benchmark run \
339
+ --algorithms hanoi binary-trees \
340
+ --methods cpython pypy \
341
+ --runs 10
342
+ ```
343
+
344
+ This runs two algorithms across two methods, generating comparison data.
345
+
346
+ ### Run Full Suite
347
+
348
+ ```bash
349
+ pgsi-analyzer benchmark run \
350
+ --algorithms all \
351
+ --methods all \
352
+ --runs 50 \
353
+ --output results/
354
+ ```
355
+
356
+ **Note**: This can take significant time (hours depending on your hardware). The `results/` directory will contain:
357
+ - Raw measurement CSVs organized by method
358
+ - Aggregated CSVs per method
359
+ - Combined results across all methods
360
+ - Final `GreenScore.csv` with sustainability rankings
361
+
362
+ ### Launch the GUI (Easy setup + run)
363
+
364
+ You can launch a desktop GUI to configure paths, select algorithms/methods, set run options, and start PGSI without typing full CLI commands.
365
+
366
+ ```bash
367
+ pgsi-analyzer-gui
368
+ ```
369
+
370
+ The GUI provides:
371
+ - Step 1 project setup page (create a new benchmark project or load an existing one)
372
+ - Step 2 run page with benchmark/method selection and run configuration
373
+ - Setup field for `.env` path
374
+ - Per-algorithm run override dialog (set different run counts per selected algorithm)
375
+ - Live run log with progress bar updates from `[x/y]` execution progress
376
+ - Final GreenScore ranking popup (pyramid view) when a run completes successfully
377
+ - One-click output folder access
378
+
379
+ ### GUI Quick Workflow (Screenshot)
380
+
381
+ Use this screen as the standard first-run workflow:
382
+
383
+ 1. Set the `.env` path in **Setup: Tool Paths**
384
+ 2. Configure output + run settings in **Run Configuration**
385
+ 3. Choose algorithms/methods in **Benchmarks Selection**
386
+ 4. Click **Run PGSI Analysis** and monitor **Run Log**
387
+
388
+ ![PGSI GUI dark theme run configuration](docs/images/gui-dark-run-config.png)
389
+
390
+ > If the image does not render yet, place your screenshot at `docs/images/gui-dark-run-config.png`.
391
+
392
+ ### Per-Algorithm Run Overrides (CLI)
393
+
394
+ You can override the global `--runs` value for specific algorithms:
395
+
396
+ ```bash
397
+ pgsi-analyzer benchmark run \
398
+ --algorithms hanoi sieve \
399
+ --methods cpython \
400
+ --runs 50 \
401
+ --algorithm-runs hanoi=20 sieve=10
402
+ ```
403
+
404
+ In this example, `hanoi` runs 20 times, `sieve` runs 10 times, and any algorithm not listed in `--algorithm-runs` uses the global `--runs` value.
405
+
406
+ ### Custom GreenScore Weights
407
+
408
+ ```bash
409
+ pgsi-analyzer benchmark run \
410
+ --algorithms all \
411
+ --methods all \
412
+ --runs 50 \
413
+ --alpha 0.5 --beta 0.3 --gamma 0.2
414
+ ```
415
+
416
+ The `--alpha`, `--beta`, and `--gamma` flags control how energy, carbon footprint, and execution time contribute to the final GreenScore. Default values are `alpha=0.4`, `beta=0.4`, `gamma=0.2`.
417
+
418
+ ## Tool-Path Configuration
419
+
420
+ ### Using `.env` File (Recommended)
421
+
422
+ Create a `.env` file in your project directory:
423
+
424
+ ```env
425
+ PGSI_PYTHON_PATH=/usr/bin/python3
426
+ PGSI_PYPY_PATH=/usr/bin/pypy3
427
+ PGSI_CC_PATH=/usr/bin/gcc
428
+ ```
429
+
430
+ Then run benchmarks with:
431
+
432
+ ```bash
433
+ pgsi-analyzer benchmark run \
434
+ --algorithms hanoi \
435
+ --methods cpython \
436
+ --runs 5 \
437
+ --env-file .env
438
+ ```
439
+
440
+ ### Using CLI Flags
441
+
442
+ Override paths directly from the command line:
443
+
444
+ ```bash
445
+ pgsi-analyzer benchmark run \
446
+ --algorithms hanoi \
447
+ --methods cpython \
448
+ --runs 5 \
449
+ --python-path /path/to/python \
450
+ --pypy-path /path/to/pypy \
451
+ --cc-path /usr/bin/gcc
452
+ ```
453
+
454
+ ### Configuration Precedence
455
+
456
+ Paths are resolved in this order (highest to lowest priority):
457
+
458
+ 1. **Command-line flags** (`--python-path`, `--pypy-path`, `--cc-path`)
459
+ 2. **Environment variables** (`PGSI_PYTHON_PATH`, `PGSI_PYPY_PATH`, `PGSI_CC_PATH`)
460
+ 3. **`.env` file** (if `--env-file` is specified or auto-detected)
461
+ 4. **Built-in defaults** (system PATH detection)
462
+
463
+ ## Outputs and Where to Find Them
464
+
465
+ After running benchmarks, you'll find the following structure in your output directory (default: `results/`):
466
+
467
+ ```
468
+ results/
469
+ ├── energy_benchmark/ # Raw energy measurement CSVs
470
+ │ └── hanoi_cpython.csv
471
+ ├── time_benchmark/ # Raw time measurement CSVs
472
+ │ └── hanoi_cpython.csv
473
+ ├── cpython/ # Aggregated results per method
474
+ │ ├── energy_aggregated.csv
475
+ │ └── time_aggregated.csv
476
+ ├── energy_combined.csv # Combined energy across all methods
477
+ ├── time_combined.csv # Combined time across all methods
478
+ ├── carbon_footprint.csv # Carbon emissions per method
479
+ └── GreenScore.csv # Final sustainability ranking
480
+ ```
481
+
482
+ ### Interpreting GreenScore.csv
483
+
484
+ The `GreenScore.csv` file contains the final sustainability rankings. You can open it in any spreadsheet application or analyze it with pandas:
485
+
486
+ ```python
487
+ import pandas as pd
488
+ df = pd.read_csv('results/GreenScore.csv')
489
+ print(df.sort_values('green_score'))
490
+ ```
491
+
492
+ **Lower GreenScore = better sustainability**. The file includes normalized energy, carbon, and time metrics along with the composite GreenScore for each execution method.
493
+
494
+ ## Research Context
495
+
496
+ This tool was developed as part of the research study: **"Python Under the Microscope: A Comparative Energy Analysis of Execution Methods"** (IEEE Access, 2025).
497
+
498
+ ### Research Objectives
499
+
500
+ 1. **Energy & Environmental Profiling**: Quantitatively compare execution time, energy consumption, and CO₂ emissions across Python execution methods.
501
+ 2. **Sustainable Runtime Selection**: Identify the most eco-friendly execution strategy for Python workloads.
502
+ 3. **Benchmark-Driven Insights**: Establish a reproducible, algorithmically diverse benchmark suite reflective of real-world Python usage.
503
+
504
+ ### Methodology
505
+
506
+ - **15 diverse CPU-bound algorithms** (10 from Computer Language Benchmarks Game + 5 supplementary)
507
+ - **5 execution methods** with identical algorithm implementations
508
+ - **50 runs per combination** for statistical significance
509
+ - **Hardware-first, cross-platform energy measurement**: `pyRAPL` on Linux x86_64, then `codecarbon`, then CPU-time/TDP fallback
510
+
511
+ ## Citation
512
+
513
+ If you use this work in your research, please cite:
514
+
515
+ ```bibtex
516
+ @article{shadab2025microscope,
517
+ title = {Python Under the Microscope: A Comparative Energy Analysis of Execution Methods},
518
+ author = {Turja, Md Fatin Shadab and Others},
519
+ journal = {IEEE Access},
520
+ year = {2025}
521
+ }
522
+ ```
523
+
524
+ ## Additional Documentation
525
+
526
+ ### Audit documentation suite (`/audit`)
527
+
528
+ The **audit** folder contains structured documentation for users and contributors, produced from the project’s architecture and testing audits:
529
+
530
+ | Document | Purpose |
531
+ |----------|---------|
532
+ | **[audit/usage_guide.md](audit/usage_guide.md)** | **Start here.** Step-by-step installation (CPython, PyPy, C compiler), the "Golden Path" CLI examples, hardware setup (Linux RAPL / cap_sys_rawio), and ToolPaths configuration (CLI, .env, environment variables). Run count and **PGSI_RUNS** are explained. |
533
+ | **[audit/contributor_guide.md](audit/contributor_guide.md)** | Adding a new benchmark (folder structure, main.py decorators, registry entry), running pytest and interpreting platform-specific failures, and data contracts (required CSV columns). |
534
+ | **[audit/functional_overview.md](audit/functional_overview.md)** | What the package does, user-facing features, main vs helper logic, and entry points. |
535
+ | **[audit/architecture.md](audit/architecture.md)** | Process boundaries, data pipeline, internal CSV contracts, error propagation, ToolPaths, and Spike #4 design (PGSI_RUNS, RAPL permissions). |
536
+ | **[audit/testing_and_health.md](audit/testing_and_health.md)** | Test inventory, coverage map, failure handling, known limitations, and green/red status. |
537
+ | **[audit/spike_4_runs_and_permissions.md](audit/spike_4_runs_and_permissions.md)** | Design for deterministic run control (PGSI_RUNS) and RAPL permission feedback. |
538
+
539
+ A new developer can set up the environment and run a standard benchmark using **usage_guide.md** alone; contributors adding benchmarks or running tests should use **contributor_guide.md** and the architecture/testing docs as needed.
540
+
541
+ ### Other docs
542
+
543
+ - **[Getting Started Guide](docs/getting_started.md)** (if present): Step-by-step setup and validation
544
+ - **[Implementation Summary](IMPLEMENTATION_SUMMARY.md)** (if present): Technical architecture details
545
+
546
+ ## License
547
+
548
+ MIT License - see [LICENSE](LICENSE) file for details.
549
+
550
+ ## Contributing
551
+
552
+ This research was conducted as part of **EEE 4261 (Green Computing)** offered at United International University in Spring 2025. All code, data, and visualization tools are released for reproducibility and open sustainability research.