Skip to content

Add opt-in scope-profiler regions - #36

Merged
max-models merged 1 commit into
develfrom
opt-in-profiling
Oct 22, 2026
Merged

max-models merged 1 commit into
develfrom
opt-in-profiling

Conversation

@max-models

Copy link
Copy Markdown
Owner

Opt-in scope-profiler regions, as in plasmacoll, wellbalanced and patchwork, so new packages start with them:

  • src/app/_profiling.py with the package's tag (template_python), registered on import in __init__.py; main() is an example region (template_python.main). Off unless the application enables the tag (scope_profiler.setup(enable_tags=["template_python"])).
  • test_profiling.py: regions off by default, recorded with the tag or *.
  • setup_project.sh renames the from app._profiling import lines; the tag and region names follow the existing template_python replacement.
  • scope-profiler>=0.7.5 dependency (devel branch in [tool.uv.sources]), quickstart section, changelog.

Tests: 21 passed; ruff, ruff format and pyright clean. bash setup_project.sh beamtracer on a copy gives the tag beamtracer, the region beamtracer.main and 21 passing tests.

@max-models
max-models merged commit bd81e2d into devel Oct 22, 2026
15 checks passed
@max-models
max-models deleted the opt-in-profiling branch October 22, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant