There are 20+ print() statements scattered throughout production code instead of using proper logging.
Examples
- Line 82:
print(f'\nIn calculate statistics XbarS...')
- Line 260:
print(f'\nIn calculate statistics IMR...')
- Line 699:
print(f'\nEntering call to prepare_data...')
- Line 720:
print(f'\nStarting with {starting_count} groups')
Impact
- Unprofessional output
- Can't control verbosity
- Hard to debug in production
- Performance impact
Fix
- Add module-level logger:
logger = logging.getLogger(__name__)
- Replace all
print() with logger.debug() or logger.info()
- Remove debugging output from hot paths
Files
There are 20+
print()statements scattered throughout production code instead of using proper logging.Examples
print(f'\nIn calculate statistics XbarS...')print(f'\nIn calculate statistics IMR...')print(f'\nEntering call to prepare_data...')print(f'\nStarting with {starting_count} groups')Impact
Fix
logger = logging.getLogger(__name__)print()withlogger.debug()orlogger.info()Files
analysis_dataset.py