Skip to content

Allow users to set metadata for BoAmps#1234

Draft
benoit-cty wants to merge 3 commits into
masterfrom
feat/boamps_metadata
Draft

Allow users to set metadata for BoAmps#1234
benoit-cty wants to merge 3 commits into
masterfrom
feat/boamps_metadata

Conversation

@benoit-cty

Copy link
Copy Markdown
Contributor

Description

Allow users to set metadata for BoAmps.

Motivation and Context

BoAmps has required semantic fields (taskStage, taskFamily, algorithms, dataset) that CodeCarbon cannot infer automatically.

So users needed a way to provide BoAmps context manually.

Before this PR it was possible to do it but harder :

  • Build a BoAmpsOutput with custom context (task/header/quality), or load it from a JSON file.
  • Pass that handler in output_handlers when creating EmissionsTracker or OfflineEmissionsTracker.
  • Let the tracker call that handler at stop/flush time.

What changed now:

  • You can still do it that way.
  • But the preferred, simpler path is the new generic metadata parameter, where BoAmps reads metadata["boamps"].

How Has This Been Tested?

With the updated example examples/boamps_output.py

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • 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

Please refer to docs/how-to/ai-policy.md for detailed guidelines on how to disclose AI usage in your PR. Accurately completing this section is mandatory.

  • 🟥 AI-vibecoded: You cannot explain the logic. Car analogy : the car drive by itself, you are outside it and just tell it where to go.
  • 🟠 AI-generated: Car analogy : the car drive by itself, you are inside and give instructions.
  • ⭐ AI-assisted. Car analogy : you drive the car, AI help you find your way.
  • ♻️ No AI used. Car analogy : you drive the car.

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

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

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.19%. Comparing base (abfdd8c) to head (db9ea2e).

Files with missing lines Patch % Lines
codecarbon/emissions_tracker.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1234      +/-   ##
==========================================
+ Coverage   89.18%   89.19%   +0.01%     
==========================================
  Files          47       47              
  Lines        4511     4535      +24     
==========================================
+ Hits         4023     4045      +22     
- Misses        488      490       +2     

☔ 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant