Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change client_name to company_name #16

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions carbonai/power_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class PowerMeter:
Name of the project you are working on.
program_name : str, optional
Name of the program you are working on.
client_name : str, optional
Name of the client you are working for.
company_name : str, optional
Name of the company you are working for.
user_name : str, default computer_user_name
The name of the user using the tool (for logging purpose).
cpu_power_log_path : str, optional
Expand Down Expand Up @@ -142,7 +142,7 @@ def __init__(
self,
project_name="",
program_name="",
client_name="",
company_name="",
user_name="",
cpu_power_log_path="",
get_country=True,
Expand Down Expand Up @@ -174,7 +174,7 @@ def __init__(

self.project = self.__set_project_name(project_name)
self.program_name = self.__set_project_entity(program_name)
self.client_name = self.__set_project_entity(client_name)
self.company_name = self.__set_project_entity(company_name)

self.is_online = is_online
if api_endpoint:
Expand Down Expand Up @@ -277,7 +277,7 @@ def from_config(cls, path):
{
"project_name": "Project X",
"program_name": "Program X",
"client_name": "Client X",
"company_name": "Company X",
"get_country": true,
"is_online": false,
"user_name": "customUsername",
Expand Down Expand Up @@ -829,7 +829,7 @@ def __log_records(
"ISO": self.location,
"Project name": self.project,
"Program name": self.program_name,
"Client name": self.client_name,
"Company name": self.company_name,
"Total Elapsed CPU Time (sec)": cpu_recorded_power[TOTAL_CPU_TIME],
"Total Elapsed GPU Time (sec)": gpu_recorded_power[TOTAL_GPU_TIME],
"Cumulative Package Energy (mWh)": cpu_recorded_power[
Expand Down
6 changes: 3 additions & 3 deletions docs/source/getting_started/data_information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ You should get a new line (in the csv file) for every usage of the package.
- Name of the project for which the package was used
* - Program name
- Name of the program for which the package was used
* - Client name
- Name of the client for which the package was used
* - Company name
- Name of the company for which the package was used
* - Total Elapsed CPU Time (sec)
- Total time of CPU usage (in seconds)
* - Total Elapsed GPU Time (sec)
Expand Down Expand Up @@ -64,4 +64,4 @@ You should get a new line (in the csv file) for every usage of the package.
* - Data shape
- *Declarative value*, size of the database used to train the algorithm
* - Comment
- *Declarative value*, comments made by the user
- *Declarative value*, comments made by the user
2 changes: 1 addition & 1 deletion docs/source/getting_started/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ it is possible to use a configuration file to do it only once:
{
"project_name": "Project X",
"program_name": "Program X",
"client_name": "Client X",
"company_name": "Company X",
"cpu_power_log_path": "",
"get_country": true,
"is_online": false,
Expand Down
11 changes: 7 additions & 4 deletions examples/Usage exemple.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"Help on class PowerMeter in module CarbonAImpact.PowerMeter:\n",
"\n",
"class PowerMeter(builtins.object)\n",
" | PowerMeter(project_name='', program_name='', client_name='', cpu_power_log_path='', get_country=True, user_name='', filepath=None, api_endpoint=None, location='', is_online=True, output_format='csv')\n",
" | PowerMeter(project_name='', program_name='', company_name='', cpu_power_log_path='', get_country=True, user_name='', filepath=None, api_endpoint=None, location='', is_online=True, output_format='csv')\n",
" | \n",
" | PowerMeter is a general tool to monitor and log the power consumption of any given function.\n",
" | \n",
Expand Down Expand Up @@ -150,7 +150,7 @@
" | \n",
" | __exit__(self, type, value, traceback)\n",
" | \n",
" | __init__(self, project_name='', program_name='', client_name='', cpu_power_log_path='', get_country=True, user_name='', filepath=None, api_endpoint=None, location='', is_online=True, output_format='csv')\n",
" | __init__(self, project_name='', program_name='', company_name='', cpu_power_log_path='', get_country=True, user_name='', filepath=None, api_endpoint=None, location='', is_online=True, output_format='csv')\n",
" | Initialize self. See help(type(self)) for accurate signature.\n",
" | \n",
" | measure_power(self, package, algorithm, data_type='', data_shape='', algorithm_params='', comments='', step='other')\n",
Expand Down Expand Up @@ -262,7 +262,7 @@
"source": [
"# Creates a power meter object that contains information relative to the current project\n",
"# You need to do this step no matter how you use the package\n",
"power_meter = PowerMeter(project_name=\"example\", program_name=\"CarbonAI\", client_name=\"IDE\", is_online=False, location=\"FR\")"
"power_meter = PowerMeter(project_name=\"example\", program_name=\"CarbonAI\", company_name=\"IDE\", is_online=False, location=\"FR\")"
],
"outputs": [],
"metadata": {
Expand Down Expand Up @@ -440,7 +440,10 @@
"output_type": "stream",
"name": "stdout",
"text": [
"The CarbonAImpact.MagicPowerMeter extension is already loaded. To reload it, use:\n",
"The CarbonAImpact.MagicPow

moazfarrukh marked this conversation as resolved.
Show resolved Hide resolved

erMeter extension is already loaded. To reload it, use:\n",
" %reload_ext CarbonAImpact.MagicPowerMeter\n"
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"project_name": "example",
"program_name": "CarbonAI",
"client_name": "IDE",
"company_name": "IDE",
"get_country": true,
"user_name": "TBD"
}
2 changes: 1 addition & 1 deletion examples/usage_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# power_meter = PowerMeter(
# project_name="example",
# program_name="CarbonAI",
# client_name="IDE",
# company_name="IDE",
# is_online=False,
# location="FR"
# )
Expand Down