Skip to content

Replace unconditional print() calls with logging/verbose guards in the public API #36

Description

@dantzert

The public functions emit stdout via print() even when verbose=False, which pollutes library output, notebooks, and pytest capture. Verified empirically: a verbose=False delay_io_train run still emits ~600+ bytes — num_transforms/1, Optimization complete., the full model printout, R^2, and the shape/scale/location factors dump. Similarly lti_from_gamma prints LTI_from_gamma final NSE and WARNING: final eigenvalues... unconditionally.

Spans:

  • modpods/train.py: print("num_transforms"), print(num_transforms), the Optimization complete… / Final model: / R^2 / shape factors / scale factors / location factors dumps.
  • modpods/model.py: print("MAE = …"), RMSE, NSE, alpha, beta, HFV, HFV10, LFV, FDC in the final_run block.
  • modpods/lti.py: print("LTI_from_gamma final NSE"), print(NSE), print("A")/print(A)..., print("Training r2 = …").
  • modpods/topology.py: print("R2 Values:") / print(r2_values), print("R2 Values:") loops, and model.print().

Proposal: route diagnostics through logging (logging.getLogger(__name__)); keep equation dumps (model.print()) and metric prints behind verbose=True; leave only genuine warnings via warnings.warn.

  • Cost: Low–medium (mechanical gating + switch to logging).
  • Benefit: High (clean library UX, testable stdout, notebook/CI friendly; aligns with scikit-learn-style estimator hygiene referenced in follow scikit-learn or similar conventions #17).

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