scope-profiler 0.7.4__tar.gz → 0.7.5__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 (186) hide show
  1. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/CMakeLists.txt +1 -1
  2. {scope_profiler-0.7.4/src/scope_profiler.egg-info → scope_profiler-0.7.5}/PKG-INFO +2 -2
  3. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/pyproject.toml +2 -2
  4. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/__init__.py +13 -6
  5. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/h5reader.py +4 -1
  6. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/profile_manager.py +88 -17
  7. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/region_profiler.py +14 -0
  8. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_opt_in_tags.py +69 -0
  9. {scope_profiler-0.7.4 → scope_profiler-0.7.5/src/scope_profiler.egg-info}/PKG-INFO +2 -2
  10. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler.egg-info/requires.txt +1 -1
  11. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/LICENSE.txt +0 -0
  12. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/MANIFEST.in +0 -0
  13. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/README.md +0 -0
  14. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/cmake/scope-profilerConfig.cmake.in +0 -0
  15. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/cmake/CMakeLists.txt +0 -0
  16. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/cmake/main.cpp +0 -0
  17. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/cmake/mpi.cpp +0 -0
  18. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/cmake/native.c +0 -0
  19. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/ex_mpi_numpy_wrappers.py +0 -0
  20. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/ex_mpi_profiling_options.py +0 -0
  21. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/examples/ex_mpi_wrappers.py +0 -0
  22. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/setup.cfg +0 -0
  23. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/__main__.py +0 -0
  24. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/_assets/__init__.py +0 -0
  25. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/_assets/scope-profiler-plotly-0.2.0.js +0 -0
  26. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/astro_site.py +0 -0
  27. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/benchmark.py +0 -0
  28. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/Makefile +0 -0
  29. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/example.c +0 -0
  30. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/scope_profiler.c +0 -0
  31. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/scope_profiler.h +0 -0
  32. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/scope_profiler.hpp +0 -0
  33. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/scope_profiler_hdf5.h +0 -0
  34. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/scope_profiler_impl.h +0 -0
  35. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/c/scope_profiler_mpi.hpp +0 -0
  36. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/call_stack.py +0 -0
  37. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/catalogue.py +0 -0
  38. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/chrome_trace_export.py +0 -0
  39. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/concurrency.py +0 -0
  40. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/diff.py +0 -0
  41. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/fortran/Makefile +0 -0
  42. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/fortran/example.f90 +0 -0
  43. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/fortran/scope_profiler.f90 +0 -0
  44. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/gpu_timing.py +0 -0
  45. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/h5schema.py +0 -0
  46. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/h5writer.py +0 -0
  47. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/html_report.py +0 -0
  48. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/inspection.py +0 -0
  49. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/ipython_magics.py +0 -0
  50. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/json_export.py +0 -0
  51. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/likwid_data.py +0 -0
  52. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/line_profile_cli.py +0 -0
  53. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mcp_server/__init__.py +0 -0
  54. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mcp_server/__main__.py +0 -0
  55. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mcp_server/server.py +0 -0
  56. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mcp_server/tools.py +0 -0
  57. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/memray.py +0 -0
  58. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/metadata.py +0 -0
  59. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mpi_launch.py +0 -0
  60. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mpi_region.py +0 -0
  61. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/mpi_wrappers.py +0 -0
  62. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/native_samples.py +0 -0
  63. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/native_trace.py +0 -0
  64. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/perf_events.py +0 -0
  65. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/__init__.py +0 -0
  66. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/_utils.py +0 -0
  67. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/callgraph.py +0 -0
  68. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/duration_timeseries.py +0 -0
  69. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/durations.py +0 -0
  70. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/flame.py +0 -0
  71. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/gantt.py +0 -0
  72. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/heatmap.py +0 -0
  73. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/histogram.py +0 -0
  74. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/imbalance.py +0 -0
  75. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/likwid.py +0 -0
  76. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/perf_events.py +0 -0
  77. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/roofline.py +0 -0
  78. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/scaling.py +0 -0
  79. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/statistics.py +0 -0
  80. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/plotting_scripts/timeline.py +0 -0
  81. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/post_processing.py +0 -0
  82. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/prof_export.py +0 -0
  83. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/profile_config.py +0 -0
  84. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/profile_io.py +0 -0
  85. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/py.typed +0 -0
  86. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/pytest_plugin.py +0 -0
  87. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/region.py +0 -0
  88. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/report_data.py +0 -0
  89. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/report_model.py +0 -0
  90. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/results.py +0 -0
  91. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/speedscope_export.py +0 -0
  92. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/summary.py +0 -0
  93. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/__init__.py +0 -0
  94. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/check_mpi_launch.py +0 -0
  95. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/check_parallel_hdf5.py +0 -0
  96. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/conftest.py +0 -0
  97. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/examples.py +0 -0
  98. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/examples_pylikwid.py +0 -0
  99. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/README.md +0 -0
  100. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/hdf5-schema-1.h5.gz.b64 +0 -0
  101. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/hdf5-schema-2.h5.gz.b64 +0 -0
  102. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/hdf5-schema-3.h5.gz.b64 +0 -0
  103. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/json-v1.json +0 -0
  104. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/native-v1.spt.b64 +0 -0
  105. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/fixtures/compatibility/native-v2.spt.b64 +0 -0
  106. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/pylikwid_readme.py +0 -0
  107. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/report_profiles.py +0 -0
  108. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_aggregation.py +0 -0
  109. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_api_shortcuts.py +0 -0
  110. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_app.py +0 -0
  111. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_astro_site.py +0 -0
  112. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_async_profiling.py +0 -0
  113. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_benchmark.py +0 -0
  114. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_buffer_growth.py +0 -0
  115. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_c_api.py +0 -0
  116. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_c_hdf5_output.py +0 -0
  117. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_chrome_trace_export.py +0 -0
  118. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_compatibility_fixtures.py +0 -0
  119. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_diff.py +0 -0
  120. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_documented_formats.py +0 -0
  121. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_fortran_api.py +0 -0
  122. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_html_report.py +0 -0
  123. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_in_memory_results.py +0 -0
  124. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_inspection.py +0 -0
  125. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_ipython_magics.py +0 -0
  126. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_json_export.py +0 -0
  127. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_label.py +0 -0
  128. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_likwid_data.py +0 -0
  129. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_line_profile_cli.py +0 -0
  130. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_main_cli.py +0 -0
  131. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_mcp_server.py +0 -0
  132. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_mcp_tools.py +0 -0
  133. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_memray.py +0 -0
  134. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_metadata.py +0 -0
  135. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_mixed_language.py +0 -0
  136. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_mpi.py +0 -0
  137. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_multiple_sessions.py +0 -0
  138. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_multiprocessing.py +0 -0
  139. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_native_samples.py +0 -0
  140. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_output_size.py +0 -0
  141. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_overhead.py +0 -0
  142. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_overhead_io.py +0 -0
  143. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_perf_events.py +0 -0
  144. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_post_processing.py +0 -0
  145. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_prof_export.py +0 -0
  146. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_profile_config_toml.py +0 -0
  147. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_profiling_options.py +0 -0
  148. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_pytest_plugin.py +0 -0
  149. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_readme.py +0 -0
  150. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_region_source.py +0 -0
  151. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_repeated_finalize.py +0 -0
  152. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_report_model.py +0 -0
  153. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_report_performance.py +0 -0
  154. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_results_api.py +0 -0
  155. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_set_version.py +0 -0
  156. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_speedscope_export.py +0 -0
  157. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_storage_size.py +0 -0
  158. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_summary_likwid.py +0 -0
  159. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_threading.py +0 -0
  160. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/test_tui.py +0 -0
  161. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/__init__.py +0 -0
  162. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_call_stack.py +0 -0
  163. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_call_stack_properties.py +0 -0
  164. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_callgraph_plot.py +0 -0
  165. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_concurrency.py +0 -0
  166. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_gpu_summary.py +0 -0
  167. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_gpu_timing.py +0 -0
  168. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_h5_failure_paths.py +0 -0
  169. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_h5_roundtrip.py +0 -0
  170. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_h5writer.py +0 -0
  171. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_lazy_config.py +0 -0
  172. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_likwid_child_env.py +0 -0
  173. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_merge_results.py +0 -0
  174. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_mpi_launch.py +0 -0
  175. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_mpi_wrappers.py +0 -0
  176. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_native_hdf5_inputs.py +0 -0
  177. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_native_trace_versions.py +0 -0
  178. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_payload_collection.py +0 -0
  179. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_recursive_tracer.py +0 -0
  180. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_region_variants.py +0 -0
  181. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tests/unit/test_summary_rendering.py +0 -0
  182. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler/tui.py +0 -0
  183. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler.egg-info/SOURCES.txt +0 -0
  184. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler.egg-info/dependency_links.txt +0 -0
  185. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler.egg-info/entry_points.txt +0 -0
  186. {scope_profiler-0.7.4 → scope_profiler-0.7.5}/src/scope_profiler.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  cmake_minimum_required(VERSION 3.15)
