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

Fix a bunch of typos #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
34 changes: 17 additions & 17 deletions eco2ai/emission_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(
The default is 1.
encode_file: str
If this parameter is not None, results of calculations will be encoded
and the results will be writen to file.
and the results will be written to file.
If this parameter == True encoded data will be written to file "encoded_" + value of file_name parameter.
So, default name of file with encoded data will be "encoded_emission.csv"
If this parameter is of str type, then name of file with encoded data will be value of encode_file parameter.
Expand All @@ -117,8 +117,8 @@ def __init__(
Every interval must be constructed as follows:
1) "hh:mm-hh:mm", hh - hours, mm - minutes. hh in [0, ..., 23], mm in [0, ..., 59]
2) Intervals should be consistent: they mustn't overlap and they should in chronological order.
Instantce of consistent intervals: "8:30-19:00", "19:00-6:00", "6:00-8:30"
Instantce of inconsistent intervals: "8:30-20:00", "18:00-3:00", "6:00-12:30"
Instance of consistent intervals: "8:30-19:00", "19:00-6:00", "6:00-8:30"
Instance of inconsistent intervals: "8:30-20:00", "18:00-3:00", "6:00-12:30"
3) Total duration of time intervals in hours must be 24 hours(1 day).
ignore_warnings: bool
If true, then user will be notified of all the warnings. If False, there won't be any warnings.
Expand Down Expand Up @@ -279,7 +279,7 @@ def consumption(self):

