Skip to content

Replace Print Statements in Library Source Code #558

@mraffly

Description

@mraffly

Purpose of the improvement

This refers to issue 5.2 in the documentation https://iffmd.fz-juelich.de/zXxTrardSNaJc4a22gNypw?view

Following files contain print statements:

  • fine/expansionModules/transformationPath.py
  • fine/expansionModules/optimizeTSAmultiStage.py
  • fine/aggregations/spatialAggregation/grouping.py
  • fine/utils.py
  • fine/IOManagement/dictIO.py
  • fine/IOManagement/standardIO.py
  • fine/IOManagement/xarrayIO.py

Example in fine/IOManagement/dictIO.py

print("Reconstructing timeseries from TSA")

Drawback of using this:

  • Cannot be controlled by users
  • Not integrated with logging framework
  • Clutters output in production use

Proposal

Following things can be done to fix the issue:

  • Replace print statements with proper logging using Python’s logging module
  • Or use the existing utils.output() function with verbosity control

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions