Skip to content

Fix type error #830 #831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2025
Merged

Fix type error #830 #831

merged 3 commits into from
May 1, 2025

Conversation

benoit-cty
Copy link
Contributor

Fix an error of type for new parameters.

Will close #830

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a type error by adding explicit type conversion and error handling for new configuration parameters.

  • Updated type conversion logic in _set_from_conf to catch conversion errors and set invalid values to None.
  • Updated constructor calls for force_cpu_power, force_ram_power, and force_mode_cpu_load with explicit type conversions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/test_config.py Added tests for new force_cpu_power and force_ram_power parameters to check type conversion outcomes.
codecarbon/emissions_tracker.py Modified configuration parsing to include explicit type conversion and error handling for new parameters.

benoit-cty and others added 2 commits May 1, 2025 08:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@inimaz inimaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks @benoit-cty

@benoit-cty benoit-cty merged commit a2a1cc7 into master May 1, 2025
7 checks passed
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.

TypeError when force_cpu_power is set in config file with CPU load mode
2 participants