Skip to content

Phase 3: core/decorators/input#139

Merged
teresa-ortega merged 13 commits intonext-genfrom
teresa-ortega/core-decorators-input
Apr 8, 2026
Merged

Phase 3: core/decorators/input#139
teresa-ortega merged 13 commits intonext-genfrom
teresa-ortega/core-decorators-input

Conversation

@teresa-ortega
Copy link
Copy Markdown
Collaborator

@teresa-ortega teresa-ortega commented Mar 26, 2026

Proposed changes

This PR introduces a dynamic input registration system for benchmarks using a functional hook pattern. To keep the core benchmark decorator clean and maintain a strict separation of concerns, the registration logic was extracted into a dedicated InputRegistry. The decorated benchmark function now dynamically exposes an .input method, allowing users to register input hooks.
Additionally, the benchmark context was updated. At runtime, right before the main benchmark executes, these registered hooks are evaluated with the actual context, and their return values are automatically mapped to the context inputs based on the function names.

Type of change

  • 🐛 Bugfix (change which fixes an issue)
  • 🚀 Feature (change which adds functionality)
  • 📚 Documentation (change which fixes or extends documentation)

💥 No breaking changes.

Checklist

Put an x in the boxes that apply. This is simply a reminder of what we will require before merging your code.

  • Lint and unit tests (if any) pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Additional comments

N/A

Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
@teresa-ortega teresa-ortega requested a review from xaru8145 March 26, 2026 13:57
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Copy link
Copy Markdown
Collaborator

@xaru8145 xaru8145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass.

Comment thread src/lambkin/core/decorators/input.py Outdated
Comment thread src/lambkin/core/decorators/benchmark.py Outdated
Comment thread src/lambkin/core/decorators/input.py
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
@teresa-ortega teresa-ortega requested a review from xaru8145 March 27, 2026 15:07
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Copy link
Copy Markdown
Collaborator

@xaru8145 xaru8145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor things to go. The PR is ready for review, you can update the draft state.

Comment thread src/lambkin/core/decorators/input.py Outdated
Comment thread src/lambkin/core/decorators/input.py Outdated
Comment thread src/lambkin/core/decorators/input.py
Comment thread test/core/test_input.py
@teresa-ortega teresa-ortega marked this pull request as ready for review April 7, 2026 11:15
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
@teresa-ortega teresa-ortega requested a review from xaru8145 April 7, 2026 12:02
Copy link
Copy Markdown
Collaborator

@xaru8145 xaru8145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teresa-ortega teresa-ortega merged commit 46ff299 into next-gen Apr 8, 2026
4 checks passed
@teresa-ortega teresa-ortega deleted the teresa-ortega/core-decorators-input branch April 8, 2026 12:31
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.

2 participants