fix(wcf): remove PUE double-counting; feat: error handling, config loaders, output options#231
Open
vinisha231 wants to merge 33 commits into
Open
fix(wcf): remove PUE double-counting; feat: error handling, config loaders, output options#231vinisha231 wants to merge 33 commits into
vinisha231 wants to merge 33 commits into
Conversation
request_energy already embeds datacenter_pue. The previous formula multiplied by datacenter_pue a second time for the electricity-mix WUE term, inflating water impact by a factor of PUE^2 on that component. WUE is also defined relative to IT energy (pre-PUE), so the datacenter cooling term now divides out PUE before applying datacenter_wue.
…ionError exceptions (mlco2#100)
…ng, ProviderDataUnavailableWarning, ImpactEstimateUncertainWarning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses four tracked issues with real fixes and full test coverage.
🐛 fix: remove PUE double-counting in
request_usage_wcf(#230)request_energyalready embedsdatacenter_pue. The previous formula multiplied bydatacenter_puea second time for the electricity-mix WUE term, inflating water impact by PUE² on that component. WUE is also defined relative to IT energy (pre-PUE), so the datacenter cooling term now divides out PUE before applyingdatacenter_wue.Before:
request_energy * (datacenter_wue + datacenter_pue * if_electricity_mix_wue)After:
(request_energy / datacenter_pue) * datacenter_wue + request_energy * if_electricity_mix_wue🚨 feat: actionable error messages for new users (#100)
ProviderNotInstalledError— includespip install ecologits[provider]hintInvalidProviderError— lists all valid providers in the messageConfigurationError— for bad config/init stateOpenTelemetryNotInstalledError— replaces silent logger + bareEcoLogitsError📁 feat: load configuration from file or environment (#98)
load_config_from_json(path)/EcoLogits.init_from_config(path)load_config_from_yaml(path)/EcoLogits.init_from_yaml(path)(pyyaml optional)load_config_from_env()/EcoLogits.init_from_env()— readsECOLOGITS_PROVIDERS,ECOLOGITS_ELECTRICITY_MIX_ZONE,ECOLOGITS_OPENTELEMETRY_ENDPOINT📊 feat: richer output options for impact results (#118)
Impacts.to_dict(),Impacts.to_json(),Impacts.summary(),Impacts.__repr__BaseImpact.to_dict(),BaseImpact.__repr__RangeValue.to_dict(),__repr__,__sub__,__rsub__,__neg__,__abs__impacts_to_csv(impacts)— CSV export with phase/metric/value/unit columnsOther improvements
EcoLogits.reset()classmethod for test isolationelectricity-mix-not-available,model-arch-deprecated,provider-data-unavailable,impact-estimate-uncertainecologits.impactsgpu_energygamma coefficient was mislabelled "Beta"Test plan
tests/test_wcf_pue.py— WCF PUE regression teststests/test_exceptions.py— exception hierarchy and message contenttests/test_config.py— JSON, YAML, env config loaderstests/test_ecologits_init.py—init_from_config,init_from_envintegrationtests/test_output_options.py—to_dict,to_json,summary,__repr__tests/test_export.py—impacts_to_csvtests/test_impacts_modeling.py— BaseImpact and Impacts model methodstests/test_range_value.pyandtests/test_status_messages.py🤖 Generated with Claude Code