MCPcopy Create free account

hub / github.com/mlco2/codecarbon / functions

Functions1,889 in github.com/mlco2/codecarbon

Functiontest_login_calls_authorize_and_auth_check
(monkeypatch)
tests/cli/test_cli_main.py:155
Functiontest_logout_clears_cookie_and_session
(client, monkeypatch)
carbonserver/tests/api/routers/test_authenticate.py:33
Methodtest_machine_memory_gb_uses_system_total_when_not_on_slurm
( self, mock_virtual_memory )
tests/test_ram.py:210
Functiontest_main_exits_with_error_when_command_raises
(monkeypatch, capsys)
tests/cli/test_cli_main.py:140
Methodtest_main_fallback_default_power_when_unknown_cpu
(self)
tests/test_cpu.py:556
Functiontest_main_rapl_permission_error
If the main/package energy file is not readable we must fail loudly.
tests/test_rapl_permissions.py:12
Methodtest_main_returns_unknown_when_cpu_detection_fails
(self)
tests/test_cpu.py:573
Methodtest_malformed_json_raises
Malformed JSON context file raises clear error.
tests/test_boamps_output.py:872
Methodtest_measure_serialization
(self)
tests/test_boamps_output.py:184
Methodtest_measures_mapping
energy_consumed -> powerConsumption, duration -> measurementDuration.
tests/test_boamps_output.py:312
Methodtest_merge_context_with_auto_detected
Context file fields merge with auto-detected EmissionsData fields.
tests/test_boamps_output.py:807
Methodtest_methods_handle_exceptions_and_start
(self)
tests/test_gpu_amd.py:543
Methodtest_minimal_handler_warns
Minimal handler (no task) warns about missing fields.
tests/test_boamps_output.py:613
Functiontest_minimal_telemetry_rejects_extensive_fields
(client, custom_test_server)
carbonserver/tests/api/routers/test_telemetry.py:55
Methodtest_minimal_valid_report_passes
Minimal valid report (auto-filled + minimal task) passes validation.
tests/test_boamps_output.py:687
Functiontest_monitor_delegates_offline_flag_to_run_and_monitor
(monkeypatch)
tests/cli/test_cli_main.py:306
Functiontest_monitor_delegates_online_mode_to_run_and_monitor
(monkeypatch)
tests/cli/test_cli_main.py:327
Functiontest_monitor_delegates_to_run_and_monitor_with_extra_args
(monkeypatch)
tests/cli/test_cli_main.py:345
Functiontest_monitor_no_api_skips_experiment_id_requirement
(monkeypatch)
tests/cli/test_cli_main.py:363
Functiontest_monitor_offline_initializes_offline_tracker
(monkeypatch)
tests/cli/test_cli_main.py:278
Functiontest_monitor_offline_requires_country_iso_code
()
tests/cli/test_cli_main.py:65
Functiontest_monitor_online_requires_experiment_id
(monkeypatch)
tests/cli/test_cli_main.py:270
Methodtest_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
Functiontest_monitor_run_and_monitor
(monkeypatch)
tests/cli/test_cli_main.py:96
Methodtest_multiple_datasource_instances_share_cache
Verify that multiple DataSource instances share the same cache.
tests/test_input.py:83
Functiontest_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
Methodtest_new_config_parameter_takes_precedence
Test that new config parameter takes precedence over old one.
tests/test_electricitymaps_config_backward_compatibility.py:42
Methodtest_no_reinit_on_other_amdsmi_library_error
(self)
tests/test_gpu_amd.py:67
Functiontest_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
Methodtest_none_values_stripped_from_output
None values should not appear in serialized output.
tests/test_boamps_output.py:221
Methodtest_nordic_admin_regions_fall_back_to_country_without_regional_lookup
(self)
tests/test_emissions.py:282
Functiontest_nordic_emissions_data_included
Test that nordic emissions data file is included in the package.
tests/test_package_integrity.py:77
Methodtest_nordic_region_missing_static_data_falls_back_to_country
(self)
tests/test_emissions.py:321
Methodtest_normalize_gpu_ids
(self)
tests/test_config.py:70
Methodtest_normalize_gpu_ids_mixed_list_ignores_invalid_entries
(self)
tests/test_cpu.py:739
Methodtest_normalize_gpu_ids_mixed_list_with_escaping
(self)
tests/test_cpu.py:725
Methodtest_nvidia_initialization
(self, mock_subprocess, mock_nvidia, mock_rocm)
tests/test_gpu.py:218
Methodtest_offline_tracker
(self)
tests/test_offline_emissions_tracker.py:43
Methodtest_offline_tracker_accepts_force_carbon_intensity_parameter
(self)
tests/test_config.py:256
Methodtest_offline_tracker_country_name
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:481
Methodtest_offline_tracker_invalid_headers
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:504
Methodtest_offline_tracker_task
(self)
tests/test_offline_emissions_tracker.py:62
Methodtest_offline_tracker_valid_headers
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:537
Methodtest_oidc_provider_initialization
Test that OIDCAuthProvider initializes correctly.
carbonserver/tests/api/service/test_auth_provider.py:12
Methodtest_old_config_parameter_name
Test that co2_signal_api_token in config file still works.
tests/test_electricitymaps_config_backward_compatibility.py:17
Methodtest_on_premise_detection
on_cloud='N' -> infraType='onPremise'.
tests/test_boamps_output.py:405
Functiontest_organiation_service_retrieves_all_existing_organizations
()
carbonserver/tests/api/service/test_organization_service.py:68
Functiontest_organization_service_add_org_creates_correct_org
(_)
carbonserver/tests/api/service/test_organization_service.py:47
Functiontest_organization_service_patches_correct_org
()
carbonserver/tests/api/service/test_organization_service.py:104
Functiontest_organization_service_retrieves_correct_org_by_id
()
carbonserver/tests/api/service/test_organization_service.py:87
Functiontest_orgganization_service_list_users
()
carbonserver/tests/api/service/test_organization_service.py:133
Methodtest_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
Methodtest_out_method_handles_exception
( self, mock_logger_error, mock_push_to_gateway )
tests/output_methods/metrics/test_prometheus.py:65
Methodtest_out_writes_json_file
BoAmpsOutput.out() writes a valid JSON file.
tests/test_boamps_output.py:533
Methodtest_output_contains_all_auto_fields
Output JSON contains all auto-filled fields from EmissionsData.
tests/test_boamps_output.py:584
Methodtest_output_dir_created_if_missing
Output directory is created automatically if it doesn't exist.
tests/test_boamps_output.py:623
Methodtest_output_file_naming
Output file is named boamps_report_{run_id}.json.
tests/test_boamps_output.py:548
Methodtest_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
Methodtest_output_methods_overrides_save_to_flags
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:278
Methodtest_output_methods_parsed_from_config_string
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:304
Functiontest_overwrite_local_config_updates_existing_file
(tmp_path)
tests/cli/test_cli_utils.py:67
Functiontest_package_importability
Test that the main package components can be imported.
tests/test_package_integrity.py:133
Methodtest_parse_env_config
(self)
tests/test_config.py:92
Methodtest_parse_gpu_ids
(self)
tests/test_config.py:55
Methodtest_parse_scontrol_falls_back_to_machine_total_when_missing_mem
( self, mock_virtual_memory )
tests/test_ram.py:134
Methodtest_parse_scontrol_falls_back_to_machine_total_when_multiple_matches
( self, mock_virtual_memory )
tests/test_ram.py:145
Methodtest_parse_scontrol_memory_units
(self)
tests/test_ram.py:107
Functiontest_patch_organization
(client, custom_test_server)
carbonserver/tests/api/routers/test_organizations.py:150
Functiontest_patch_project
(client, custom_test_server)
carbonserver/tests/api/routers/test_projects.py:167
Methodtest_power_calculation_consistency
Test that the power calculation is consistent with expected scaling behavior
tests/test_ram.py:376
Methodtest_private_infra_uses_forced_intensity_when_set
(self, mocked_get_emissions)
tests/test_emissions.py:187
Methodtest_process_memory_gb_includes_children
(self, mock_process)
tests/test_ram.py:196
Functiontest_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
Functiontest_project_delete_via_repository
Test cascade delete through the repository layer (simulating API delete).
carbonserver/tests/api/integration/test_project_cascade_delete.py:335
Functiontest_project_service_creates_correct_project
(_)
carbonserver/tests/api/service/test_project_service.py:23
Functiontest_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
Functiontest_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
Functiontest_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
Functiontest_project_service_deletes_correct_project
()
carbonserver/tests/api/service/test_project_service.py:42
Functiontest_project_service_patches_correct_project
()
carbonserver/tests/api/service/test_project_service.py:129
Functiontest_project_service_retrieves__correct_project_by_organization_id
()
carbonserver/tests/api/service/test_project_service.py:158
Functiontest_project_service_retrieves_correct_project_by_id
()
carbonserver/tests/api/service/test_project_service.py:146
Functiontest_project_token_service_creates_correct_project_token
(_)
carbonserver/tests/api/service/test_project_tokens_service.py:45
Functiontest_project_token_service_deletes_correct_project_token
()
carbonserver/tests/api/service/test_project_tokens_service.py:65
Functiontest_project_token_service_has_access_to_emission_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:182
Functiontest_project_token_service_has_access_to_experiment_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:142
Functiontest_project_token_service_has_access_to_project_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:99
Functiontest_project_token_service_has_access_to_project_id_write
()
carbonserver/tests/api/service/test_project_tokens_service.py:120
Functiontest_project_token_service_has_access_to_run_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:163
Functiontest_project_token_service_retrieves_correct_tokens_by_project_id
()
carbonserver/tests/api/service/test_project_tokens_service.py:82
Functiontest_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
Methodtest_publisher_serialization
(self)
tests/test_boamps_output.py:128
Methodtest_quality_passthrough
(self)
tests/test_boamps_output.py:486
Methodtest_ram_component_details
(self)
tests/test_boamps_output.py:373
Methodtest_ram_diff
(self)
tests/test_ram.py:14
Methodtest_ram_slurm
(self)
tests/test_ram.py:51
Functiontest_rapl_both_parameters_together
Verify that rapl_include_dram and rapl_prefer_psys work correctly together.
tests/test_rapl_parameters.py:255
Methodtest_rapl_cpu_hardware
(self)
tests/test_cpu.py:349
Functiontest_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
Functiontest_rapl_include_dram_default_false
Verify that rapl_include_dram defaults to False and excludes DRAM domains.
tests/test_rapl_parameters.py:14
← previousnext →1,601–1,700 of 1,889, ranked by callers