2
2
 
3
- project(scope-profiler VERSION 0.7.4 LANGUAGES C CXX)
3
+ project(scope-profiler VERSION 0.7.5 LANGUAGES C CXX)
4
4
 
5
5
  include(GNUInstallDirs)
6
6
  include(CMakePackageConfigHelpers)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scope-profiler
3
- Version: 0.7.4
3
+ Version: 0.7.5
4
4
  Summary: Profile code regions in python, optionally with LIKWID markers.
5
5
  Author: Max
6
6
  License-Expression: MIT
@@ -46,7 +46,7 @@ Requires-Dist: flameprof; extra == "pproc"
46
46
  Requires-Dist: ipykernel; extra == "pproc"
47
47
  Requires-Dist: jupyterlab; extra == "pproc"
48
48
  Requires-Dist: matplotlib; extra == "pproc"
49
- Requires-Dist: maxplotlibx==0.1.9; extra == "pproc"
49
+ Requires-Dist: maxplotlibx>=0.1.9; extra == "pproc"
50
50
  Requires-Dist: pandas; extra == "pproc"
51
51
  Requires-Dist: plotly; extra == "pproc"
52
52
  Requires-Dist: pyarrow; extra == "pproc"
@@ -5,7 +5,7 @@ requires = [ "setuptools", "wheel" ]
5
5
 
