Skip to content

Conversation

@davisethan
Copy link
Contributor

Described by #955.

@bruAristimunha
Copy link
Collaborator

Here, instead of a new parameter, can we make some tests (such as initialize and see if it fails, or use some routine from codecarbon) and automatically determine (something like try and catch)?

@bruAristimunha
Copy link
Collaborator

Online is always better, or no?

@davisethan
Copy link
Contributor Author

My major concern with online mode is that in some private infrastructures, networked table lookups are unreliable. Specifically in my case, I'm using private infra through the University of Washington. I've seen that when online mode fails, CodeCarbon defaults to Kansas in the middle of USA; Kansas has different emissions from Washington.

I would say online mode is always preferable, except for the default after failure that I'm seeing in my case. Others with similar setups would also run into the same inaccurate emissions tracking.

In my local environment I tried to use offline mode parameters when configuring EmissionsTracker. However, this raises an error. A solution is to instantiate an OfflineEmissionsTracker with all parameters.

Copy link
Collaborator

@bruAristimunha bruAristimunha left a comment

Choose a reason for hiding this comment

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

Small points and it is good for me

@bruAristimunha
Copy link
Collaborator

Suuuper good, many thanks @davisethan

bruAristimunha and others added 4 commits January 29, 2026 22:41
Signed-off-by: Bru <a.bruno@aluno.ufabc.edu.br>
…zed tests

- Fixed bug where codecarbon_offline attribute was not set when codecarbon_config is None
- Added self.codecarbon_offline = False for default configuration
- Created comprehensive test suite with pytest parametrization
- Tests cover all offline parameters, online mode, and attribute existence
- Reduced code duplication by using @pytest.mark.parametrize
- All 15 test cases pass (12 run, 3 skipped when codecarbon not installed)

Fixes issues in:
- examples/tutorials/tutorial_3_benchmarking_multiple_pipelines.py
- examples/advanced_examples/plot_filterbank_csp_vs_csp.py
- examples/advanced_examples/plot_hinss2021_classification.py
- examples/advanced_examples/plot_use_an_X_y_dataset.py
- examples/advanced_examples/plot_statistical_analysis.py
@bruAristimunha bruAristimunha merged commit 48b5c4e into NeuroTechX:develop Jan 29, 2026
14 of 15 checks passed
@davisethan davisethan deleted the offline-emissions branch January 30, 2026 00:33
@davisethan
Copy link
Contributor Author

Thanks for being an active maintainer @bruAristimunha

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.

2 participants