Skip to content

fix(cli): use output_dir when printing Saved to path in monitor - #1409

Open
sohammishra864-wq wants to merge 1 commit into
mlco2:masterfrom
sohammishra864-wq:fix/monitor-saved-to-path-1322
Open

sohammishra864-wq wants to merge 1 commit into
mlco2:masterfrom
sohammishra864-wq:fix/monitor-saved-to-path-1322

Conversation

@sohammishra864-wq

Copy link
Copy Markdown
Contributor

Description

Fix the "Saved to" path printed by codecarbon monitor to include output_dir, not just the bare filename resolved against CWD.

Related Issue

Closes #1322

Motivation and Context

When output_dir is set (via config or env var), the CLI printed <cwd>/emissions.csv instead of <output_dir>/emissions.csv. The actual CSV was written to the correct location by FileOutput, but the user-facing message pointed to the wrong place.

How Has This Been Tested?

  • Ran codecarbon monitor with custom output_dir and verified the printed path matches the actual file locatio

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

AI Usage Disclosure

  • AI-vibecoded
  • AI-generated
  • AI-assisted
  • No AI used

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the docs/how-to/contributing.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sohammishra864-wq
sohammishra864-wq requested a review from a team as a code owner September 7, 2026 19:20
@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.70%. Comparing base (3fcd4dc) to head (955b21b).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
codecarbon/cli/monitor.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1409      +/-   ##
==========================================
+ Coverage   91.68%   91.70%   +0.01%     
==========================================
  Files          49       49              
  Lines        5136     5157      +21     
==========================================
+ Hits         4709     4729      +20     
- Misses        427      428       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codecarbon monitor prints a "Saved to" path that ignores output_dir

1 participant