Problem
Several logger calls across the PyASL codebase use f-strings for message formatting:
logger.info(f"Pipeline type: {ptype}")
This is an anti-pattern because the f-string is eagerly evaluated even when the log level is disabled, wasting CPU cycles unnecessarily on string construction.
Expected Behaviour
Logger calls should use lazy %-style formatting, which only evaluates if the message will actually be emitted:
logger.info("Pipeline type: %s", ptype)
Affected Files
| File |
Occurrences |
pyasl/pipelines/run_pipeline.py |
5 |
pyasl/modules/oxford_asl_split_m0.py |
2 |
pyasl/modules/save_outputs.py |
1 |
Total: 8 occurrences
References
I'll open a PR to fix all 8 occurrences.
Problem
Several logger calls across the PyASL codebase use f-strings for message formatting:
This is an anti-pattern because the f-string is eagerly evaluated even when the log level is disabled, wasting CPU cycles unnecessarily on string construction.
Expected Behaviour
Logger calls should use lazy
%-style formatting, which only evaluates if the message will actually be emitted:Affected Files
pyasl/pipelines/run_pipeline.pypyasl/modules/oxford_asl_split_m0.pypyasl/modules/save_outputs.pyTotal: 8 occurrences
References
W1202I'll open a PR to fix all 8 occurrences.