Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mlco2/codecarbon
/ functions
Functions
1,889 in github.com/mlco2/codecarbon
⨍
Functions
1,889
◇
Types & classes
328
↳
Endpoints
162
Function
test_login_calls_authorize_and_auth_check
(monkeypatch)
tests/cli/test_cli_main.py:155
Function
test_logout_clears_cookie_and_session
(client, monkeypatch)
carbonserver/tests/api/routers/test_authenticate.py:33
Method
test_machine_memory_gb_uses_system_total_when_not_on_slurm
( self, mock_virtual_memory )
tests/test_ram.py:210
Function
test_main_exits_with_error_when_command_raises
(monkeypatch, capsys)
tests/cli/test_cli_main.py:140
Method
test_main_fallback_default_power_when_unknown_cpu
(self)
tests/test_cpu.py:556
Function
test_main_rapl_permission_error
If the main/package energy file is not readable we must fail loudly.
tests/test_rapl_permissions.py:12
Method
test_main_returns_unknown_when_cpu_detection_fails
(self)
tests/test_cpu.py:573
Method
test_malformed_json_raises
Malformed JSON context file raises clear error.
tests/test_boamps_output.py:872
Method
test_measure_serialization
(self)
tests/test_boamps_output.py:184
Method
test_measures_mapping
energy_consumed -> powerConsumption, duration -> measurementDuration.
tests/test_boamps_output.py:312
Method
test_merge_context_with_auto_detected
Context file fields merge with auto-detected EmissionsData fields.
tests/test_boamps_output.py:807
Method
test_methods_handle_exceptions_and_start
(self)
tests/test_gpu_amd.py:543
Method
test_minimal_handler_warns
Minimal handler (no task) warns about missing fields.
tests/test_boamps_output.py:613
Function
test_minimal_telemetry_rejects_extensive_fields
(client, custom_test_server)
carbonserver/tests/api/routers/test_telemetry.py:55
Method
test_minimal_valid_report_passes
Minimal valid report (auto-filled + minimal task) passes validation.
tests/test_boamps_output.py:687
Function
test_monitor_delegates_offline_flag_to_run_and_monitor
(monkeypatch)
tests/cli/test_cli_main.py:306
Function
test_monitor_delegates_online_mode_to_run_and_monitor
(monkeypatch)
tests/cli/test_cli_main.py:327
Function
test_monitor_delegates_to_run_and_monitor_with_extra_args
(monkeypatch)
tests/cli/test_cli_main.py:345
Function
test_monitor_no_api_skips_experiment_id_requirement
(monkeypatch)
tests/cli/test_cli_main.py:363
Function
test_monitor_offline_initializes_offline_tracker
(monkeypatch)
tests/cli/test_cli_main.py:278
Function
test_monitor_offline_requires_country_iso_code
()
tests/cli/test_cli_main.py:65
Function
test_monitor_online_requires_experiment_id
(monkeypatch)
tests/cli/test_cli_main.py:270
Method
test_monitor_power_uses_gpu_detail_position_when_gpu_index_is_missing
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:121
Function
test_monitor_run_and_monitor
(monkeypatch)
tests/cli/test_cli_main.py:96
Method
test_multiple_datasource_instances_share_cache
Verify that multiple DataSource instances share the same cache.
tests/test_input.py:83
Function
test_multiple_rapl_providers_with_mixed_permissions
Verify that multiple RAPL providers (intel-rapl and intel-rapl-mmio) are scanned, and permission errors on one provider don't prevent using t
tests/test_rapl_mmio_scanning.py:17
Method
test_new_config_parameter_takes_precedence
Test that new config parameter takes precedence over old one.
tests/test_electricitymaps_config_backward_compatibility.py:42
Method
test_no_reinit_on_other_amdsmi_library_error
(self)
tests/test_gpu_amd.py:67
Function
test_non_main_rapl_permission_warning_and_skip
If a non-main domain (e.g. psys) is unreadable, it should be skipped and warn.
tests/test_rapl_permissions.py:57
Method
test_none_values_stripped_from_output
None values should not appear in serialized output.
tests/test_boamps_output.py:221
Method
test_nordic_admin_regions_fall_back_to_country_without_regional_lookup
(self)
tests/test_emissions.py:282
Function
test_nordic_emissions_data_included
Test that nordic emissions data file is included in the package.
tests/test_package_integrity.py:77
Method
test_nordic_region_missing_static_data_falls_back_to_country
(self)
tests/test_emissions.py:321
Method
test_normalize_gpu_ids
(self)
tests/test_config.py:70
Method
test_normalize_gpu_ids_mixed_list_ignores_invalid_entries
(self)
tests/test_cpu.py:739
Method
test_normalize_gpu_ids_mixed_list_with_escaping
(self)
tests/test_cpu.py:725
Method
test_nvidia_initialization
(self, mock_subprocess, mock_nvidia, mock_rocm)
tests/test_gpu.py:218
Method
test_offline_tracker
(self)
tests/test_offline_emissions_tracker.py:43
Method
test_offline_tracker_accepts_force_carbon_intensity_parameter
(self)
tests/test_config.py:256
Method
test_offline_tracker_country_name
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:481
Method
test_offline_tracker_invalid_headers
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:504
Method
test_offline_tracker_task
(self)
tests/test_offline_emissions_tracker.py:62
Method
test_offline_tracker_valid_headers
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:537
Method
test_oidc_provider_initialization
Test that OIDCAuthProvider initializes correctly.
carbonserver/tests/api/service/test_auth_provider.py:12
Method
test_old_config_parameter_name
Test that co2_signal_api_token in config file still works.
tests/test_electricitymaps_config_backward_compatibility.py:17
Method
test_on_premise_detection
on_cloud='N' -> infraType='onPremise'.
tests/test_boamps_output.py:405
Function
test_organiation_service_retrieves_all_existing_organizations
()
carbonserver/tests/api/service/test_organization_service.py:68
Function
test_organization_service_add_org_creates_correct_org
(_)
carbonserver/tests/api/service/test_organization_service.py:47
Function
test_organization_service_patches_correct_org
()
carbonserver/tests/api/service/test_organization_service.py:104
Function
test_organization_service_retrieves_correct_org_by_id
()
carbonserver/tests/api/service/test_organization_service.py:87
Function
test_orgganization_service_list_users
()
carbonserver/tests/api/service/test_organization_service.py:133
Method
test_oserror_sets_amdsmi_unavailable
OSError during amdsmi import (e.g. missing libamd_smi.so) must disable AMD GPU support.
tests/test_gpu_amd.py:433
Method
test_out_method_handles_exception
( self, mock_logger_error, mock_push_to_gateway )
tests/output_methods/metrics/test_prometheus.py:65
Method
test_out_writes_json_file
BoAmpsOutput.out() writes a valid JSON file.
tests/test_boamps_output.py:533
Method
test_output_contains_all_auto_fields
Output JSON contains all auto-filled fields from EmissionsData.
tests/test_boamps_output.py:584
Method
test_output_dir_created_if_missing
Output directory is created automatically if it doesn't exist.
tests/test_boamps_output.py:623
Method
test_output_file_naming
Output file is named boamps_report_{run_id}.json.
tests/test_boamps_output.py:548
Method
test_output_methods_boamps_adds_boamps_output_handler
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:216
Method
test_output_methods_overrides_save_to_flags
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:278
Method
test_output_methods_parsed_from_config_string
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:304
Function
test_overwrite_local_config_updates_existing_file
(tmp_path)
tests/cli/test_cli_utils.py:67
Function
test_package_importability
Test that the main package components can be imported.
tests/test_package_integrity.py:133
Method
test_parse_env_config
(self)
tests/test_config.py:92
Method
test_parse_gpu_ids
(self)
tests/test_config.py:55
Method
test_parse_scontrol_falls_back_to_machine_total_when_missing_mem
( self, mock_virtual_memory )
tests/test_ram.py:134
Method
test_parse_scontrol_falls_back_to_machine_total_when_multiple_matches
( self, mock_virtual_memory )
tests/test_ram.py:145
Method
test_parse_scontrol_memory_units
(self)
tests/test_ram.py:107
Function
test_patch_organization
(client, custom_test_server)
carbonserver/tests/api/routers/test_organizations.py:150
Function
test_patch_project
(client, custom_test_server)
carbonserver/tests/api/routers/test_projects.py:167
Method
test_power_calculation_consistency
Test that the power calculation is consistent with expected scaling behavior
tests/test_ram.py:376
Method
test_private_infra_uses_forced_intensity_when_set
(self, mocked_get_emissions)
tests/test_emissions.py:187
Method
test_process_memory_gb_includes_children
(self, mock_process)
tests/test_ram.py:196
Function
test_project_cascade_delete
Test that deleting a project cascades to all child entities. This test creates a full hierarchy: Organization -> Project -> Experiment -
carbonserver/tests/api/integration/test_project_cascade_delete.py:70
Function
test_project_delete_via_repository
Test cascade delete through the repository layer (simulating API delete).
carbonserver/tests/api/integration/test_project_cascade_delete.py:335
Function
test_project_service_creates_correct_project
(_)
carbonserver/tests/api/service/test_project_service.py:23
Function
test_project_service_delete_nonexistent_project
Test that attempting to delete a non-existent project propagates the error.
carbonserver/tests/api/service/test_project_service.py:104
Function
test_project_service_delete_unauthorized_user
Test that deleting a project with an unauthorized user raises an error.
carbonserver/tests/api/service/test_project_service.py:73
Function
test_project_service_delete_with_cascade
Test that project service delete calls repository delete method. The cascade delete to experiments, runs, emissions, and tokens is handle
carbonserver/tests/api/service/test_project_service.py:53
Function
test_project_service_deletes_correct_project
()
carbonserver/tests/api/service/test_project_service.py:42
Function
test_project_service_patches_correct_project
()
carbonserver/tests/api/service/test_project_service.py:129
Function
test_project_service_retrieves__correct_project_by_organization_id
()
carbonserver/tests/api/service/test_project_service.py:158
Function
test_project_service_retrieves_correct_project_by_id
()
carbonserver/tests/api/service/test_project_service.py:146
Function
test_project_token_service_creates_correct_project_token
(_)
carbonserver/tests/api/service/test_project_tokens_service.py:45
Function
test_project_token_service_deletes_correct_project_token
()
carbonserver/tests/api/service/test_project_tokens_service.py:65
Function
test_project_token_service_has_access_to_emission_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:182
Function
test_project_token_service_has_access_to_experiment_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:142
Function
test_project_token_service_has_access_to_project_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:99
Function
test_project_token_service_has_access_to_project_id_write
()
carbonserver/tests/api/service/test_project_tokens_service.py:120
Function
test_project_token_service_has_access_to_run_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:163
Function
test_project_token_service_retrieves_correct_tokens_by_project_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:82
Function
test_psys_not_preferred_when_package_available
Verify that when both psys and package domains are available, CodeCarbon prefers package domains over psys because package domains are more r
tests/test_rapl_mmio_scanning.py:202
Method
test_publisher_serialization
(self)
tests/test_boamps_output.py:128
Method
test_quality_passthrough
(self)
tests/test_boamps_output.py:486
Method
test_ram_component_details
(self)
tests/test_boamps_output.py:373
Method
test_ram_diff
(self)
tests/test_ram.py:14
Method
test_ram_slurm
(self)
tests/test_ram.py:51
Function
test_rapl_both_parameters_together
Verify that rapl_include_dram and rapl_prefer_psys work correctly together.
tests/test_rapl_parameters.py:255
Method
test_rapl_cpu_hardware
(self)
tests/test_cpu.py:349
Function
test_rapl_deduplication_prefers_mmio
Verify that when the same domain (e.g., package-0) appears in both intel-rapl and intel-rapl-mmio, only the MMIO version is used to preve
tests/test_rapl_mmio_scanning.py:143
Function
test_rapl_include_dram_default_false
Verify that rapl_include_dram defaults to False and excludes DRAM domains.
tests/test_rapl_parameters.py:14
← previous
next →
1,601–1,700 of 1,889, ranked by callers