PyGamLab.Convertors Module¶
The PyGamLab.Convertors module offers a wide range of unit conversion tools, allowing for seamless and accurate transformations between various scientific and engineering units. This module supports both direct and reverse conversions, providing flexibility in tasks such as dimensional analysis, data preprocessing, and unit consistency verification.
Whether you’re working with temperature, pressure, energy, or any other physical quantity, the PyGamLab.Convertors module ensures that all unit transformations are performed efficiently and with high precision. The intuitive function names and clear structure of the module make it an invaluable asset for anyone working in scientific computing or modeling.
### Benefits of the Convertors Module: - Wide Coverage: Supports a broad set of conversions, from basic units like length and mass to more specialized conversions in physics and engineering. - Bidirectional Conversions: Easily convert between units and their reverses (e.g., from Celsius to Kelvin and vice versa). - Precision: All conversions are accurate, ensuring that your calculations maintain scientific integrity. - Ease of Use: Designed for quick, simple integration into Python-based workflows, making unit conversion seamless for your projects.
@author: Ali Pilehvar Meibody (Alipilehvar1999@gmail.com)
@Director of Gamlab: Professor M. Naderi (Mnaderi@aut.ac.ir)
@Graphene Advanced Material Laboratory: https://www.GamLab.Aut.ac.ir
@Co-authors:
- PyGamLab.Convertors.Angstrom_To_Meter(A)[source]¶
Convert the given value in angstroms to meters.
- Parameters:
A (float) – The value in angstroms to be converted.
- Returns:
The equivalent value in meters.
- Return type:
float
- PyGamLab.Convertors.Angstrom_To_Micrometer(A)[source]¶
Convert the given value in angstroms to micrometers.
- Parameters:
A (float) – The value in angstroms to be converted.
- Returns:
The equivalent value in micrometers.
- Return type:
float
- PyGamLab.Convertors.Angstrom_To_Millimeter(A)[source]¶
Convert the given value in angstroms to millimeters.
- Parameters:
A (float) – The value in angstroms to be converted.
- Returns:
The equivalent value in millimeters.
- Return type:
float
- PyGamLab.Convertors.Angstrom_To_Nanometer(Angstrom_value)[source]¶
This function converts Angstroms to Nanometers.
- Parameters:
Angstrom_value (int or Float) – Value in angstroms (Å).
- Returns:
Nanometer_value – Equivalent value in Nanometers (nm).
- Return type:
int or Float
- PyGamLab.Convertors.Annual_To_Monthly_Loss(annual_loss)[source]¶
- Parameters:
annual_loss (int) – the annual loss of an Economic enterprise.
- Returns:
the monthly loss of an Economic enterprise.
- PyGamLab.Convertors.Atmosphere_To_Pascal(atm)[source]¶
Convert the given value in atmospheres to pascals.
- Parameters:
atm (float) – The value in atmospheres to be converted.
- Returns:
The equivalent value in pascals.
- Return type:
float
- PyGamLab.Convertors.Bar_To_Pascal(bar)[source]¶
Converts bar to pascal.
- Parameters:
bar (float) – bar.
- Returns:
Pa – pascal
- Return type:
float
- PyGamLab.Convertors.Brinell_To_Rockwell(hb)[source]¶
convert Brinell hardness (HB) to Rockwell hardness (HRB)
- Parameters:
hb (float) – hardness in Brinell scale.
float (Returns)
- PyGamLab.Convertors.Byte_To_Kilobyte(b)[source]¶
Convert the given value in bytes to kilobytes.
- Parameters:
b (int) – The value in bytes to be converted.
- Returns:
The equivalent value in kilobytes.
- Return type:
float
- PyGamLab.Convertors.CC_per_Second_To_Liter_per_Minute_Welding_Gas_Flow_Rate_Converter(CC_per_Second)[source]¶
This function converts the Welding Gas Flow Rate from CC per Second to Liter per Minute.
- Parameters:
CC_per_Second (float) – CC_per_Second is a unit for gas flow rate in welding.
- Return type:
Liter_per_Minute is a unit for gas flow rate in welding.
- PyGamLab.Convertors.Calories_To_Joules(cal)[source]¶
- Parameters:
cal (float) – Calories.
- Returns:
J – Converts calories to joules.
- Return type:
float
- PyGamLab.Convertors.Celcius_To_Kelvin(Celcius)[source]¶
Convert the given temperature in Celsius to Kelvin.
- Parameters:
Celcius (float) – The temperature in Celsius to be converted.
- Returns:
The equivalent temperature in Kelvin.
- Return type:
float
Notes
The temperature in Celsius is offset by 273.15 to convert to Kelvin.
- PyGamLab.Convertors.Centigrade_To_Fahrenheit(C)[source]¶
Convert the given temperature in Celsius (Centigrade) to Fahrenheit.
- Parameters:
C (float) – The temperature in Celsius to be converted.
- Returns:
The equivalent temperature in Fahrenheit.
- Return type:
float
- PyGamLab.Convertors.Centimeter_per_Minute_To_Meter_per_Hour_Welding_Speed_Converter(Centimeter_per_Minute)[source]¶
This function converts the Welding Speed from Centimeter per Minute to Meter per Hour.
- Parameters:
Centimeter_per_Minute (float) – Centimeter_per_Minute is a unit for welding speed.
- Return type:
Meter_per_Hour is a unit for welding speed.
- PyGamLab.Convertors.CmHg_To_Pascal(P1)[source]¶
Convert the given pressure in centimeters of mercury to pascals.
- Parameters:
P1 (float) – The pressure in centimeters of mercury to be converted.
- Returns:
The equivalent pressure in pascals.
- Return type:
float
- PyGamLab.Convertors.Coulomb_To_Electron_volt(coulomb)[source]¶
Convert the given value in coulombs to electron volts.
- Parameters:
coulomb (float) – The value in coulombs to be converted.
- Returns:
The equivalent value in electron volts.
- Return type:
float
Notes
1 coulomb = 6.24e18 electron volts.
- PyGamLab.Convertors.Cubic_Meter_To_Liter(number_in_Cubic_Meter)[source]¶
This function converts cubic meters to liters.
- Parameters:
number_in_Cubic_Meter (int or float) – Number per cubic meter unit.
Liter (int or float) – Number per liter unit.
- PyGamLab.Convertors.Current_density_To_mpy(Current_density, density, masschange, valency)[source]¶
- Current_densityfloat
Current density .(microA/cm2)
- densityfloat
Material Density (g/cm3).
- masschangefloat
amount of matter already corroded (g)
- valencyintiger
How positive is the charge of the Material
corrosion rate in mpy
- PyGamLab.Convertors.Decimal_To_Binary(Num_dec)[source]¶
Converts a decimal number to its binary representation.
- Parameters:
Num_dec (int) – The decimal number to convert.
- Returns:
The binary representation of the decimal number.
- Return type:
int
- PyGamLab.Convertors.Degree_To_Radian(deg)[source]¶
Converts values of angle from degree to radian.
- Parameters:
deg (float) – The angle value in degrees.
- Returns:
The angle value in radians.
- Return type:
float
- PyGamLab.Convertors.Electron_volt_To_Coulomb(electron_volt)[source]¶
Converts energy value from electronvolts to coulombs (assuming it refers to charge equivalent). Note: This conversion is based on the elementary charge.
- Parameters:
electron_volt (float) – The energy value in electronvolts.
- Returns:
The equivalent charge value in coulombs.
- Return type:
float
- PyGamLab.Convertors.Electronvolt_To_Joule(e_v)[source]¶
Converts energy value from electronvolts to joules.
- Parameters:
e_v (float) – The energy value in electronvolts.
- Returns:
The energy value in joules.
- Return type:
float
- PyGamLab.Convertors.Fabric_GSM_to_GLM(Fabric_Weight, Fabric_Width)[source]¶
This function converts fabric weight in GSM unit to GLM unit.
- Fabric_Weightint or float
fabric weight per GSM.
- Fabric_Widthint or float
width of fabric per inches.
- Fabric_GLMint or float
Result.
- PyGamLab.Convertors.Fahrenheit_To_Centigrade(F)[source]¶
Converts a temperature value from Fahrenheit to Centigrade (Celsius).
- Parameters:
F (float) – The temperature value in Fahrenheit.
- Returns:
The temperature value in Centigrade (Celsius).
- Return type:
float
- PyGamLab.Convertors.Foot_Pound_To_Newton(Foot_Pounds)[source]¶
# This Conventor convert ft-lbs to Nm
- Parameters:
Foot_Pound (a unit of torque equal to the force of 1 lb acting perpendicularly to)
foot.(ft-lbs) (an axis of rotation at a distance of 1)
- Returns:
Newton_Meters
- Return type:
The newton-metre is the unit of torque.(Nm)
- PyGamLab.Convertors.Foot_To_Mile(ft)[source]¶
Converts a length value from feet to miles.
- Parameters:
ft (float) – The length value in feet.
- Returns:
The length value in miles.
- Return type:
float
- PyGamLab.Convertors.Force_CGS_To_SI(Force_in_CGS)[source]¶
- Parameters:
Force_In_CGS (float) – give your force value in CGS system.
- Returns:
SI – return your force value in SI system.
- Return type:
float
- PyGamLab.Convertors.Force_SI_To_CGS(Force_in_SI)[source]¶
- Parameters:
Force_in_SI (float) – give your force value in SI system.
- Returns:
CGS – return your force value in CGS system.
- Return type:
float
- PyGamLab.Convertors.Gram_To_Mole(g, MW)[source]¶
This function calaculates the eqivalent amount of substance of a compound in mole(s) base on mass in gram(s).
- Parameters:
g (float) – g is the mass of a compound in gram(s).
MW (float) – MW is the Molecular weight of a compound (gram/mol).
- Returns:
Mole – Mole is the eqivalent amount of substance of a compound in mole(s).
- Return type:
float
- PyGamLab.Convertors.Hertz_To_Rpm(a, /)[source]¶
A converter machine to convert frequency in Hertz(Hz) to frequency in rpm. :type a: :param a: frequency, Hertz(Hz). :type a: int or float :param Returns: :param b: :type b: int or float :param frequency: :param revolution per minute (rpm):
- PyGamLab.Convertors.Horsepower_To_Watt(Horsepower)[source]¶
- Parameters:
Horsepower (float) – give number in horsepower.
- Returns:
watt – return your number in watt.
- Return type:
float
- PyGamLab.Convertors.Hour_To_Sec(t)[source]¶
Converts a time value from hours to seconds.
- Parameters:
t (float) – The time value in hours.
- Returns:
The time value in seconds.
- Return type:
float
- PyGamLab.Convertors.Inch_To_Centimeter(Inch)[source]¶
- Parameters:
Inch (float or int) – ne inch is equal to 2.54 centimeters. number per Inch unit.
- Returns:
Centimeter – number per Centimeter unit.
- Return type:
float
- PyGamLab.Convertors.Inch_To_Meter(In)[source]¶
Converts a length value from inches to meters.
- Parameters:
In (float) – The length value in inches.
- Returns:
The length value in meters.
- Return type:
float
- PyGamLab.Convertors.Joules_Per_Minute_To_Kilowatt(Joules_Per_Minute)[source]¶
- Parameters:
Joules_Per_Minute (float) – number per Joules unit.
- Returns:
Kilowatt – number per Kilowatt unit.
- Return type:
float
- PyGamLab.Convertors.Joules_To_Calories(J)[source]¶
- Parameters:
J (float) – Joules.
- Returns:
cal – Converts joules to calories.
- Return type:
float
- PyGamLab.Convertors.Kelvin_to_Celcius(Kelvin)[source]¶
This function is used to convert Kelvin to Celsius. The temperature in Celsius is different from the temperature in Kelvin by 273.15.
- Parameters:
Kelvin (float) – The temperature value in Kelvin.
- Returns:
The temperature value in Celsius.
- Return type:
float
- PyGamLab.Convertors.Kg_To_Lbm(Kg)[source]¶
Converts a mass value from kilograms to pounds (lbm).
- Parameters:
Kg (float) – The mass value in kilograms.
- Returns:
The mass value in pounds (lbm).
- Return type:
float
- PyGamLab.Convertors.Kg_To_Ton(Kg)[source]¶
Converts a mass value from kilograms to metric tons.
- Parameters:
Kg (float) – The mass value in kilograms.
- Returns:
The mass value in metric tons.
- Return type:
float
- PyGamLab.Convertors.KiloMeter_To_LightYear(km)[source]¶
Converts a distance value from kilometers to light-years.
- Parameters:
km (float) – The distance value in kilometers.
- Returns:
The distance value in light-years.
- Return type:
float
- PyGamLab.Convertors.Kilobyte_To_Byte(kb)[source]¶
Converts a data size value from kilobytes to bytes.
- Parameters:
kb (float) – The data size value in kilobytes.
- Returns:
The data size value in bytes.
- Return type:
float
- PyGamLab.Convertors.Kilogeram_Per_Cubic_Meter_To_Pounds_Per_Cubic_Inch(KgPerCubicMeter)[source]¶
Converts a density value from kilograms per cubic meter to pounds per cubic inch.
- Parameters:
KgPerCubicMeter (float) – The density value in kilograms per cubic meter.
- Returns:
The density value in pounds per cubic inch.
- Return type:
float
- PyGamLab.Convertors.Kilogram_To_Pound(number_in_kilogram)[source]¶
This function converts the desired number from kilograms to pounds.
- Parameters:
number_in_kilogram (int) – Number per kilogram.
- Returns:
pound – Number per pound.
- Return type:
int
- PyGamLab.Convertors.Kilometer_Per_Hour_To_Meter_Per_Second(kph)[source]¶
Converts a speed value from kilometers per hour to meters per second.
- Parameters:
kph (float) – The speed value in kilometers per hour.
- Returns:
The speed value in meters per second.
- Return type:
float
- PyGamLab.Convertors.Kmph_To_Mps(V1)[source]¶
This function is used to convert kilometers per hour to meters per second.
- Parameters:
V1 (float) – The speed value in kilometers per hour.
- Returns:
The speed value in meters per second.
- Return type:
float
- PyGamLab.Convertors.Lbm_To_Kg(Lbm)[source]¶
Converts a mass value from pounds (lbm) to kilograms.
- Parameters:
Lbm (float) – The mass value in pounds (lbm).
- Returns:
The mass value in kilograms.
- Return type:
float
- PyGamLab.Convertors.LightYear_To_KiloMeter(ly)[source]¶
Converts a distance value from light-years to kilometers.
- Parameters:
ly (float) – The distance value in light-years.
- Returns:
The distance value in kilometers.
- Return type:
float
- PyGamLab.Convertors.Liter_To_Cubic_Meter(number_in_Liter)[source]¶
This function converts liters to cubic meters.
- Parameters:
number_in_Liter (int or float) – Number per liter unit.
Cubic_Meter (int or float) – Number per cubic meter unit.
- PyGamLab.Convertors.Liter_per_Minute_To_CC_per_Second_Welding_Gas_Flow_Rate_Converter(Liter_per_Minute)[source]¶
This function converts the Welding Gas Flow Rate from Liter per Minute to CC per Second.
- Parameters:
Liter_per_Minute (float) – Liter_per_Minute is a unit for gas flow rate in welding.
- Return type:
CC_per_Second is a unit for gas flow rate in welding.
- PyGamLab.Convertors.Mass_To_Mole(Mass, Molar_Mass)[source]¶
- Parameters:
Mass (float) – The mass of substance(g).
Molar_Mass (float) – The mass of one mole of substance (g/mol).
- Returns:
Mole
- Return type:
int
- PyGamLab.Convertors.Megapascal_To_Pascal(Megapascal)[source]¶
#This Conventor Convert Megapascal to Pascal
- Parameters:
Megapascal (1 Megapascal equals 1,000,000 Pascals.)
- Returns:
Pascal
- Return type:
the unit of pressure or stress in SI.
- PyGamLab.Convertors.Meter_Per_Second_To_Kilometer_Per_Hour(mps)[source]¶
- Parameters:
mps (float) – number in meter per second
kph (float) – number in kilometer per hour
- PyGamLab.Convertors.Meter_To_Angstrom(m)[source]¶
Converts a length value from meters to Angstroms.
- Parameters:
m (float) – The length value in meters.
- Returns:
The length value in Angstroms.
- Return type:
float
- PyGamLab.Convertors.Meter_To_MilliMeter(meter)[source]¶
- Parameters:
meter (int) – enter the length in meter.
- Returns:
milimeter – This function converts meter into milimeter.
- Return type:
int
- PyGamLab.Convertors.Meter_To_inch(m)[source]¶
Converts a length value from meters to inches.
- Parameters:
m (float) – The length value in meters.
- Returns:
The length value in inches.
- Return type:
float
- PyGamLab.Convertors.Meter_per_Hour_To_Centimeter_per_Minute_Welding_Speed_Converter(Meter_per_Hour)[source]¶
This function converts the Welding Speed from Meter per Hour to Centimeter per Minute.
- Parameters:
Meter_per_Hour (float) – Meter_per_Hour is a unit for welding speed.
- Return type:
Centimeter_per_Minute is a unit for welding speed.
- PyGamLab.Convertors.Micrometer_To_Angstrom(um)[source]¶
Converts a length value from micrometers to Angstroms.
- Parameters:
um (float) – The length value in micrometers.
- Returns:
The length value in Angstroms.
- Return type:
float
- PyGamLab.Convertors.Micrometer_To_Nanometer(micrometer)[source]¶
converting micrometer to nanometer
- Parameters:
micrometer (float,dimension) – DESCRIPTION. The default is 1.
- Returns:
Nanometer – unit(nm)
- Return type:
float,dimension
- PyGamLab.Convertors.Mile_To_Foot(mi)[source]¶
Converts a length value from miles to feet.
- Parameters:
mi (float) – The length value in miles.
- Returns:
The length value in feet.
- Return type:
float
- PyGamLab.Convertors.Milimeter_To_Angstrom(mm)[source]¶
Converts a length value from millimeters to Angstroms.
- Parameters:
mm (float) – The length value in millimeters.
- Returns:
The length value in Angstroms.
- Return type:
float
- PyGamLab.Convertors.Miller_To_Millerbrove(u, v, w)[source]¶
this function converts miller index to miller_brove index
1. u: int Intersection with axis a1
2. v: int Intersection with axis a2
3. w: int Intersection with axis z
Returns –> (miller_brove indexes)
1. l: int Intersection with axis a1
2. m: int Intersection with axis a2
3. n: int Intersection with axis a3
4. o: int Intersection with axis z
- PyGamLab.Convertors.Millerbrove_To_Miller(l, m, n, o)[source]¶
this function converts miller_brove index to miller index
Parameters: (miller_brove indexes)¶
l: int
Intersection with axis a1
2. m: int Intersection with axis a2
3. n: int Intersection with axis a3
4. o: int Intersection with axis z
Returns –> (miller indexes)
1. u: int Intersection with axis a1
2. v: int Intersection with axis a2
3. w: int Intersection with axis z
- PyGamLab.Convertors.MilliMeter_To_Meter(milimeter)[source]¶
- Parameters:
milimeter (int) – enter the length in milimeter.
- Returns:
meter – This function converts milimeter into meter.
- Return type:
int
- PyGamLab.Convertors.Mils_year_To_Mm_year(mpy)[source]¶
Converts a corrosion rate from mils per year (mpy) to millimeters per year (mm/yr). 1 mm/yr = 39.37 mpy
- Parameters:
mpy (float) – The corrosion rate in mils per year.
- Returns:
The corrosion rate in millimeters per year.
- Return type:
float
- PyGamLab.Convertors.Minute_To_Second(Minute)[source]¶
This function converts minutes to seconds
- Parameters:
Minute (int) – units of time in minute
Returns
int – Minute_to_Second
- PyGamLab.Convertors.Mm_year_To_Mils_year(milpy)[source]¶
Converts a corrosion rate from millimeters per year (mm/yr) to mils per year (mpy). 1 mm/yr = 39.37 mpy
- Parameters:
milpy (float) – The corrosion rate in millimeters per year.
- Returns:
The corrosion rate in mils per year.
- Return type:
float
- PyGamLab.Convertors.Molarity_To_Normality(Molarity, n)[source]¶
- Parameters:
Molarity (float)
n (int) – Number of moles.
- Return type:
Normality.
- PyGamLab.Convertors.Mole_To_Gram(mol, MW)[source]¶
This function calaculates the eqivalent mass of a compound in gram(s) base on amount of substance in mole(s).
- Parameters:
mol (float) – mol is the eqivalent amount of substance of a compound in mole(s).
MW (float) – MW is the Molecular weight of a compound (gram/mole).
- Returns:
g – g is the eqivalent mass in of a compound in in gram(s).
- Return type:
float
- PyGamLab.Convertors.Mole_To_Mass(Mole, Molar_Mass)[source]¶
- Parameters:
Mole (int)
Molar_Mass (float) – The mass of one mole of substance (g/mol).
- Returns:
Mass (g)
- Return type:
Float.
- PyGamLab.Convertors.Mpa_To_Psi(Num_Mpa, /)[source]¶
- Parameters:
Num_Mpa (float) – Megapascals=Newton per square millimetre
- Returns:
Psi – Psi=Pounds force per square inch
- Return type:
float
- PyGamLab.Convertors.Mps_To_Kmph(V1)[source]¶
This function is used to convert meter per second to kilometer per hour.
- Parameters:
V1 (float) – The speed value in meters per second.
- Returns:
The speed value in kilometers per hour.
- Return type:
float
- PyGamLab.Convertors.Mpy_To_current_density(mpy, density, masschange, valency)[source]¶
- Parameters:
mpy (float) – corrosion rate in mpy
density (float) – materails density
masschange (float) – amount of mass corroded
valency (int) – how positive is the charge
- Return type:
Current density
- PyGamLab.Convertors.Nanometer_To_Angstrom(Nanometer_value)[source]¶
This function converts Nanometers to Angstroms. 1 Nanometer(nm)= 10 Angstroms(Å)
- Parameters:
Nanometer_value (int or float) – Value in Nanometers(nm).
- Returns:
Angstrom_value – Equivalent value in Angstroms(Å).
- Return type:
int or float
- PyGamLab.Convertors.Nanometer_To_Micrometer(nanometer)[source]¶
converting nanometer to micrometer
- Parameters:
nanometer (float,dimension) – unit (nm) DESCRIPTION. The default is 1.
- Returns:
Micrometer
- Return type:
float,dimension
- PyGamLab.Convertors.Newton_To_Foot_Pound(Newton_Meters)[source]¶
# This Conventor convert Nm to ft-lbs
- Parameters:
Newton_Meters (The newton-metre is the unit of torque.(Nm))
- Returns:
Foot_Pound (a unit of torque equal to the force of 1 lb acting perpendicularly to)
an axis of rotation at a distance of 1 foot.(ft-lbs)
- PyGamLab.Convertors.Normality_To_Molarity(Normality, n)[source]¶
- Parameters:
Normality (float)
n (int) – Number of moles.
- Return type:
Molarity.
- PyGamLab.Convertors.Pascal_To_Atmosphere(Pa)[source]¶
Converts a pressure value from Pascals to atmospheres.
- Parameters:
Pa (float) – The pressure value in Pascals.
- Returns:
The pressure value in atmospheres.
- Return type:
float
- PyGamLab.Convertors.Pascal_To_Bar(Pa)[source]¶
- Parameters:
Pa (float) – Pascal.
- Returns:
bar – Converts pascal to bar.
- Return type:
float
- PyGamLab.Convertors.Pascal_To_CmHg(P1)[source]¶
This function is used to convert Pascal to centimeter mercury.
- Parameters:
P1 (float) – The pressure value in Pascals.
- Returns:
The pressure value in centimeters of mercury (cmHg).
- Return type:
float
- PyGamLab.Convertors.Pascal_To_Megapascal(Pascal)[source]¶
# This Conventor Convert Pascal to Megapascal
- Parameters:
Pascal (the unit of pressure or stress in SI.)
- Returns:
Megapascal
- Return type:
1 Megapascal equals 1,000,000 Pascals.
- PyGamLab.Convertors.Pascal_To_Torr(pa)[source]¶
This function converts Pascal to Torr.
- Parameters:
pa (float) – The pressure value in Pascals.
- Returns:
The pressure value in Torr.
- Return type:
float
- PyGamLab.Convertors.Pascal_to_mmHg(p)[source]¶
This function convert pascal to mmHg
- Parameters:
p (float) – pressure (Pa).
- Return type:
None.
- PyGamLab.Convertors.Percent_To_Ppm(a)[source]¶
Converts a concentration value from percent to parts per million (ppm).
- Parameters:
a (float) – The ion percent in brine.
- Returns:
The ion concentration in ppm in brine.
- Return type:
float
- PyGamLab.Convertors.Percentages_To_Moles(total, percentages)[source]¶
Calculates the number of moles of each component in a mixture given their percentages by weight and the total weight.
- Parameters:
total (float) – The total weight of the mixture.
percentages (dict) – A dictionary where keys are the names of the materials and values are their weight percentages.
- Returns:
A dictionary where keys are the names of the materials and values are their corresponding number of moles.
- Return type:
dict
- PyGamLab.Convertors.Pound_To_Kilogram(number_in_pound)[source]¶
This function converts the desired number from pounds to kilograms.
- Parameters:
number_in_pound (int) – Number per pound.
- Returns:
kilogram – Number per kilogram.
- Return type:
int
- PyGamLab.Convertors.Pounds_Per_Cubic_Inch_To_Kilogeram_Per_Cubic_Meter(LbPerCubicInch)[source]¶
Converts a density value from pounds per cubic inch to kilograms per cubic meter.
- Parameters:
LbPerCubicInch (float) – The density value in pounds per cubic inch.
- Returns:
The density value in kilograms per cubic meter.
- Return type:
float
- PyGamLab.Convertors.Ppm_To_Percent(a)[source]¶
Converts a concentration value from parts per million (ppm) to percent.
- Parameters:
a (float) – The ion concentration in ppm in brine.
- Returns:
The ion percent in brine.
- Return type:
float
- PyGamLab.Convertors.Psi_To_Mpa(Num_Psi, /)[source]¶
- Parameters:
Num_Psi (float) – Psi = Pounds force per square inch
- Returns:
Mpa – Megapascals=Newton per square millimetre
- Return type:
float
- PyGamLab.Convertors.Radians_To_Degrees(num)[source]¶
This function is used to convert radians to degrees.
- Parameters:
num (float) – The angle value in radians.
- Returns:
The angle value in degrees.
- Return type:
float
- PyGamLab.Convertors.Rpm_To_Hertz(b, /)[source]¶
- A converter machine to convert frequency in rpm to frequency in Herta(Hz).
- bint or float
frequency, revolution per minute (rpm).
Returns a, frequency, Hertz(Hz)
- PyGamLab.Convertors.Sec_To_Hour(t)[source]¶
Converts a time value from seconds to hours.
- Parameters:
t (float) – The time value in seconds.
- Returns:
The time value in hours.
- Return type:
float
- PyGamLab.Convertors.Second_To_Minute(Second)[source]¶
- This function converts seconds to minutes
Parameters
- Secondint
units of time in seconds
Returns int
Second_to_Minute
- PyGamLab.Convertors.Square_Cm_To_Square_meter(a)[source]¶
- Parameters:
a (int) – Square_Cm
-------
c (int) – Square_Meter
- PyGamLab.Convertors.Square_Meter_To_Square_Cm(b)[source]¶
- Parameters:
b (int) – Square_meter
-------
c (int) – Square_Cm
- PyGamLab.Convertors.Torr_To_Pascal(torr)[source]¶
This function converts Torr to Pascal.
- Parameters:
torr (float) – The pressure value in Torr.
- Returns:
The pressure value in Pascals.
- Return type:
float
- PyGamLab.Convertors.Viscosity_To_Pas(poise)[source]¶
Converts dynamic viscosity from Poise (P) to Pascal-seconds (Pa·s).
- Parameters:
poise (float) – The dynamic viscosity in Poise.
- Returns:
The dynamic viscosity in Pascal-seconds.
- Return type:
float
- PyGamLab.Convertors.Viscosity_To_Poise(pa_s)[source]¶
Converts dynamic viscosity from Pascal-seconds (Pa·s) to Poise (P).
- Parameters:
pa_s (float) – The dynamic viscosity in Pascal-seconds.
- Returns:
The dynamic viscosity in Poise.
- Return type:
float
- PyGamLab.Convertors.Watt_To_Horsepower(Watt)[source]¶
- Parameters:
Watt (float) – give number in Watt.
- Returns:
Horsepower – return number in Horsepower.
- Return type:
float
- PyGamLab.Convertors.Weightpercent_To_ppm(num)[source]¶
This function is used to convert weight percent to ppm (parts per million).
- Parameters:
num (float) – The concentration in weight percent.
- Returns:
The concentration in ppm.
- Return type:
float
- PyGamLab.Convertors.Yarn_Count_Converter(Yarn_Count, Current_System='tex', Desired_System='den')[source]¶
This function converts yarn count values in different systems.
- Parameters:
Yarn_Count (int or float) – Number of yarn count.
Current_System (str, optional) – Current yarn count system. The default is ‘tex’.
Desired_System (str, optional) – Expected yarn count system. The default is ‘den’.
Yarn_Count – Result.