MCPcopy Create free account

hub / github.com/mlco2/codecarbon / functions

Functions1,889 in github.com/mlco2/codecarbon

↓ 106 callersMethodjson
(self)
tests/cli/test_cli_main.py:192
↓ 89 callersFunctioncn
(...inputs: ClassValue[])
webapp/src/helpers/utils.ts:4
↓ 52 callersMethodstop
(self)
tests/cli/test_monitor.py:18
↓ 40 callersMethod_set_from_conf
Method to standardize private argument setting. Generic flow is: * If a value for the variable `var` with name `name` is provided in
codecarbon/emissions_tracker.py:77
↓ 40 callersMethodfrom_energy
(cls, kWh: float)
codecarbon/core/units.py:83
↓ 38 callersMethodstart
(self)
tests/cli/test_monitor.py:15
↓ 34 callersMethodflush
Write the emissions to disk or call the API depending on the configuration, but keep running the experiment. :return: CO2 emi
codecarbon/emissions_tracker.py:821
↓ 32 callersMethodstart
(self)
codecarbon/core/cpu.py:1018
↓ 29 callersFunctionmap_emissions_to_boamps
Map CodeCarbon EmissionsData to a BoAmps report. Auto-fills fields from EmissionsData and merges with user-provided context. User-provid
codecarbon/output_methods/boamps/mapper.py:32
↓ 25 callersMethodfrom_utils
(cls, gpu_ids: Optional[List] = None)
codecarbon/external/hardware.py:176
↓ 23 callersMethod_get_matching_cpu
Get matching cpu name :args: model_raw (str): raw name of the cpu model detected on the machine cpu_df (Dat
codecarbon/core/cpu.py:902
↓ 22 callersMethodstop_task
Stop tracking a dedicated execution task. Delta energy is computed by task, to isolate its contribution to total emissions. :
codecarbon/emissions_tracker.py:762
↓ 20 callersMethodstart_task
Start tracking a dedicated execution task. :param task_name: Name of the task to be isolated. :return: None
codecarbon/emissions_tracker.py:699
↓ 19 callersFunctionfetchApi
( endpoint: string, schema: S, options?: RequestInit, )
webapp/src/api/client.ts:9
↓ 19 callersMethodfrom_watts
(cls, watts: float)
codecarbon/core/units.py:122
↓ 19 callersMethodout
Save the emissions data from a whole run to a CSV file. * If the file does not exist, then create it. * If the file already
codecarbon/output_methods/file.py:74
↓ 19 callersMethodto_dict
(self)
codecarbon/output_methods/boamps/models.py:143
↓ 18 callersMethod_calculate_ram_power
Calculate RAM power consumption based on the total RAM size using a more sophisticated model that better scales with larger memory si
codecarbon/external/ram.py:141
↓ 18 callersMethodcheck_output
(_cmd, *args, **kwargs)
tests/test_gpu.py:68
↓ 18 callersMethodget_private_infra_emissions
Computes emissions for private infra :param energy: Mean power consumption of the process (kWh) :param geo: Country and regio
codecarbon/core/emissions.py:148
↓ 17 callersFunctioncamel_to_snake
Convert camelCase to snake_case.
codecarbon/output_methods/boamps/models.py:21
↓ 17 callersFunctionresolveMock
( url: URL, method: string, body?: unknown, )
webapp/src/api/mock/handlers.ts:195
↓ 16 callersMethod_estimate_dimm_count
Estimate the number of memory DIMMs based on total memory size using heuristic rules. Args: total_gb: Total RAM
codecarbon/external/ram.py:82
↓ 16 callersFunctionrenderWithRouter
( ui: ReactElement, { initialEntries = ["/"], ...options }: RouterRenderOptions = {}, )
webapp/tests/test-utils.tsx:9
↓ 16 callersFunctionurl
(path: string)
webapp/tests/api/mock/handlers.test.ts:5
↓ 15 callersMethodclear
(self)
carbonserver/tests/api/routers/test_authenticate.py:35
↓ 14 callersMethod_get_headers
(self)
codecarbon/core/api_client.py:66
↓ 14 callersFunctionok
(body: unknown)
webapp/src/api/mock/handlers.ts:12
↓ 14 callersMethodtotal_power
Compute the Power (kW) consumed by the current process (and its children if `children` was True in __init__) Returns:
codecarbon/external/ram.py:314
↓ 13 callersMethod_log_error
(self, url, payload, response)
codecarbon/core/api_client.py:344
↓ 13 callersMethodfrom_dict
(cls, d: dict)
codecarbon/output_methods/boamps/models.py:147
↓ 13 callersFunctionget_custom_mock_open
(global_conf_str, local_conf_str)
tests/testutils.py:23
↓ 13 callersFunctionmake_tracker
(**overrides)
tests/test_resource_tracker.py:9
↓ 12 callersFunction_to_dict
Recursively convert a dataclass to a camelCase dict, stripping None values.
codecarbon/output_methods/boamps/models.py:27
↓ 12 callersMethodfrom_seconds
(cls, seconds: float)
codecarbon/core/units.py:24
↓ 12 callersFunctionread_energy
Read energy in microjoules
examples/rapl/test_rapl_fix.py:29
↓ 11 callersMethod_call_amdsmi_with_reinit
(self, func: Callable, *args, **kwargs)
codecarbon/core/gpu_amd.py:87
↓ 11 callersMethodget_cpu_details
Fetches the CPU Energy Deltas by fetching values from RAPL files
codecarbon/core/cpu.py:825
↓ 11 callersMethodout
(self)
codecarbon/external/task.py:21
↓ 10 callersFunction_make_emissions_data
Create a realistic EmissionsData instance for testing.
tests/test_boamps_output.py:44
↓ 10 callersFunctiongenerate_gauge
(metric_doc: MetricDocumentation)
codecarbon/output_methods/metrics/prometheus.py:61
↓ 9 callersMethod_measure_power_and_energy
A function that is periodically run by the `BackgroundScheduler` every `self._measure_power_secs` seconds. :return: None
codecarbon/emissions_tracker.py:1207
↓ 9 callersFunctioncount_cpus
()
codecarbon/core/util.py:148
↓ 9 callersFunctioncount_physical_cpus
()
codecarbon/core/util.py:105
↓ 9 callersMethodfrom_file
Load BoAmps context from a JSON file. The context file should follow the BoAmps report schema structure, containing fields t
codecarbon/output_methods/boamps/output.py:69
↓ 9 callersMethodfrom_millijoules
(cls, energy: float)
codecarbon/core/units.py:79
↓ 8 callersFunction_make_task
Create a minimal valid BoAmps task for testing.
tests/test_boamps_output.py:86
↓ 8 callersMethod_prepare_emissions_data
Prepare the emissions data to be sent to the API or written to a file. :return: EmissionsData object with the total emissions data.
codecarbon/emissions_tracker.py:943
↓ 8 callersFunctiondetect_cpu_model
()
codecarbon/core/util.py:78
↓ 8 callersFunctionencryptProjectId
(projectId: string)
webapp/src/utils/crypto.ts:110
↓ 8 callersMethodfrom_g_per_kWh
(cls, g_per_kWh: float)
codecarbon/core/units.py:44
↓ 8 callersMethodget_cloud_emissions_data
Returns Cloud Regions Impact Data. Data is pre-loaded at module import for performance.
codecarbon/input.py:137
↓ 8 callersMethodget_global_energy_mix_data
Returns Global Energy Mix Data. Data is pre-loaded at module import for performance.
codecarbon/input.py:130
↓ 8 callersFunctionheavy_computation
(run_time_secs: float = 3)
tests/test_emissions_tracker.py:31
↓ 8 callersFunctionread_max_energy
Read max energy range in microjoules
examples/rapl/test_rapl_fix.py:35
↓ 8 callersMethodset_CPU_tracking
(self)
codecarbon/core/resource_tracker.py:182
↓ 8 callersMethodvalues
(self)
codecarbon/output_methods/emissions_data.py:52
↓ 7 callersMethod_get_total_energy_consumption
Returns energy in millijoules. amdsmi_get_energy_count returns accumulated energy counter and its resolution. Energy = counter_value *
codecarbon/core/gpu_amd.py:107
↓ 7 callersMethodacquire
Creates a lock file and ensures it's the only instance running.
codecarbon/lock.py:43
↓ 7 callersMethodfrom_energies_and_delay
P = (E_{t1} - E_{t2}) / delay (=t2-t1) kW kWh kWh h Args: e1 (Energy): First measurement
codecarbon/core/units.py:126
↓ 7 callersMethodget_carbon_intensity_per_source_data
Returns Carbon intensity per source. In gCO2.eq/kWh. Data is pre-loaded at module import for performance.
codecarbon/input.py:176
↓ 7 callersFunctionget_hierarchical_config
Get the user-defined codecarbon configuration ConfigParser dictionnary (actually a configparser.SectionProxy instance). ``` >>> from
codecarbon/core/config.py:113
↓ 7 callersMethodhas_valid_headers
Checks self.save_file_path has headers matching those from passed data. Args: data: EmissionsData object with valid head
codecarbon/output_methods/file.py:54
↓ 7 callersFunctionis_rapl_available
Checks if Intel RAPL is available on the system. Returns: bool: `True` if Intel RAPL is available, `False` otherwise.
codecarbon/core/cpu.py:186
↓ 7 callersMethodout
Write the final BoAmps report as a JSON file.
codecarbon/output_methods/boamps/output.py:143
↓ 7 callersMethodproject_token_has_access
Check if the project token has access to the project_id, experiment_id, run_id or emission_id with the desired_access.
carbonserver/carbonserver/api/services/project_token_service.py:75
↓ 7 callersMethodrelease
Removes the lock file on exit.
codecarbon/lock.py:57
↓ 7 callersMethodstop
Stops tracking the experiment :return: CO2 emissions in kgs
codecarbon/emissions_tracker.py:854
↓ 7 callersMethodverify_output_file
(self, file_path: str, num_lines: int)
tests/test_emissions_tracker.py:569
↓ 6 callersFunction_fragment_ok
(html_file: Path, fragment: str)
scripts/check_docs_links.py:140
↓ 6 callersMethod_parse_scontrol
(self, scontrol_str)
codecarbon/external/ram.py:242
↓ 6 callersMethod_write_context_file
(self, context: dict)
tests/test_boamps_output.py:784
↓ 6 callersFunctioncollectConsoleErrors
(page: Page)
webapp/e2e/mock-service.spec.ts:14
↓ 6 callersMethodexit
(self)
codecarbon/output_methods/base_output.py:53
↓ 6 callersMethodget_country_emissions
Computes emissions for a country on private infra, given a quantity of power consumed by using data for the mix of energy sou
codecarbon/core/emissions.py:291
↓ 6 callersFunctionget_env_cloud_details
>>> get_env_cloud_details() {'provider': 'AWS', 'metadata': {'accountId': '26550917306', 'architecture': 'x86_64', 'avai
codecarbon/core/cloud.py:34
↓ 6 callersMethodget_gpu_details
Get all GPUs instantaneous metrics >>> get_gpu_details() [ { "name": "Tesla V100-SXM2-16GB",
codecarbon/core/gpu.py:108
↓ 6 callersMethodget_gpu_static_info
Get all GPUs static information. >>> get_gpu_static_info() [ { "name": "Tesla V100-SXM2-16GB",
codecarbon/core/gpu.py:84
↓ 6 callersMethodget_model
(self)
codecarbon/external/hardware.py:412
↓ 6 callersMethodget_ressource_path
(package: str, filepath: str)
codecarbon/input.py:84
↓ 6 callersFunctionhandleError
(error: unknown)
webapp/src/api/errors.ts:27
↓ 6 callersMethodisOperationAuthorizedOnProject
(self, project_id: UUID | str, user: User)
carbonserver/carbonserver/api/services/auth_context.py:32
↓ 6 callersFunctionis_key_value_exist
Check if at least one value of a key is equal to the specified value.
carbonserver/tests/api/integration/test_api_black_box.py:73
↓ 6 callersFunctionis_psutil_available
()
codecarbon/core/cpu.py:209
↓ 6 callersFunctionis_valid_uuid
(val)
carbonserver/tests/api/integration/test_api_black_box.py:51
↓ 6 callersFunctionlogIn
(page: Page)
webapp/e2e/mock-service.spec.ts:6
↓ 6 callersMethodmeasure_power_and_energy
( self, last_duration: float, gpu_ids: Iterable[int] = None )
codecarbon/external/hardware.py:77
↓ 6 callersFunctionsnake_to_camel
Convert snake_case to camelCase.
codecarbon/output_methods/boamps/models.py:15
↓ 5 callersMethod_compute_emissions_delta
Compute the delta emissions since the last call to this method. :param total_emissions: The total emissions data to compute the delta
codecarbon/emissions_tracker.py:1069
↓ 5 callersMethod_get_cpu_power_from_registry
(self, cpu_model_raw: str)
codecarbon/core/cpu.py:894
↓ 5 callersMethod_get_power_from_cpu_load
When in MODE_CPU_LOAD
codecarbon/external/hardware.py:259
↓ 5 callersFunction_get_resource_path
Get filesystem path to a package resource file.
codecarbon/input.py:22
↓ 5 callersFunction_is_main_domain
Check if a domain is a main/package domain.
codecarbon/core/cpu.py:76
↓ 5 callersMethod_log_values
Logs output from Intel Power Gadget command line to a file
codecarbon/core/cpu.py:326
↓ 5 callersMethod_parse_scontrol_memory_GB
Parse the memory string (B) returned by scontrol to a float (GB) Args: mem (str): Memory string (B) as `[amount][unit]`
codecarbon/external/ram.py:221
↓ 5 callersMethod_try_get_nordic_region_emissions
( self, energy: Energy, geo: GeoMetadata )
codecarbon/core/emissions.py:196
↓ 5 callersMethodcompute_detailed_sum
( self, project_id: str, start_date, end_date )
carbonserver/carbonserver/api/usecases/project/project_sum.py:9
↓ 5 callersFunctioncreated
(body: unknown)
webapp/src/api/mock/handlers.ts:13
↓ 5 callersMethoddelete_project
(self, project_id, user)
carbonserver/carbonserver/api/services/project_service.py:34
↓ 5 callersMethodfrom_geo_js
(cls, url: str)
codecarbon/external/geography.py:92
next →1–100 of 1,889, ranked by callers