codecarbon monitor prints a "Saved to" path that ignores output_dir
Los mantenedores suelen responder en 2 días
@davidberenstein1957 ya está trabajando en esto.
Desde el 12/8/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Comienza en codecarbon/cli/monitor.py:119-125 y sigue la configuración de output_file y output_dir hasta codecarbon/output_methods/file.py:49-52. Reproduce el comando monitor con CODECARBON_OUTPUT_DIR establecido y verifica después que el informe muestre la ruta real del CSV y omita la ruta cuando la salida CSV esté deshabilitada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The post-run report printed by codecarbon monitor -- <cmd> resolves the emissions file path from the file name only, so whenever output_dir is not the current working directory the CLI tells the user to look in the wrong place.
Reproduction
cd /home/user
CODECARBON_OUTPUT_DIR=/var/log/codecarbon codecarbon monitor -- ./train.sh
Prints:
Saved to: /home/user/emissions.csv
while the CSV was actually written to /var/log/codecarbon/emissions.csv. Same happens with output_dir set in .codecarbon.config.
Root cause
codecarbon/cli/monitor.py:119-125 uses tracker._conf["output_file"] and calls os.path.abspath() on it. But output_file is only the basename (default "emissions.csv", codecarbon/emissions_tracker.py:567); the directory lives in a separate key output_dir (emissions_tracker.py:566). The two are joined only inside FileOutput (codecarbon/output_methods/file.py:49). os.path.abspath therefore resolves the bare name against the CWD, which is correct only for the default output_dir=".".
FileOutput does log the correct absolute path at construction (output_methods/file.py:50-52), but the CLI defaults to log_level="error" (cli/main.py, forwarded at cli/monitor.py:54), so that INFO line is suppressed and the wrong path is the only thing the user sees.
Expected vs actual
- Expected: the report shows the path the CSV was actually written to (and shows nothing when CSV output is disabled).
- Actual:
<cwd>/emissions.csv, unconditionally, even when no file output handler exists.
Display-only defect; measurement and file writing are unaffected.
- Lenguaje dominante
- Python
- Estrellas
- 1.9k
- Forks
- 341
- Merge medio
- 3 d 51 min
- PR fusionados (30 d)
- 16
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mlco2/codecarbon
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
mlco2/codecarbon#1460 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
mlco2/codecarbon#1456 ·
Los mantenedores suelen responder en 2 días
-
count_cpus() and RAM crash with FileNotFoundError when SLURM_JOB_ID is set but scontrol is missingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
mlco2/codecarbon#1455 ·
Los mantenedores suelen responder en 2 días
-
CLI: get_config() returns None without [codecarbon] section; get_api_endpoint() appends api_endpoint under wrong sectionPosiblemente ocupada @sohammishra864-wq la tomó hace 26 días. Abierto
Dificultad 2/5 Medio día Aptitud para principiantes 82/100
mlco2/codecarbon#1432 ·
Los mantenedores suelen responder en 2 días
-
Update the screen shot of the dashboardPosiblemente ocupada @aarthis81 la tomó hace 22 días. Abiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mlco2/codecarbon#1423 · 5 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de mlco2/codecarbon
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
NVIDIA/flare-local-inference#90 ·
Los mantenedores suelen responder en 1 día
-
area/streaming comp/gateway P2 platform/telegram type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#144897 ·
Los mantenedores suelen responder en 1 día
-
request-theme
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
LizardByte/ThemerrDB#9575 ·
Los mantenedores suelen responder en 1 día
-
Author Page: noshin-nawalAbiertoauthor-page correction
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
acl-org/acl-anthology#10599 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zilliztech/memsearch#818 ·
Los mantenedores suelen responder en 1 día