Skip to content

more detail energy breakdown#235

Open
mjademitchell wants to merge 2 commits intomainfrom
157-detail-energy-usage
Open

more detail energy breakdown#235
mjademitchell wants to merge 2 commits intomainfrom
157-detail-energy-usage

Conversation

@mjademitchell
Copy link
Copy Markdown
Contributor

Description

Updatescalculate_energyto return an EnergyBreakdown with individual CPU, GPU, and memory energy values alongside the total, and displays the breakdown in the CLI output.

Fixes #157

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • The documentation builds and looks OK (eg. mkdocs serve)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future. (Indicate issue here: # (issue))

@mjademitchell mjademitchell self-assigned this Mar 4, 2026
@mjademitchell mjademitchell requested a review from cc-a March 4, 2026 08:31
Copy link
Copy Markdown
Collaborator

@cc-a cc-a left a comment

Choose a reason for hiding this comment

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

Thanks @mjademitchell. This is looking good. The testing can be expanded a bit I think. In additional to my comments below could you expand the output checking in used in test_carbon.py.

Comment thread tests/test_job.py
Comment thread carbon/__init__.py Outdated
Comment on lines +87 to +89
energy_consumed=energy_consumed,
energy_consumed=energy_consumed.total,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can probably remove energy_consumed.

Comment thread tests/test_job.py Outdated
result = job.calculate_energy(node, 1.5)

assert np.isclose(result, expected, atol=1e-9)
assert np.isclose(result.total, expected, atol=1e-9)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Likewise.

@mjademitchell mjademitchell force-pushed the 157-detail-energy-usage branch from 325af8f to 8ddeff3 Compare March 6, 2026 09:56
@mjademitchell mjademitchell requested a review from cc-a March 12, 2026 09:25
Comment thread uv.lock
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove these.

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.

More detailed energy usage breakdown

2 participants