CLI: get_config() returns None without [codecarbon] section; get_api_endpoint() appends api_endpoint under wrong section
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
codecarbon/cli/cli_utils.py の get_config() と get_api_endpoint() から始め、提案されているとおり get_api_endpoint() と write_local_exp_id() を比較します。issue に記載されているコマンドを使って両方のケースを再現し、[codecarbon] データがない場合でも show_config がクラッシュしなくなっていること、および api_endpoint が重複せず正しいセクションに書き込まれることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Bug 1 — get_config() returns None
If .codecarbon.config exists but has no [codecarbon] section, get_config() implicitly returns None. show_config() then crashes with TypeError: argument of type 'NoneType' is not iterable on "organization_id" not in d.
Repro:
printf "[other]\nkey=value\n" > .codecarbon.config
codecarbon config # or show_config path
Bug 2 — get_api_endpoint() writes to the wrong section
When api_endpoint is missing, the function raw-appends api_endpoint=... to the end of the file. If [codecarbon] isn't the last section, the key ends up under another section, and the next call appends it again.
Repro:
printf "[codecarbon]\nproject_id=abc\n\n[other]\nkey=value\n" > .codecarbon.config
python -c "from pathlib import Path; from codecarbon.cli.cli_utils import get_api_endpoint; get_api_endpoint(Path('.codecarbon.config'))"
cat .codecarbon.config # api_endpoint is under [other]
Proposed fix: return {} from get_config(), and set the key through ConfigParser in get_api_endpoint(), as write_local_exp_id() does. I'm happy to open a PR.
- 主要言語
- Python
- スター
- 1.9k
- フォーク
- 335
- 平均マージ
- 16時間 47分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mlco2/codecarbon のほかの issue
-
Explicit zero carbon intensity is discarded as a missing factor対応中かも @nawaaaaaAaar が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
mlco2/codecarbon#1440 ·
メンテナーはふだん 1 日以内に返信
-
GCP region parser selects the wrong region for multi-digit region numbers対応中かも @nawaaaaaAaar が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mlco2/codecarbon#1438 ·
メンテナーはふだん 1 日以内に返信
-
Update the screen shot of the dashboard対応中かも @aarthis81 が 5 日前に担当しました。 オープンdocumentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mlco2/codecarbon#1423 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Update the bibtex citation再び着手できるかも @1215harsha が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdocumentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mlco2/codecarbon#1422 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
codecarbon monitor prints a "Saved to" path that ignores output_dir対応中かも @davidberenstein1957 が 57 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mlco2/codecarbon#1322 ·
メンテナーはふだん 1 日以内に返信
mlco2/codecarbon の issue をすべて見る
似ている issue
-
docs(types): update the collection binding note now that typed collections shipped in pycubrid 1.9.0オープンdocumentation priority: low size: S
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cubrid-lab/sqlalchemy-cubrid#768 ·
メンテナーはふだん 1 日以内に返信
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
ansys/pydpf-core#3547 ·
メンテナーはふだん 1 日以内に返信
-
core
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vectorize-io/hindsight#5457 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: LangChain drops OpenAI Responses text blocks from session recording対応中かも @ktz03 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
volcengine/OpenViking#5806 ·
メンテナーはふだん 1 日以内に返信