6
6
  [project]
7
7
  name = "scope-profiler"
8
- version = "0.7.4"
8
+ version = "0.7.5"
9
9
  description = "Profile code regions in python, optionally with LIKWID markers."
10
10
  readme = "README.md"
11
11
  keywords = [ "python" ]
@@ -77,7 +77,7 @@ optional-dependencies.pproc = [
77
77
  "ipykernel",
78
78
  "jupyterlab",
79
79
  "matplotlib",
80
- "maxplotlibx == 0.1.9",
80
+ "maxplotlibx >= 0.1.9",
81
81
  "pandas",
82
82
  "plotly",
83
83
  "pyarrow",
@@ -1,6 +1,5 @@
1
1
  """scope-profiler: lightweight region-based profiling for Python and HPC applications."""
2
2
 
3
- from importlib.metadata import PackageNotFoundError, version
4
3
  from typing import TYPE_CHECKING, Any
5
4
 
6
5
  from scope_profiler.call_stack import (
@@ -79,21 +78,19 @@ region_factory = ProfileManager.region_factory
79
78
  recorded_regions = ProfileManager.recorded_regions
80
79
  region = ProfileManager.region
81
80
  register_opt_in_tag = ProfileManager.register_opt_in_tag
81
+ reset = ProfileManager.reset
82
82
  registered_regions = ProfileManager.registered_regions
83
83
  session = ProfileManager.session
84
84
  setup = ProfileManager.setup
85
85
  setup_from_env = ProfileManager.setup_from_env
86
86
  run = ProfileManager.run
87
87
 
88
- try:
89
- __version__ = version("scope-profiler")
90
- except PackageNotFoundError:
91
- __version__ = "unknown"
92
-
93
88
  # Keep these imports visible to language servers without importing the optional
94
89
  # plotting/reporting dependencies at runtime. Dynamic module attributes are
95
90
  # otherwise invisible to hover, completion, and static type checkers.
96
91
  if TYPE_CHECKING:
92
+ __version__: str
93
+
97
94
  from scope_profiler.chrome_trace_export import export_chrome_trace
98
95
  from scope_profiler.html_report import create_html_report
99
96
  from scope_profiler.inspection import collect_file_metadata, inspect_file
@@ -200,6 +197,7 @@ __all__ = [
200
197
  "region_factory",
201
198
  "register_opt_in_tag",
202
199
  "registered_regions",
200
+ "reset",
203
201
  "run",
204
202
  "session",
205
203
  "setup",
@@ -214,6 +212,15 @@ __all__ = [
214
212
 
215
213
  def __getattr__(name: str) -> Any:
216
214
  """Load optional top-level helpers only when they are first used."""
215
+ if name == "__version__":
216
+ # Looked up on first use: importlib.metadata is about half the cost of
217
+ # ``import scope_profiler`` on top of NumPy.
218
+ from importlib.metadata import PackageNotFoundError, version
219
+
220
+ try:
221
+ return version("scope-profiler")
222
+ except PackageNotFoundError:
223
+ return "unknown"
217
224
  if name in {
218
225
  "collect_region_statistics",
219
226
  "collect_roofline_points",
@@ -12,7 +12,6 @@ import json
12
12
  from copy import copy
13
13
  from pathlib import Path
14
14
 
15
- import h5py
16
15
  import numpy as np
17
16
 
18
17
  from scope_profiler.h5schema import HDF5SchemaError, migrate_schema, read_schema_version
@@ -39,6 +38,10 @@ class CorruptProfileError(OSError):
39
38
 
40
39
  def _open_h5(file_path):
41
40
  """Open a profiling file, reporting an unreadable one in context."""
41
+ # Imported here, not at module level: ``import scope_profiler`` (and so
42
+ # every library that ships regions) should not pay for h5py up front.
43
+ import h5py
44
+
42
45
  try:
43
46
  return h5py.File(file_path, "r")
44
47
  except OSError as exc:
@@ -13,13 +13,13 @@ import sys
13
13
  import sysconfig
14
14
  import threading
15
15
  import warnings
16
- from collections.abc import Callable
16
+ from collections.abc import Callable, Iterable
17
17
  from contextlib import ContextDecorator, contextmanager
18
18
  from contextvars import ContextVar
19
19
  from enum import Enum, auto
20
20
  from time import perf_counter_ns
21
21
  from types import FrameType
22
- from typing import TYPE_CHECKING, ClassVar, NamedTuple
22
+ from typing import TYPE_CHECKING, ClassVar, NamedTuple, ParamSpec, TypeVar, overload
23
23
 
24
24
  import numpy as np
25
25
 
@@ -63,6 +63,8 @@ if TYPE_CHECKING: # imported lazily in read_results() to keep imports cheap
63
63
  _PAYLOAD_TAG = 0x5C09
64
64
  _WRITE_TOKEN_TAG = 0x5C0A
65
65
  _UNSET = object()
66
+ _P = ParamSpec("_P")
67
+ _R = TypeVar("_R")
66
68
 
67
69
  # Tags registered with register_opt_in_tag(). Libraries register them at
68
70
  # import time, so this outlives every setup() and reset, and is shared by all
@@ -697,13 +699,29 @@ class ProfileManager:
697
699
  ``"*"`` enables every opt-in tag. Listing the tag in ``region_tags``
698
700
  enables it too.
699
701
 
700
- A disabled decorated function is left unwrapped, so instrumentation
701
- that is off costs nothing per call.
702
+ Regions and decorated functions that already exist pick the change up,
703
+ so the call may come after the library's own imports.
704
+
705
+ Instrumentation that is off costs one extra Python call (roughly
706
+ 0.1-0.3 µs per call), so keep it to operations that take microseconds
707
+ or more.
702
708
  """
703
709
  for tag in tags:
704
710
  if not isinstance(tag, str) or not tag:
705
711
  raise TypeError(f"opt-in tags must be non-empty strings, got {tag!r}")
706
- _OPT_IN_TAGS.update(tags)
712
+ new = set(tags) - _OPT_IN_TAGS
713
+ _OPT_IN_TAGS.update(new)
714
+ if new and cls._configured:
715
+ cls._rebind_tagged(new)
716
+
717
+ @classmethod
718
+ def _rebind_tagged(cls, tags) -> None:
719
+ """Re-resolve the existing regions and decorators that carry ``tags``."""
720
+ for name in [n for n, r in cls._regions.items() if tags.intersection(r.tags)]:
721
+ del cls._regions[name]
722
+ for name, func, _bound, region_tags in cls._decorated_functions():
723
+ if region_tags and tags.intersection(region_tags):
724
+ cls._bind_decorated_region(name, func, _bound, region_tags)
707
725
 
708
726
  #: Original name for :meth:`region`, kept so existing instrumentation
709
727
  #: keeps working unchanged. Same object, not a forwarding wrapper: this
@@ -934,8 +952,21 @@ class ProfileManager:
934
952
  )
935
953
  _bound[0] = region
936
954
  _bound[1] = region.wrap(func)
955
+ _bound[2] = isinstance(region, DisabledProfileRegion)
937
956
  return region
938
957
 
958
+ @classmethod
959
+ def _decorated_functions(cls):
960
+ """Yield ``(name, func, _bound, tags)`` for every @profile wrapper."""
961
+ for name, entries in cls._decorators.items():
962
+ for entry in entries:
963
+ yield (name, *entry)
964
+
965
+ @overload
966
+ @classmethod
967
+ def profile(cls, region_name: Callable[_P, _R]) -> Callable[_P, _R]: ...
968
+
969
+ @overload
939
970
  @classmethod
940
971
  def profile(
941
972
  cls,
@@ -943,8 +974,18 @@ class ProfileManager:
943
974
  recursive: bool | None = None,
944
975
  metadata=None,
945
976
  record_outcome: bool = False,
977
+ tags: Iterable[str] | None = None,
978
+ ) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
979
+
980
+ @classmethod
981
+ def profile(
982
+ cls,
983
+ region_name=None,
984
+ recursive=None,
985
+ metadata=None,
986
+ record_outcome=False,
946
987
  tags=None,
947
- ) -> Callable:
988
+ ):
948
989
  """
949
990
  Decorator factory for profiling a function.
950
991
 
@@ -979,7 +1020,10 @@ class ProfileManager:
979
1020
  ``ProfileManager.setup()`` after decoration re-binds the wrapper to
980
1021
  the new region class at zero per-call cost. This means
981
1022
  ``@ProfileManager.profile`` can be applied at class-definition time
982
- even when ``setup()`` is called later.
1023
+ even when ``setup()`` is called later. While its region is disabled
1024
+ (before ``setup()``, or behind an opt-in tag that is off) the wrapper
1025
+ calls the function directly, skipping ``metadata`` and recursive
1026
+ tracing.
983
1027
  """
984
1028
 
985
1029
  region_tags = None if tags is None else tuple(tags)
@@ -989,7 +1033,7 @@ class ProfileManager:
989
1033
  # _bound[1] is the inner callable produced by region.wrap(func).
990
1034
  # It is replaced (without touching the outer wrapper) whenever
991
1035
  # set_config() is called, so there is no per-call rebind check.
992
- _bound = [None, None] # [region, wrapped_func]
1036
+ _bound = [None, func, True] # [region, wrapped_func, disabled]
993
1037
  recursive_override = recursive
994
1038
 
995
1039
  def invoke(*args, **kwargs):
@@ -1024,11 +1068,10 @@ class ProfileManager:
1024
1068
  cls._bind_decorated_region(name, func, _bound, region_tags)
1025
1069
  cls._decorated_codes.add(func.__code__)
1026
1070
 
1027
- # Register so set_config() can rebind without a per-call check.
1028
- cls._decorators.setdefault(name, []).append((func, _bound, region_tags))
1029
-
1030
1071
  @functools.wraps(func)
1031
1072
  def wrapper(*args, **kwargs):
1073
+ if _bound[2]:
1074
+ return _bound[1](*args, **kwargs)
1032
1075
  recursive_enabled = cls._config.recursive_profile
1033
1076
  if recursive_override is not None:
1034
1077
  recursive_enabled = recursive_override
@@ -1057,6 +1100,8 @@ class ProfileManager:
1057
1100
  sys.setprofile(prev_profiler)
1058
1101
  state.depth -= 1
1059
1102
 
1103
+ # Register so set_config() can rebind without a per-call check.
1104
+ cls._decorators.setdefault(name, []).append((func, _bound, region_tags))
1060
1105
  return wrapper
1061
1106
 
1062
1107
  # Support @ProfileManager.profile without parentheses
@@ -2461,6 +2506,13 @@ class ProfileManager:
2461
2506
  if cls._configured:
2462
2507
  cls.finalize()
2463
2508
 
2509
+ if not cls._config.deactivate_file_output:
2510
+ # The hook writes HDF5 at exit, and h5py must not be imported for
2511
+ # the first time during interpreter shutdown (it crashes). Importing
2512
+ # it now also registers its own exit hook before ours, so ours runs
2513
+ # first.
2514
+ import h5py # noqa: F401
2515
+
2464
2516
  cls._auto_finalize_callback = finalize_at_exit
2465
2517
  atexit.register(finalize_at_exit)
2466
2518
 
@@ -2856,9 +2908,8 @@ class ProfileManager:
2856
2908
  cls._update_region_cls() # Set the proper region class
2857
2909
  # Rebind all registered decorator wrappers to the new region class.
2858
2910
  # This is the only place rebinding happens — there is no per-call check.
2859
- for name, entries in cls._decorators.items():
2860
- for func, _bound, tags in entries:
2861
- cls._bind_decorated_region(name, func, _bound, tags)
2911
+ for name, func, _bound, tags in cls._decorated_functions():
2912
+ cls._bind_decorated_region(name, func, _bound, tags)
2862
2913
  for name, (functions, tags) in cls._region_definitions.items():
2863
2914
  cls.region(name, functions=functions, tags=tags)
2864
2915
 
@@ -2922,11 +2973,31 @@ class ProfileManager:
2922
2973
  cls._lifecycle_state = _LifecycleState.INACTIVE
2923
2974
 
2924
2975
  @classmethod
2925
- def _reset(cls) -> None:
2976
+ def reset(cls) -> None:
2977
+ """Forget the configuration and everything recorded; keep the instrumentation.
2978
+
2979
+ Leaves the manager as importing the instrumented code does: not
2980
+ configured, every region disabled until the next :meth:`setup`.
2981
+ Decorated functions and :meth:`define_region` definitions stay
2982
+ registered, and decorated functions call straight through until then.
2983
+ Meant for test suites that profile in more than one test::
2984
+
2985
+ @pytest.fixture(autouse=True)
2986
+ def _fresh_profiler():
2987
+ sp.reset()
2988
+ yield
2989
+ sp.reset()
2990
+ """
2926
2991
  cls._reset_regions()
2927
2992
  cls._reset_config()
2928
- # Back to the state a fresh import leaves behind: no configuration,
2929
- # and regions disabled until setup() or get_config() says otherwise.
2930
2993
  cls._region_cls = DisabledProfileRegion
2994
+ for _name, func, _bound, _tags in cls._decorated_functions():
2995
+ _bound[:] = [None, func, True]
2996
+
2997
+ @classmethod
2998
+ def _reset(cls) -> None:
2999
+ # reset(), and forget every decorator and definition too, so that no
3000
+ # test of scope-profiler itself sees another test's instrumentation.
3001
+ cls.reset()
2931
3002
  cls._decorators.clear()
2932
3003
  cls._region_definitions.clear()
@@ -7,6 +7,7 @@ import linecache
7
7
  import threading
8
8
  import types
9
9
  from time import perf_counter_ns
10
+ from typing import TYPE_CHECKING
10
11
 
11
12
  import numpy as np
12
13
 
@@ -15,6 +16,9 @@ from scope_profiler.gpu_timing import resolve_gpu_timing_backend
15
16
  from scope_profiler.perf_events import PerfEventGroup, PerfEventTotals
16
17
  from scope_profiler.profile_config import ProfilingConfig
17
18
 
19
+ if TYPE_CHECKING:
20
+ from typing_extensions import Self # typing.Self needs Python 3.11
21
+
18
22
  # Parsed module ASTs, memoized by filename. Capturing a region's source only
19
23
  # runs once per region name (see BaseProfileRegion.set_source), but a file can
20
24
  # define many regions, so the parse itself is cached rather than repeated.
@@ -462,6 +466,16 @@ class BaseProfileRegion:
462
466
 
463
467
  return wrapper
464
468
 
469
+ # Declared here, with their types, so that ``with ProfileManager.region(...)``
470
+ # type-checks; every region class overrides both.
471
+ def __enter__(self) -> "Self":
472
+ """Start timing a ``with`` block."""
473
+ raise NotImplementedError
474
+
475
+ def __exit__(self, exc_type, exc_value, traceback) -> None:
476
+ """Stop timing a ``with`` block."""
477
+ raise NotImplementedError
478
+
465
479
  def append(self, start: float, end: float) -> None:
466
480
  """Append a start/end time pair to the buffer, growing it if needed."""
467
481
 
@@ -1,5 +1,7 @@
1
1
  """Opt-in region tags: library instrumentation that is off unless enabled."""
2
2
 
3
+ import sys
4
+
3
5
  import pytest
4
6
 
5
7
  import scope_profiler as sp
@@ -195,3 +197,70 @@ with sp.region("user.step"):
195
197
 
196
198
  assert set(read_h5(off).region_names) == {"user.step"}
197
199
  assert set(read_h5(on).region_names) == {"mylib.kernel", "user.step"}
200
+
201
+
202
+ def test_reset_keeps_decorated_functions_for_the_next_setup():
203
+ sp.register_opt_in_tag("mylib")
204
+
205
+ @sp.profile("mylib.solve", tags=("mylib",))
206
+ def solve():
207
+ return 1
208
+
209
+ sp.reset()
210
+ assert solve() == 1 # calls straight through while nothing is configured
211
+ ProfileManager.setup(output=None, enable_tags=["mylib"])
212
+ solve()
213
+ results = ProfileManager.finalize(verbose=False, return_results=True)
214
+
215
+ assert results["mylib.solve"].num_calls == 1
216
+
217
+
218
+ def test_private_reset_forgets_decorated_functions():
219
+ @sp.profile("solve")
220
+ def solve():
221
+ pass
222
+
223
+ ProfileManager._reset()
224
+ ProfileManager.setup(output=None)
225
+
226
+ assert "solve" not in sp.registered_regions()
227
+
228
+
229
+ def test_disabled_decorated_function_skips_metadata_and_tracing():
230
+ sp.register_opt_in_tag("mylib")
231
+ metadata_calls = []
232
+ profilers = []
233
+
234
+ def metadata(*args, **kwargs):
235
+ metadata_calls.append(args)
236
+ return {"n": 1}
237
+
238
+ @sp.profile("mylib.solve", tags=("mylib",), metadata=metadata, recursive=True)
239
+ def solve():
240
+ profilers.append(sys.getprofile())
241
+
242
+ before = sys.getprofile()
243
+ ProfileManager.setup(output=None)
244
+ solve()
245
+ ProfileManager.finalize(verbose=False)
246
+
247
+ assert metadata_calls == []
248
+ assert profilers == [before]
249
+
250
+
251
+ def test_registering_a_tag_late_disables_existing_instrumentation():
252
+ @sp.profile("mylib.solve", tags=("mylib",))
253
+ def solve():
254
+ pass
255
+
256
+ ProfileManager.setup(output=None)
257
+ with sp.region("mylib.kernel", tags=("mylib",)):
258
+ pass
259
+ sp.register_opt_in_tag("mylib")
260
+ solve()
261
+ with sp.region("mylib.kernel", tags=("mylib",)):
262
+ pass
263
+ results = ProfileManager.finalize(verbose=False, return_results=True)
264
+
265
+ assert "mylib.solve" not in results.region_names
266
+ assert "mylib.kernel" not in results.region_names
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scope-profiler
3
- Version: 0.7.4
3
+ Version: 0.7.5
4
4
  Summary: Profile code regions in python, optionally with LIKWID markers.
5
5
  Author: Max
6
6
  License-Expression: MIT
@@ -46,7 +46,7 @@ Requires-Dist: flameprof; extra == "pproc"
46
46
  Requires-Dist: ipykernel; extra == "pproc"
47
47
  Requires-Dist: jupyterlab; extra == "pproc"
48
48
  Requires-Dist: matplotlib; extra == "pproc"
49
- Requires-Dist: maxplotlibx==0.1.9; extra == "pproc"
49
+ Requires-Dist: maxplotlibx>=0.1.9; extra == "pproc"
50
50
  Requires-Dist: pandas; extra == "pproc"
51
51
  Requires-Dist: plotly; extra == "pproc"
52
52
  Requires-Dist: pyarrow; extra == "pproc"
@@ -58,7 +58,7 @@ flameprof
58
58
  ipykernel
59
59
  jupyterlab
60
60
  matplotlib
61
- maxplotlibx==0.1.9
61
+ maxplotlibx>=0.1.9
62
62
  pandas
63
63
  plotly
64
64
  pyarrow
File without changes
File without changes