Summary
In src/sampleworks/utils/imports.py, the require_protpardelle decorator factory (added around lines 187-230) only supports the parenthesized form @require_protpardelle("message"). When used as a bare decorator, @require_protpardelle, the decorated function object is passed in as the message argument instead of being wrapped, so the function is never actually wrapped/protected. The docstring's first example (@require_protpardelle) is therefore misleading and does not work as documented.
Rationale
The same pattern is used for the other require_* decorators (require_boltz, require_protenix, require_rf3) in the same file, so they likely share this issue, but this report focuses on require_protpardelle per the originating review comment.
Affected area
- File:
src/sampleworks/utils/imports.py
- Function:
require_protpardelle (and docstring examples)
Suggested fix
Either:
- Update
require_protpardelle to detect when the first positional argument is a callable (bare decorator usage) vs. a string message, and branch accordingly to support both @require_protpardelle and @require_protpardelle("message"), or
- Remove/correct the bare-decorator example in the docstring so only the parenthesized form
@require_protpardelle() is documented/supported.
Acceptance criteria
References
Summary
In
src/sampleworks/utils/imports.py, therequire_protpardelledecorator factory (added around lines 187-230) only supports the parenthesized form@require_protpardelle("message"). When used as a bare decorator,@require_protpardelle, the decorated function object is passed in as themessageargument instead of being wrapped, so the function is never actually wrapped/protected. The docstring's first example (@require_protpardelle) is therefore misleading and does not work as documented.Rationale
The same pattern is used for the other
require_*decorators (require_boltz,require_protenix,require_rf3) in the same file, so they likely share this issue, but this report focuses onrequire_protpardelleper the originating review comment.Affected area
src/sampleworks/utils/imports.pyrequire_protpardelle(and docstring examples)Suggested fix
Either:
require_protpardelleto detect when the first positional argument is a callable (bare decorator usage) vs. a string message, and branch accordingly to support both@require_protpardelleand@require_protpardelle("message"), or@require_protpardelle()is documented/supported.Acceptance criteria
require_protpardelleworks correctly when used as@require_protpardelle(bare) or docstring is updated to remove that example.require_protpardelle("custom message")continues to work as before.References