uw-ssec / codeuw

Repository of resources and tasks for contributing to scientific software projects
4 stars 4 forks source link

[Code UW]: NoisePy - Replace print statements with logging in noise_module.py #14

Closed carlosgjs closed 1 year ago

carlosgjs commented 1 year ago

Contact

carlosg@uw.edu

Description

The src/noisepy/seis/noise_module.py module uses print() statements for logging, which is less than ideal. A better alternative is to use python's standard logging package.

This change has already been done in `src/noisepy/seis/S1_fft_cc_MPI.py, which can be used as a reference.

Steps:

  1. Create a logger instance at the top of the file: logger = logging.getLogger(__name__)
  2. Replace all print() calls with calls to logger.info(), logger.debug(), logger.error() or logger.warning(). Use your best judgement from the code context to decide the type of logging. We can also discuss during the pull request review.

Code Repository

https://github.com/mdenolle/NoisePy

Issue link

No response

Task level

L1

What is the primary programming language for the task

python

Additional dependencies

No response

nrich20 commented 1 year ago

This task has been completed