def price(self):
"""
This class method returns total electicity price
This class method returns total electricity price

Parameters
----------
Expand Down Expand Up @@ -368,7 +368,7 @@ def _construct_attributes_dict(self,):
Returns
-------
attributes_dict: dict
Dictionary with all the attibutes that should be written to .csv file
Dictionary with all the attributes that should be written to .csv file

"""
# if user used older versions, it may be needed to upgrade his .csv file
Expand Down Expand Up @@ -424,7 +424,7 @@ def _write_to_csv(
Returns
-------
attributes_dict: dict
Dictionary with all the attibutes that should be written to .csv file
Dictionary with all the attributes that should be written to .csv file

"""
# if user used older versions, it may be needed to upgrade his .csv file
Expand Down Expand Up @@ -526,7 +526,7 @@ def _func_for_sched(self, add_new=False):
Returns
-------
attributes_dict: dict
Dictionary with all the attibutes that should be written to .csv file
Dictionary with all the attributes that should be written to .csv file

"""
cpu_consumption = self._cpu.calculate_consumption()
Expand All @@ -535,14 +535,14 @@ def _func_for_sched(self, add_new=False):
gpu_consumption = self._gpu.calculate_consumption()
else:
gpu_consumption = 0
tmp_comsumption = 0
tmp_comsumption += cpu_consumption
tmp_comsumption += gpu_consumption
tmp_comsumption += ram_consumption
tmp_comsumption *= self._pue
tmp_consumption = 0
tmp_consumption += cpu_consumption
tmp_consumption += gpu_consumption
tmp_consumption += ram_consumption
tmp_consumption *= self._pue
if self._electricity_pricing is not None:
self._total_price += calculate_price(self._electricity_pricing, tmp_comsumption)
self._consumption += tmp_comsumption
self._total_price += calculate_price(self._electricity_pricing, tmp_consumption)
self._consumption += tmp_consumption

# self._consumption = 0
# self._start_time = time.time()
Expand Down Expand Up @@ -571,7 +571,7 @@ def start_training(self, start_epoch=1):
"""
if not isinstance(start_epoch, int):
raise TypeError(
f"\"start_epoch\" paramenet must be of int type. Now, it is {type(start_epoch)}"
f"\"start_epoch\" parameter must be of int type. Now, it is {type(start_epoch)}"
)

self._mode = "training"
Expand Down Expand Up @@ -641,7 +641,7 @@ def start(self):
raise IncorrectMethodSequenceError(
"""
You have already run ".start_training" method.
Please, use the interface for training: ".start_trainig", ".new_epoch", and "stop_training"
Please, use the interface for training: ".start_training", ".new_epoch", and "stop_training"
"""
)
if self._start_time is not None:
Expand Down Expand Up @@ -726,7 +726,7 @@ def _func_for_encoding(self, attributes_dict):
Parameters
----------
attributes_dict: dict
Dictionary with all the attibutes that should be written to .csv file
Dictionary with all the attributes that should be written to .csv file

Returns
-------
Expand Down
12 changes: 6 additions & 6 deletions eco2ai/tools/tools_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def tdp(self):

def set_consumption_zero(self):
"""
This class method sets CPU consumtion to zero.
This class method sets CPU consumption to zero.

Parameters
----------
Expand All @@ -92,7 +92,7 @@ def set_consumption_zero(self):

def get_consumption(self):
"""
This class method returns CPU power consupmtion amount.
This class method returns CPU power consumption amount.

Parameters
----------
Expand All @@ -110,7 +110,7 @@ def get_consumption(self):
def get_cpu_percent(self,):
"""
This class method calculates CPU utilization
taking into acount only python processes.
taking into account only python processes.
Method of calculating CPU utilization depends on operating system:
Windows, MacOS or Linux are only supported operating systems

Expand Down Expand Up @@ -221,7 +221,7 @@ def number_of_cpu(ignore_warnings=True):
except:
if not ignore_warnings:
warnings.warn(
message="\nYou probably should have installed 'util-linux' to deretmine cpu number correctly\nFor now, number of cpu devices is set to 1\n\n",
message="\nYou probably should have installed 'util-linux' to determine cpu number correctly\nFor now, number of cpu devices is set to 1\n\n",
category=NoNeededLibrary
)
cpu_num = 1
Expand All @@ -248,7 +248,7 @@ def number_of_cpu(ignore_warnings=True):
except:
if not ignore_warnings:
warnings.warn(
message="\nIt's impossible to deretmine cpu number correctly\nFor now, number of cpu devices is set to 1\n\n",
message="\nIt's impossible to determine cpu number correctly\nFor now, number of cpu devices is set to 1\n\n",
category=NoNeededLibrary
)
cpu_num = 1
Expand All @@ -273,7 +273,7 @@ def number_of_cpu(ignore_warnings=True):
# except:
# if not ignore_warnings:
# warnings.warn(
# message="\nIt's impossible to deretmine cpu number correctly\nFor now, number of cpu devices is set to 1\n\n",
# message="\nIt's impossible to determine cpu number correctly\nFor now, number of cpu devices is set to 1\n\n",
# category=NoNeededLibrary
# )
cpu_num = 1
Expand Down
20 changes: 10 additions & 10 deletions eco2ai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def available_devices():

Parameters
----------
No paarameters
No parameters

Returns
-------
Expand Down Expand Up @@ -85,7 +85,7 @@ def define_carbon_index(
):
"""
This function get an IP of user, defines country and region.
Then, it searchs user emission level by country and region in the emission level database.
Then, it searches user emission level by country and region in the emission level database.
If there is no certain country, then it returns worldwide constant.
If there is certain country in the database, but no certain region,
then it returns average country emission level.
Expand Down Expand Up @@ -150,7 +150,7 @@ def define_carbon_index(
if flag is False:
warnings.warn(
message=f"""
Your 'region' parameter value, which is '{region}', is not found in our region database for choosed country.
Your 'region' parameter value, which is '{region}', is not found in our region database for chosen country.
Please, check, if your region name is written correctly
"""
)
Expand All @@ -168,7 +168,7 @@ def electricity_pricing_check(
):
"""
This function takes electricity pricing dictionary and
check it if the dictionary is consctructed correctly.
check it if the dictionary is constructed correctly.
Rules for 'electricity_pricing' parameter construction is written below.

Parameters
Expand All @@ -179,8 +179,8 @@ def electricity_pricing_check(
Every interval must be constructed as follows:
1) "hh:mm-hh:mm", hh - hours, mm - minutes. hh in [0, ..., 23], mm in [0, ..., 59]
) Intervals should be consistent: they mustn't overlap and they should in chronological order.
Instantce of consistent intervals: "8:30-19:00", "19:00-6:00", "6:00-8:30"
Instantce of inconsistent intervals: "8:30-20:00", "18:00-3:00", "6:00-12:30"
Instance of consistent intervals: "8:30-19:00", "19:00-6:00", "6:00-8:30"
Instance of inconsistent intervals: "8:30-20:00", "18:00-3:00", "6:00-12:30"
3) Total duration of time intervals in hours must be 24 hours(1 day).

Returns
Expand Down Expand Up @@ -274,8 +274,8 @@ def calculate_price(
Every interval must be constructed as follows:
1) "hh:mm-hh:mm", hh - hours, mm - minutes. hh in [0, ..., 23], mm in [0, ..., 59]
) Intervals should be consistent: they mustn't overlap and they should in chronological order.
Instantce of consistent intervals: "8:30-19:00", "19:00-6:00", "6:00-8:30"
Instantce of inconsistent intervals: "8:30-20:00", "18:00-3:00", "6:00-12:30"
Instance of consistent intervals: "8:30-19:00", "19:00-6:00", "6:00-8:30"
Instance of inconsistent intervals: "8:30-20:00", "18:00-3:00", "6:00-12:30"
3) Total duration of time intervals in hours must be 24 hours(1 day).


Expand Down Expand Up @@ -397,7 +397,7 @@ def get_params():
dictionary = json.loads(json_file.read())
else:
dictionary = {
"project_name": "Deafult project name",
"project_name": "Default project name",
"experiment_description": "no experiment description",
"file_name": "emission.csv",
"measure_period": 10,
Expand Down Expand Up @@ -443,7 +443,7 @@ def encode(f_string):

def encode_dataframe(values):
"""
This function encodes every value of a two-dimentional array
This function encodes every value of a two-dimensional array

Parameters
----------
Expand Down