From dc188b143f2332bd7f086449c92c1c7ce9496fa2 Mon Sep 17 00:00:00 2001 From: Haim Kastner Date: Sat, 9 Mar 2024 20:58:44 +0200 Subject: [PATCH] Add DTO documentation --- .../templates/unit_template.jinja2 | 37 +++++++++++++++++++ .../absorbed_dose_of_ionizing_radiation.py | 37 +++++++++++++++++++ unitsnet_py/units/acceleration.py | 37 +++++++++++++++++++ unitsnet_py/units/amount_of_substance.py | 37 +++++++++++++++++++ unitsnet_py/units/amplitude_ratio.py | 37 +++++++++++++++++++ unitsnet_py/units/angle.py | 37 +++++++++++++++++++ unitsnet_py/units/apparent_energy.py | 37 +++++++++++++++++++ unitsnet_py/units/apparent_power.py | 37 +++++++++++++++++++ unitsnet_py/units/area.py | 37 +++++++++++++++++++ unitsnet_py/units/area_density.py | 37 +++++++++++++++++++ unitsnet_py/units/area_moment_of_inertia.py | 37 +++++++++++++++++++ unitsnet_py/units/bit_rate.py | 37 +++++++++++++++++++ .../units/brake_specific_fuel_consumption.py | 37 +++++++++++++++++++ unitsnet_py/units/capacitance.py | 37 +++++++++++++++++++ .../units/coefficient_of_thermal_expansion.py | 37 +++++++++++++++++++ unitsnet_py/units/compressibility.py | 37 +++++++++++++++++++ unitsnet_py/units/density.py | 37 +++++++++++++++++++ unitsnet_py/units/duration.py | 37 +++++++++++++++++++ unitsnet_py/units/dynamic_viscosity.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_admittance.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_charge.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_charge_density.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_conductance.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_conductivity.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_current.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_current_density.py | 37 +++++++++++++++++++ .../units/electric_current_gradient.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_field.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_inductance.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_potential.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_potential_ac.py | 37 +++++++++++++++++++ .../units/electric_potential_change_rate.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_potential_dc.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_resistance.py | 37 +++++++++++++++++++ unitsnet_py/units/electric_resistivity.py | 37 +++++++++++++++++++ .../units/electric_surface_charge_density.py | 37 +++++++++++++++++++ unitsnet_py/units/energy.py | 37 +++++++++++++++++++ unitsnet_py/units/energy_density.py | 37 +++++++++++++++++++ unitsnet_py/units/entropy.py | 37 +++++++++++++++++++ unitsnet_py/units/force.py | 37 +++++++++++++++++++ unitsnet_py/units/force_change_rate.py | 37 +++++++++++++++++++ unitsnet_py/units/force_per_length.py | 37 +++++++++++++++++++ unitsnet_py/units/frequency.py | 37 +++++++++++++++++++ unitsnet_py/units/fuel_efficiency.py | 37 +++++++++++++++++++ unitsnet_py/units/heat_flux.py | 37 +++++++++++++++++++ .../units/heat_transfer_coefficient.py | 37 +++++++++++++++++++ unitsnet_py/units/illuminance.py | 37 +++++++++++++++++++ unitsnet_py/units/impulse.py | 37 +++++++++++++++++++ unitsnet_py/units/information.py | 37 +++++++++++++++++++ unitsnet_py/units/irradiance.py | 37 +++++++++++++++++++ unitsnet_py/units/irradiation.py | 37 +++++++++++++++++++ unitsnet_py/units/jerk.py | 37 +++++++++++++++++++ unitsnet_py/units/kinematic_viscosity.py | 37 +++++++++++++++++++ unitsnet_py/units/leak_rate.py | 37 +++++++++++++++++++ unitsnet_py/units/length.py | 37 +++++++++++++++++++ unitsnet_py/units/level.py | 37 +++++++++++++++++++ unitsnet_py/units/linear_density.py | 37 +++++++++++++++++++ unitsnet_py/units/linear_power_density.py | 37 +++++++++++++++++++ unitsnet_py/units/luminance.py | 37 +++++++++++++++++++ unitsnet_py/units/luminosity.py | 37 +++++++++++++++++++ unitsnet_py/units/luminous_flux.py | 37 +++++++++++++++++++ unitsnet_py/units/luminous_intensity.py | 37 +++++++++++++++++++ unitsnet_py/units/magnetic_field.py | 37 +++++++++++++++++++ unitsnet_py/units/magnetic_flux.py | 37 +++++++++++++++++++ unitsnet_py/units/magnetization.py | 37 +++++++++++++++++++ unitsnet_py/units/mass.py | 37 +++++++++++++++++++ unitsnet_py/units/mass_concentration.py | 37 +++++++++++++++++++ unitsnet_py/units/mass_flow.py | 37 +++++++++++++++++++ unitsnet_py/units/mass_flux.py | 37 +++++++++++++++++++ unitsnet_py/units/mass_fraction.py | 37 +++++++++++++++++++ unitsnet_py/units/mass_moment_of_inertia.py | 37 +++++++++++++++++++ unitsnet_py/units/molality.py | 37 +++++++++++++++++++ unitsnet_py/units/molar_energy.py | 37 +++++++++++++++++++ unitsnet_py/units/molar_entropy.py | 37 +++++++++++++++++++ unitsnet_py/units/molar_flow.py | 37 +++++++++++++++++++ unitsnet_py/units/molar_mass.py | 37 +++++++++++++++++++ unitsnet_py/units/molarity.py | 37 +++++++++++++++++++ unitsnet_py/units/permeability.py | 37 +++++++++++++++++++ unitsnet_py/units/permittivity.py | 37 +++++++++++++++++++ .../units/porous_medium_permeability.py | 37 +++++++++++++++++++ unitsnet_py/units/power.py | 37 +++++++++++++++++++ unitsnet_py/units/power_density.py | 37 +++++++++++++++++++ unitsnet_py/units/power_ratio.py | 37 +++++++++++++++++++ unitsnet_py/units/pressure.py | 37 +++++++++++++++++++ unitsnet_py/units/pressure_change_rate.py | 37 +++++++++++++++++++ .../units/radiation_equivalent_dose.py | 37 +++++++++++++++++++ unitsnet_py/units/radiation_exposure.py | 37 +++++++++++++++++++ unitsnet_py/units/radioactivity.py | 37 +++++++++++++++++++ unitsnet_py/units/ratio.py | 37 +++++++++++++++++++ unitsnet_py/units/ratio_change_rate.py | 37 +++++++++++++++++++ unitsnet_py/units/reactive_energy.py | 37 +++++++++++++++++++ unitsnet_py/units/reactive_power.py | 37 +++++++++++++++++++ unitsnet_py/units/reciprocal_area.py | 37 +++++++++++++++++++ unitsnet_py/units/reciprocal_length.py | 37 +++++++++++++++++++ unitsnet_py/units/relative_humidity.py | 37 +++++++++++++++++++ unitsnet_py/units/rotational_acceleration.py | 37 +++++++++++++++++++ unitsnet_py/units/rotational_speed.py | 37 +++++++++++++++++++ unitsnet_py/units/rotational_stiffness.py | 37 +++++++++++++++++++ .../units/rotational_stiffness_per_length.py | 37 +++++++++++++++++++ unitsnet_py/units/scalar.py | 37 +++++++++++++++++++ unitsnet_py/units/solid_angle.py | 37 +++++++++++++++++++ unitsnet_py/units/specific_energy.py | 37 +++++++++++++++++++ unitsnet_py/units/specific_entropy.py | 37 +++++++++++++++++++ .../units/specific_fuel_consumption.py | 37 +++++++++++++++++++ unitsnet_py/units/specific_volume.py | 37 +++++++++++++++++++ unitsnet_py/units/specific_weight.py | 37 +++++++++++++++++++ unitsnet_py/units/speed.py | 37 +++++++++++++++++++ unitsnet_py/units/standard_volume_flow.py | 37 +++++++++++++++++++ unitsnet_py/units/temperature.py | 37 +++++++++++++++++++ unitsnet_py/units/temperature_change_rate.py | 37 +++++++++++++++++++ unitsnet_py/units/temperature_delta.py | 37 +++++++++++++++++++ unitsnet_py/units/temperature_gradient.py | 37 +++++++++++++++++++ unitsnet_py/units/thermal_conductivity.py | 37 +++++++++++++++++++ unitsnet_py/units/thermal_resistance.py | 37 +++++++++++++++++++ unitsnet_py/units/torque.py | 37 +++++++++++++++++++ unitsnet_py/units/torque_per_length.py | 37 +++++++++++++++++++ unitsnet_py/units/turbidity.py | 37 +++++++++++++++++++ unitsnet_py/units/vitamin_a.py | 37 +++++++++++++++++++ unitsnet_py/units/volume.py | 37 +++++++++++++++++++ unitsnet_py/units/volume_concentration.py | 37 +++++++++++++++++++ unitsnet_py/units/volume_flow.py | 37 +++++++++++++++++++ unitsnet_py/units/volume_flow_per_area.py | 37 +++++++++++++++++++ unitsnet_py/units/volume_per_length.py | 37 +++++++++++++++++++ unitsnet_py/units/volumetric_heat_capacity.py | 37 +++++++++++++++++++ .../units/warping_moment_of_inertia.py | 37 +++++++++++++++++++ 125 files changed, 4625 insertions(+) diff --git a/units_generator/templates/unit_template.jinja2 b/units_generator/templates/unit_template.jinja2 index c105275..6557212 100644 --- a/units_generator/templates/unit_template.jinja2 +++ b/units_generator/templates/unit_template.jinja2 @@ -17,9 +17,30 @@ class {{ unit }}Units(Enum): {% endfor %} class {{ unit }}Dto: + """ + A DTO representation of a {{ unit }} + + Attributes: + value (float): The value of the {{ unit }}. + unit ({{ unit }}Units): The specific unit that the {{ unit }} value is representing. + """ + def __init__(self, value: float, unit: {{ unit }}Units): + """ + Create a new DTO representation of a {{ unit }} + + Parameters: + value (float): The value of the {{ unit }}. + unit ({{ unit }}Units): The specific unit that the {{ unit }} value is representing. + """ self.value: float = value + """ + The value of the {{ unit }} + """ self.unit: {{ unit }}Units = unit + """ + The specific unit that the {{ unit }} value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ class {{ unit }}(AbstractMeasure): return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: {{ unit }}Units = {{ unit }}Units.{{ base_unit }}) -> {{ unit }}Dto: + """ + Get a new instance of {{ unit }} DTO representing the current unit. + + :param hold_in_unit: The specific {{ unit }} unit to store the {{ unit }} value in the DTO representation. + :type hold_in_unit: {{ unit }}Units + :return: A new instance of {{ unit }}Dto. + :rtype: {{ unit }}Dto + """ return {{ unit }}Dto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto({{ unit_camel_case }}_dto: {{ unit }}Dto): + """ + Obtain a new instance of {{ unit }} from a DTO unit object. + + :param {{ unit_camel_case }}_dto: The {{ unit }} DTO representation. + :type {{ unit_camel_case }}_dto: {{ unit }}Dto + :return: A new instance of {{ unit }}. + :rtype: {{ unit }} + """ return {{ unit }}({{ unit_camel_case }}_dto.value, {{ unit_camel_case }}_dto.unit) def __convert_from_base(self, from_unit: {{ unit }}Units) -> float: diff --git a/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py b/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py index 7c8aed9..4969967 100644 --- a/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py +++ b/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py @@ -92,9 +92,30 @@ class AbsorbedDoseOfIonizingRadiationUnits(Enum): class AbsorbedDoseOfIonizingRadiationDto: + """ + A DTO representation of a AbsorbedDoseOfIonizingRadiation + + Attributes: + value (float): The value of the AbsorbedDoseOfIonizingRadiation. + unit (AbsorbedDoseOfIonizingRadiationUnits): The specific unit that the AbsorbedDoseOfIonizingRadiation value is representing. + """ + def __init__(self, value: float, unit: AbsorbedDoseOfIonizingRadiationUnits): + """ + Create a new DTO representation of a AbsorbedDoseOfIonizingRadiation + + Parameters: + value (float): The value of the AbsorbedDoseOfIonizingRadiation. + unit (AbsorbedDoseOfIonizingRadiationUnits): The specific unit that the AbsorbedDoseOfIonizingRadiation value is representing. + """ self.value: float = value + """ + The value of the AbsorbedDoseOfIonizingRadiation + """ self.unit: AbsorbedDoseOfIonizingRadiationUnits = unit + """ + The specific unit that the AbsorbedDoseOfIonizingRadiation value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -156,10 +177,26 @@ def convert(self, unit: AbsorbedDoseOfIonizingRadiationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AbsorbedDoseOfIonizingRadiationUnits = AbsorbedDoseOfIonizingRadiationUnits.Gray) -> AbsorbedDoseOfIonizingRadiationDto: + """ + Get a new instance of AbsorbedDoseOfIonizingRadiation DTO representing the current unit. + + :param hold_in_unit: The specific AbsorbedDoseOfIonizingRadiation unit to store the AbsorbedDoseOfIonizingRadiation value in the DTO representation. + :type hold_in_unit: AbsorbedDoseOfIonizingRadiationUnits + :return: A new instance of AbsorbedDoseOfIonizingRadiationDto. + :rtype: AbsorbedDoseOfIonizingRadiationDto + """ return AbsorbedDoseOfIonizingRadiationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(absorbed_dose_of_ionizing_radiation_dto: AbsorbedDoseOfIonizingRadiationDto): + """ + Obtain a new instance of AbsorbedDoseOfIonizingRadiation from a DTO unit object. + + :param absorbed_dose_of_ionizing_radiation_dto: The AbsorbedDoseOfIonizingRadiation DTO representation. + :type absorbed_dose_of_ionizing_radiation_dto: AbsorbedDoseOfIonizingRadiationDto + :return: A new instance of AbsorbedDoseOfIonizingRadiation. + :rtype: AbsorbedDoseOfIonizingRadiation + """ return AbsorbedDoseOfIonizingRadiation(absorbed_dose_of_ionizing_radiation_dto.value, absorbed_dose_of_ionizing_radiation_dto.unit) def __convert_from_base(self, from_unit: AbsorbedDoseOfIonizingRadiationUnits) -> float: diff --git a/unitsnet_py/units/acceleration.py b/unitsnet_py/units/acceleration.py index 1e7b027..06cac45 100644 --- a/unitsnet_py/units/acceleration.py +++ b/unitsnet_py/units/acceleration.py @@ -82,9 +82,30 @@ class AccelerationUnits(Enum): class AccelerationDto: + """ + A DTO representation of a Acceleration + + Attributes: + value (float): The value of the Acceleration. + unit (AccelerationUnits): The specific unit that the Acceleration value is representing. + """ + def __init__(self, value: float, unit: AccelerationUnits): + """ + Create a new DTO representation of a Acceleration + + Parameters: + value (float): The value of the Acceleration. + unit (AccelerationUnits): The specific unit that the Acceleration value is representing. + """ self.value: float = value + """ + The value of the Acceleration + """ self.unit: AccelerationUnits = unit + """ + The specific unit that the Acceleration value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: AccelerationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AccelerationUnits = AccelerationUnits.MeterPerSecondSquared) -> AccelerationDto: + """ + Get a new instance of Acceleration DTO representing the current unit. + + :param hold_in_unit: The specific Acceleration unit to store the Acceleration value in the DTO representation. + :type hold_in_unit: AccelerationUnits + :return: A new instance of AccelerationDto. + :rtype: AccelerationDto + """ return AccelerationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(acceleration_dto: AccelerationDto): + """ + Obtain a new instance of Acceleration from a DTO unit object. + + :param acceleration_dto: The Acceleration DTO representation. + :type acceleration_dto: AccelerationDto + :return: A new instance of Acceleration. + :rtype: Acceleration + """ return Acceleration(acceleration_dto.value, acceleration_dto.unit) def __convert_from_base(self, from_unit: AccelerationUnits) -> float: diff --git a/unitsnet_py/units/amount_of_substance.py b/unitsnet_py/units/amount_of_substance.py index 92cc64b..a30683d 100644 --- a/unitsnet_py/units/amount_of_substance.py +++ b/unitsnet_py/units/amount_of_substance.py @@ -97,9 +97,30 @@ class AmountOfSubstanceUnits(Enum): class AmountOfSubstanceDto: + """ + A DTO representation of a AmountOfSubstance + + Attributes: + value (float): The value of the AmountOfSubstance. + unit (AmountOfSubstanceUnits): The specific unit that the AmountOfSubstance value is representing. + """ + def __init__(self, value: float, unit: AmountOfSubstanceUnits): + """ + Create a new DTO representation of a AmountOfSubstance + + Parameters: + value (float): The value of the AmountOfSubstance. + unit (AmountOfSubstanceUnits): The specific unit that the AmountOfSubstance value is representing. + """ self.value: float = value + """ + The value of the AmountOfSubstance + """ self.unit: AmountOfSubstanceUnits = unit + """ + The specific unit that the AmountOfSubstance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -163,10 +184,26 @@ def convert(self, unit: AmountOfSubstanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AmountOfSubstanceUnits = AmountOfSubstanceUnits.Mole) -> AmountOfSubstanceDto: + """ + Get a new instance of AmountOfSubstance DTO representing the current unit. + + :param hold_in_unit: The specific AmountOfSubstance unit to store the AmountOfSubstance value in the DTO representation. + :type hold_in_unit: AmountOfSubstanceUnits + :return: A new instance of AmountOfSubstanceDto. + :rtype: AmountOfSubstanceDto + """ return AmountOfSubstanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(amount_of_substance_dto: AmountOfSubstanceDto): + """ + Obtain a new instance of AmountOfSubstance from a DTO unit object. + + :param amount_of_substance_dto: The AmountOfSubstance DTO representation. + :type amount_of_substance_dto: AmountOfSubstanceDto + :return: A new instance of AmountOfSubstance. + :rtype: AmountOfSubstance + """ return AmountOfSubstance(amount_of_substance_dto.value, amount_of_substance_dto.unit) def __convert_from_base(self, from_unit: AmountOfSubstanceUnits) -> float: diff --git a/unitsnet_py/units/amplitude_ratio.py b/unitsnet_py/units/amplitude_ratio.py index 8a6be52..c50bc05 100644 --- a/unitsnet_py/units/amplitude_ratio.py +++ b/unitsnet_py/units/amplitude_ratio.py @@ -32,9 +32,30 @@ class AmplitudeRatioUnits(Enum): class AmplitudeRatioDto: + """ + A DTO representation of a AmplitudeRatio + + Attributes: + value (float): The value of the AmplitudeRatio. + unit (AmplitudeRatioUnits): The specific unit that the AmplitudeRatio value is representing. + """ + def __init__(self, value: float, unit: AmplitudeRatioUnits): + """ + Create a new DTO representation of a AmplitudeRatio + + Parameters: + value (float): The value of the AmplitudeRatio. + unit (AmplitudeRatioUnits): The specific unit that the AmplitudeRatio value is representing. + """ self.value: float = value + """ + The value of the AmplitudeRatio + """ self.unit: AmplitudeRatioUnits = unit + """ + The specific unit that the AmplitudeRatio value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: AmplitudeRatioUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AmplitudeRatioUnits = AmplitudeRatioUnits.DecibelVolt) -> AmplitudeRatioDto: + """ + Get a new instance of AmplitudeRatio DTO representing the current unit. + + :param hold_in_unit: The specific AmplitudeRatio unit to store the AmplitudeRatio value in the DTO representation. + :type hold_in_unit: AmplitudeRatioUnits + :return: A new instance of AmplitudeRatioDto. + :rtype: AmplitudeRatioDto + """ return AmplitudeRatioDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(amplitude_ratio_dto: AmplitudeRatioDto): + """ + Obtain a new instance of AmplitudeRatio from a DTO unit object. + + :param amplitude_ratio_dto: The AmplitudeRatio DTO representation. + :type amplitude_ratio_dto: AmplitudeRatioDto + :return: A new instance of AmplitudeRatio. + :rtype: AmplitudeRatio + """ return AmplitudeRatio(amplitude_ratio_dto.value, amplitude_ratio_dto.unit) def __convert_from_base(self, from_unit: AmplitudeRatioUnits) -> float: diff --git a/unitsnet_py/units/angle.py b/unitsnet_py/units/angle.py index 2bdadf5..9d7389e 100644 --- a/unitsnet_py/units/angle.py +++ b/unitsnet_py/units/angle.py @@ -92,9 +92,30 @@ class AngleUnits(Enum): class AngleDto: + """ + A DTO representation of a Angle + + Attributes: + value (float): The value of the Angle. + unit (AngleUnits): The specific unit that the Angle value is representing. + """ + def __init__(self, value: float, unit: AngleUnits): + """ + Create a new DTO representation of a Angle + + Parameters: + value (float): The value of the Angle. + unit (AngleUnits): The specific unit that the Angle value is representing. + """ self.value: float = value + """ + The value of the Angle + """ self.unit: AngleUnits = unit + """ + The specific unit that the Angle value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -156,10 +177,26 @@ def convert(self, unit: AngleUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AngleUnits = AngleUnits.Degree) -> AngleDto: + """ + Get a new instance of Angle DTO representing the current unit. + + :param hold_in_unit: The specific Angle unit to store the Angle value in the DTO representation. + :type hold_in_unit: AngleUnits + :return: A new instance of AngleDto. + :rtype: AngleDto + """ return AngleDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(angle_dto: AngleDto): + """ + Obtain a new instance of Angle from a DTO unit object. + + :param angle_dto: The Angle DTO representation. + :type angle_dto: AngleDto + :return: A new instance of Angle. + :rtype: Angle + """ return Angle(angle_dto.value, angle_dto.unit) def __convert_from_base(self, from_unit: AngleUnits) -> float: diff --git a/unitsnet_py/units/apparent_energy.py b/unitsnet_py/units/apparent_energy.py index 67d21a5..b866f71 100644 --- a/unitsnet_py/units/apparent_energy.py +++ b/unitsnet_py/units/apparent_energy.py @@ -27,9 +27,30 @@ class ApparentEnergyUnits(Enum): class ApparentEnergyDto: + """ + A DTO representation of a ApparentEnergy + + Attributes: + value (float): The value of the ApparentEnergy. + unit (ApparentEnergyUnits): The specific unit that the ApparentEnergy value is representing. + """ + def __init__(self, value: float, unit: ApparentEnergyUnits): + """ + Create a new DTO representation of a ApparentEnergy + + Parameters: + value (float): The value of the ApparentEnergy. + unit (ApparentEnergyUnits): The specific unit that the ApparentEnergy value is representing. + """ self.value: float = value + """ + The value of the ApparentEnergy + """ self.unit: ApparentEnergyUnits = unit + """ + The specific unit that the ApparentEnergy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: ApparentEnergyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ApparentEnergyUnits = ApparentEnergyUnits.VoltampereHour) -> ApparentEnergyDto: + """ + Get a new instance of ApparentEnergy DTO representing the current unit. + + :param hold_in_unit: The specific ApparentEnergy unit to store the ApparentEnergy value in the DTO representation. + :type hold_in_unit: ApparentEnergyUnits + :return: A new instance of ApparentEnergyDto. + :rtype: ApparentEnergyDto + """ return ApparentEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(apparent_energy_dto: ApparentEnergyDto): + """ + Obtain a new instance of ApparentEnergy from a DTO unit object. + + :param apparent_energy_dto: The ApparentEnergy DTO representation. + :type apparent_energy_dto: ApparentEnergyDto + :return: A new instance of ApparentEnergy. + :rtype: ApparentEnergy + """ return ApparentEnergy(apparent_energy_dto.value, apparent_energy_dto.unit) def __convert_from_base(self, from_unit: ApparentEnergyUnits) -> float: diff --git a/unitsnet_py/units/apparent_power.py b/unitsnet_py/units/apparent_power.py index 8c5acfe..61b335e 100644 --- a/unitsnet_py/units/apparent_power.py +++ b/unitsnet_py/units/apparent_power.py @@ -42,9 +42,30 @@ class ApparentPowerUnits(Enum): class ApparentPowerDto: + """ + A DTO representation of a ApparentPower + + Attributes: + value (float): The value of the ApparentPower. + unit (ApparentPowerUnits): The specific unit that the ApparentPower value is representing. + """ + def __init__(self, value: float, unit: ApparentPowerUnits): + """ + Create a new DTO representation of a ApparentPower + + Parameters: + value (float): The value of the ApparentPower. + unit (ApparentPowerUnits): The specific unit that the ApparentPower value is representing. + """ self.value: float = value + """ + The value of the ApparentPower + """ self.unit: ApparentPowerUnits = unit + """ + The specific unit that the ApparentPower value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: ApparentPowerUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ApparentPowerUnits = ApparentPowerUnits.Voltampere) -> ApparentPowerDto: + """ + Get a new instance of ApparentPower DTO representing the current unit. + + :param hold_in_unit: The specific ApparentPower unit to store the ApparentPower value in the DTO representation. + :type hold_in_unit: ApparentPowerUnits + :return: A new instance of ApparentPowerDto. + :rtype: ApparentPowerDto + """ return ApparentPowerDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(apparent_power_dto: ApparentPowerDto): + """ + Obtain a new instance of ApparentPower from a DTO unit object. + + :param apparent_power_dto: The ApparentPower DTO representation. + :type apparent_power_dto: ApparentPowerDto + :return: A new instance of ApparentPower. + :rtype: ApparentPower + """ return ApparentPower(apparent_power_dto.value, apparent_power_dto.unit) def __convert_from_base(self, from_unit: ApparentPowerUnits) -> float: diff --git a/unitsnet_py/units/area.py b/unitsnet_py/units/area.py index 179f70e..fcd6eb2 100644 --- a/unitsnet_py/units/area.py +++ b/unitsnet_py/units/area.py @@ -82,9 +82,30 @@ class AreaUnits(Enum): class AreaDto: + """ + A DTO representation of a Area + + Attributes: + value (float): The value of the Area. + unit (AreaUnits): The specific unit that the Area value is representing. + """ + def __init__(self, value: float, unit: AreaUnits): + """ + Create a new DTO representation of a Area + + Parameters: + value (float): The value of the Area. + unit (AreaUnits): The specific unit that the Area value is representing. + """ self.value: float = value + """ + The value of the Area + """ self.unit: AreaUnits = unit + """ + The specific unit that the Area value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: AreaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AreaUnits = AreaUnits.SquareMeter) -> AreaDto: + """ + Get a new instance of Area DTO representing the current unit. + + :param hold_in_unit: The specific Area unit to store the Area value in the DTO representation. + :type hold_in_unit: AreaUnits + :return: A new instance of AreaDto. + :rtype: AreaDto + """ return AreaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(area_dto: AreaDto): + """ + Obtain a new instance of Area from a DTO unit object. + + :param area_dto: The Area DTO representation. + :type area_dto: AreaDto + :return: A new instance of Area. + :rtype: Area + """ return Area(area_dto.value, area_dto.unit) def __convert_from_base(self, from_unit: AreaUnits) -> float: diff --git a/unitsnet_py/units/area_density.py b/unitsnet_py/units/area_density.py index 8cb1609..89929a5 100644 --- a/unitsnet_py/units/area_density.py +++ b/unitsnet_py/units/area_density.py @@ -27,9 +27,30 @@ class AreaDensityUnits(Enum): class AreaDensityDto: + """ + A DTO representation of a AreaDensity + + Attributes: + value (float): The value of the AreaDensity. + unit (AreaDensityUnits): The specific unit that the AreaDensity value is representing. + """ + def __init__(self, value: float, unit: AreaDensityUnits): + """ + Create a new DTO representation of a AreaDensity + + Parameters: + value (float): The value of the AreaDensity. + unit (AreaDensityUnits): The specific unit that the AreaDensity value is representing. + """ self.value: float = value + """ + The value of the AreaDensity + """ self.unit: AreaDensityUnits = unit + """ + The specific unit that the AreaDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: AreaDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AreaDensityUnits = AreaDensityUnits.KilogramPerSquareMeter) -> AreaDensityDto: + """ + Get a new instance of AreaDensity DTO representing the current unit. + + :param hold_in_unit: The specific AreaDensity unit to store the AreaDensity value in the DTO representation. + :type hold_in_unit: AreaDensityUnits + :return: A new instance of AreaDensityDto. + :rtype: AreaDensityDto + """ return AreaDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(area_density_dto: AreaDensityDto): + """ + Obtain a new instance of AreaDensity from a DTO unit object. + + :param area_density_dto: The AreaDensity DTO representation. + :type area_density_dto: AreaDensityDto + :return: A new instance of AreaDensity. + :rtype: AreaDensity + """ return AreaDensity(area_density_dto.value, area_density_dto.unit) def __convert_from_base(self, from_unit: AreaDensityUnits) -> float: diff --git a/unitsnet_py/units/area_moment_of_inertia.py b/unitsnet_py/units/area_moment_of_inertia.py index 31e2322..3461e34 100644 --- a/unitsnet_py/units/area_moment_of_inertia.py +++ b/unitsnet_py/units/area_moment_of_inertia.py @@ -42,9 +42,30 @@ class AreaMomentOfInertiaUnits(Enum): class AreaMomentOfInertiaDto: + """ + A DTO representation of a AreaMomentOfInertia + + Attributes: + value (float): The value of the AreaMomentOfInertia. + unit (AreaMomentOfInertiaUnits): The specific unit that the AreaMomentOfInertia value is representing. + """ + def __init__(self, value: float, unit: AreaMomentOfInertiaUnits): + """ + Create a new DTO representation of a AreaMomentOfInertia + + Parameters: + value (float): The value of the AreaMomentOfInertia. + unit (AreaMomentOfInertiaUnits): The specific unit that the AreaMomentOfInertia value is representing. + """ self.value: float = value + """ + The value of the AreaMomentOfInertia + """ self.unit: AreaMomentOfInertiaUnits = unit + """ + The specific unit that the AreaMomentOfInertia value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: AreaMomentOfInertiaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: AreaMomentOfInertiaUnits = AreaMomentOfInertiaUnits.MeterToTheFourth) -> AreaMomentOfInertiaDto: + """ + Get a new instance of AreaMomentOfInertia DTO representing the current unit. + + :param hold_in_unit: The specific AreaMomentOfInertia unit to store the AreaMomentOfInertia value in the DTO representation. + :type hold_in_unit: AreaMomentOfInertiaUnits + :return: A new instance of AreaMomentOfInertiaDto. + :rtype: AreaMomentOfInertiaDto + """ return AreaMomentOfInertiaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(area_moment_of_inertia_dto: AreaMomentOfInertiaDto): + """ + Obtain a new instance of AreaMomentOfInertia from a DTO unit object. + + :param area_moment_of_inertia_dto: The AreaMomentOfInertia DTO representation. + :type area_moment_of_inertia_dto: AreaMomentOfInertiaDto + :return: A new instance of AreaMomentOfInertia. + :rtype: AreaMomentOfInertia + """ return AreaMomentOfInertia(area_moment_of_inertia_dto.value, area_moment_of_inertia_dto.unit) def __convert_from_base(self, from_unit: AreaMomentOfInertiaUnits) -> float: diff --git a/unitsnet_py/units/bit_rate.py b/unitsnet_py/units/bit_rate.py index fa0f05a..330e618 100644 --- a/unitsnet_py/units/bit_rate.py +++ b/unitsnet_py/units/bit_rate.py @@ -82,9 +82,30 @@ class BitRateUnits(Enum): class BitRateDto: + """ + A DTO representation of a BitRate + + Attributes: + value (float): The value of the BitRate. + unit (BitRateUnits): The specific unit that the BitRate value is representing. + """ + def __init__(self, value: float, unit: BitRateUnits): + """ + Create a new DTO representation of a BitRate + + Parameters: + value (float): The value of the BitRate. + unit (BitRateUnits): The specific unit that the BitRate value is representing. + """ self.value: float = value + """ + The value of the BitRate + """ self.unit: BitRateUnits = unit + """ + The specific unit that the BitRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: BitRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: BitRateUnits = BitRateUnits.BitPerSecond) -> BitRateDto: + """ + Get a new instance of BitRate DTO representing the current unit. + + :param hold_in_unit: The specific BitRate unit to store the BitRate value in the DTO representation. + :type hold_in_unit: BitRateUnits + :return: A new instance of BitRateDto. + :rtype: BitRateDto + """ return BitRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(bit_rate_dto: BitRateDto): + """ + Obtain a new instance of BitRate from a DTO unit object. + + :param bit_rate_dto: The BitRate DTO representation. + :type bit_rate_dto: BitRateDto + :return: A new instance of BitRate. + :rtype: BitRate + """ return BitRate(bit_rate_dto.value, bit_rate_dto.unit) def __convert_from_base(self, from_unit: BitRateUnits) -> float: diff --git a/unitsnet_py/units/brake_specific_fuel_consumption.py b/unitsnet_py/units/brake_specific_fuel_consumption.py index b6d46c4..89aa3f0 100644 --- a/unitsnet_py/units/brake_specific_fuel_consumption.py +++ b/unitsnet_py/units/brake_specific_fuel_consumption.py @@ -27,9 +27,30 @@ class BrakeSpecificFuelConsumptionUnits(Enum): class BrakeSpecificFuelConsumptionDto: + """ + A DTO representation of a BrakeSpecificFuelConsumption + + Attributes: + value (float): The value of the BrakeSpecificFuelConsumption. + unit (BrakeSpecificFuelConsumptionUnits): The specific unit that the BrakeSpecificFuelConsumption value is representing. + """ + def __init__(self, value: float, unit: BrakeSpecificFuelConsumptionUnits): + """ + Create a new DTO representation of a BrakeSpecificFuelConsumption + + Parameters: + value (float): The value of the BrakeSpecificFuelConsumption. + unit (BrakeSpecificFuelConsumptionUnits): The specific unit that the BrakeSpecificFuelConsumption value is representing. + """ self.value: float = value + """ + The value of the BrakeSpecificFuelConsumption + """ self.unit: BrakeSpecificFuelConsumptionUnits = unit + """ + The specific unit that the BrakeSpecificFuelConsumption value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: BrakeSpecificFuelConsumptionUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: BrakeSpecificFuelConsumptionUnits = BrakeSpecificFuelConsumptionUnits.KilogramPerJoule) -> BrakeSpecificFuelConsumptionDto: + """ + Get a new instance of BrakeSpecificFuelConsumption DTO representing the current unit. + + :param hold_in_unit: The specific BrakeSpecificFuelConsumption unit to store the BrakeSpecificFuelConsumption value in the DTO representation. + :type hold_in_unit: BrakeSpecificFuelConsumptionUnits + :return: A new instance of BrakeSpecificFuelConsumptionDto. + :rtype: BrakeSpecificFuelConsumptionDto + """ return BrakeSpecificFuelConsumptionDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(brake_specific_fuel_consumption_dto: BrakeSpecificFuelConsumptionDto): + """ + Obtain a new instance of BrakeSpecificFuelConsumption from a DTO unit object. + + :param brake_specific_fuel_consumption_dto: The BrakeSpecificFuelConsumption DTO representation. + :type brake_specific_fuel_consumption_dto: BrakeSpecificFuelConsumptionDto + :return: A new instance of BrakeSpecificFuelConsumption. + :rtype: BrakeSpecificFuelConsumption + """ return BrakeSpecificFuelConsumption(brake_specific_fuel_consumption_dto.value, brake_specific_fuel_consumption_dto.unit) def __convert_from_base(self, from_unit: BrakeSpecificFuelConsumptionUnits) -> float: diff --git a/unitsnet_py/units/capacitance.py b/unitsnet_py/units/capacitance.py index 5b9f719..b63038f 100644 --- a/unitsnet_py/units/capacitance.py +++ b/unitsnet_py/units/capacitance.py @@ -47,9 +47,30 @@ class CapacitanceUnits(Enum): class CapacitanceDto: + """ + A DTO representation of a Capacitance + + Attributes: + value (float): The value of the Capacitance. + unit (CapacitanceUnits): The specific unit that the Capacitance value is representing. + """ + def __init__(self, value: float, unit: CapacitanceUnits): + """ + Create a new DTO representation of a Capacitance + + Parameters: + value (float): The value of the Capacitance. + unit (CapacitanceUnits): The specific unit that the Capacitance value is representing. + """ self.value: float = value + """ + The value of the Capacitance + """ self.unit: CapacitanceUnits = unit + """ + The specific unit that the Capacitance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -93,10 +114,26 @@ def convert(self, unit: CapacitanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: CapacitanceUnits = CapacitanceUnits.Farad) -> CapacitanceDto: + """ + Get a new instance of Capacitance DTO representing the current unit. + + :param hold_in_unit: The specific Capacitance unit to store the Capacitance value in the DTO representation. + :type hold_in_unit: CapacitanceUnits + :return: A new instance of CapacitanceDto. + :rtype: CapacitanceDto + """ return CapacitanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(capacitance_dto: CapacitanceDto): + """ + Obtain a new instance of Capacitance from a DTO unit object. + + :param capacitance_dto: The Capacitance DTO representation. + :type capacitance_dto: CapacitanceDto + :return: A new instance of Capacitance. + :rtype: Capacitance + """ return Capacitance(capacitance_dto.value, capacitance_dto.unit) def __convert_from_base(self, from_unit: CapacitanceUnits) -> float: diff --git a/unitsnet_py/units/coefficient_of_thermal_expansion.py b/unitsnet_py/units/coefficient_of_thermal_expansion.py index 87bc45d..0b9214f 100644 --- a/unitsnet_py/units/coefficient_of_thermal_expansion.py +++ b/unitsnet_py/units/coefficient_of_thermal_expansion.py @@ -42,9 +42,30 @@ class CoefficientOfThermalExpansionUnits(Enum): class CoefficientOfThermalExpansionDto: + """ + A DTO representation of a CoefficientOfThermalExpansion + + Attributes: + value (float): The value of the CoefficientOfThermalExpansion. + unit (CoefficientOfThermalExpansionUnits): The specific unit that the CoefficientOfThermalExpansion value is representing. + """ + def __init__(self, value: float, unit: CoefficientOfThermalExpansionUnits): + """ + Create a new DTO representation of a CoefficientOfThermalExpansion + + Parameters: + value (float): The value of the CoefficientOfThermalExpansion. + unit (CoefficientOfThermalExpansionUnits): The specific unit that the CoefficientOfThermalExpansion value is representing. + """ self.value: float = value + """ + The value of the CoefficientOfThermalExpansion + """ self.unit: CoefficientOfThermalExpansionUnits = unit + """ + The specific unit that the CoefficientOfThermalExpansion value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: CoefficientOfThermalExpansionUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: CoefficientOfThermalExpansionUnits = CoefficientOfThermalExpansionUnits.PerKelvin) -> CoefficientOfThermalExpansionDto: + """ + Get a new instance of CoefficientOfThermalExpansion DTO representing the current unit. + + :param hold_in_unit: The specific CoefficientOfThermalExpansion unit to store the CoefficientOfThermalExpansion value in the DTO representation. + :type hold_in_unit: CoefficientOfThermalExpansionUnits + :return: A new instance of CoefficientOfThermalExpansionDto. + :rtype: CoefficientOfThermalExpansionDto + """ return CoefficientOfThermalExpansionDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(coefficient_of_thermal_expansion_dto: CoefficientOfThermalExpansionDto): + """ + Obtain a new instance of CoefficientOfThermalExpansion from a DTO unit object. + + :param coefficient_of_thermal_expansion_dto: The CoefficientOfThermalExpansion DTO representation. + :type coefficient_of_thermal_expansion_dto: CoefficientOfThermalExpansionDto + :return: A new instance of CoefficientOfThermalExpansion. + :rtype: CoefficientOfThermalExpansion + """ return CoefficientOfThermalExpansion(coefficient_of_thermal_expansion_dto.value, coefficient_of_thermal_expansion_dto.unit) def __convert_from_base(self, from_unit: CoefficientOfThermalExpansionUnits) -> float: diff --git a/unitsnet_py/units/compressibility.py b/unitsnet_py/units/compressibility.py index f2bb708..b693c29 100644 --- a/unitsnet_py/units/compressibility.py +++ b/unitsnet_py/units/compressibility.py @@ -47,9 +47,30 @@ class CompressibilityUnits(Enum): class CompressibilityDto: + """ + A DTO representation of a Compressibility + + Attributes: + value (float): The value of the Compressibility. + unit (CompressibilityUnits): The specific unit that the Compressibility value is representing. + """ + def __init__(self, value: float, unit: CompressibilityUnits): + """ + Create a new DTO representation of a Compressibility + + Parameters: + value (float): The value of the Compressibility. + unit (CompressibilityUnits): The specific unit that the Compressibility value is representing. + """ self.value: float = value + """ + The value of the Compressibility + """ self.unit: CompressibilityUnits = unit + """ + The specific unit that the Compressibility value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -93,10 +114,26 @@ def convert(self, unit: CompressibilityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: CompressibilityUnits = CompressibilityUnits.InversePascal) -> CompressibilityDto: + """ + Get a new instance of Compressibility DTO representing the current unit. + + :param hold_in_unit: The specific Compressibility unit to store the Compressibility value in the DTO representation. + :type hold_in_unit: CompressibilityUnits + :return: A new instance of CompressibilityDto. + :rtype: CompressibilityDto + """ return CompressibilityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(compressibility_dto: CompressibilityDto): + """ + Obtain a new instance of Compressibility from a DTO unit object. + + :param compressibility_dto: The Compressibility DTO representation. + :type compressibility_dto: CompressibilityDto + :return: A new instance of Compressibility. + :rtype: Compressibility + """ return Compressibility(compressibility_dto.value, compressibility_dto.unit) def __convert_from_base(self, from_unit: CompressibilityUnits) -> float: diff --git a/unitsnet_py/units/density.py b/unitsnet_py/units/density.py index e63dfa4..a6479f1 100644 --- a/unitsnet_py/units/density.py +++ b/unitsnet_py/units/density.py @@ -292,9 +292,30 @@ class DensityUnits(Enum): class DensityDto: + """ + A DTO representation of a Density + + Attributes: + value (float): The value of the Density. + unit (DensityUnits): The specific unit that the Density value is representing. + """ + def __init__(self, value: float, unit: DensityUnits): + """ + Create a new DTO representation of a Density + + Parameters: + value (float): The value of the Density. + unit (DensityUnits): The specific unit that the Density value is representing. + """ self.value: float = value + """ + The value of the Density + """ self.unit: DensityUnits = unit + """ + The specific unit that the Density value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -436,10 +457,26 @@ def convert(self, unit: DensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: DensityUnits = DensityUnits.KilogramPerCubicMeter) -> DensityDto: + """ + Get a new instance of Density DTO representing the current unit. + + :param hold_in_unit: The specific Density unit to store the Density value in the DTO representation. + :type hold_in_unit: DensityUnits + :return: A new instance of DensityDto. + :rtype: DensityDto + """ return DensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(density_dto: DensityDto): + """ + Obtain a new instance of Density from a DTO unit object. + + :param density_dto: The Density DTO representation. + :type density_dto: DensityDto + :return: A new instance of Density. + :rtype: Density + """ return Density(density_dto.value, density_dto.unit) def __convert_from_base(self, from_unit: DensityUnits) -> float: diff --git a/unitsnet_py/units/duration.py b/unitsnet_py/units/duration.py index 298bb20..e163d38 100644 --- a/unitsnet_py/units/duration.py +++ b/unitsnet_py/units/duration.py @@ -67,9 +67,30 @@ class DurationUnits(Enum): class DurationDto: + """ + A DTO representation of a Duration + + Attributes: + value (float): The value of the Duration. + unit (DurationUnits): The specific unit that the Duration value is representing. + """ + def __init__(self, value: float, unit: DurationUnits): + """ + Create a new DTO representation of a Duration + + Parameters: + value (float): The value of the Duration. + unit (DurationUnits): The specific unit that the Duration value is representing. + """ self.value: float = value + """ + The value of the Duration + """ self.unit: DurationUnits = unit + """ + The specific unit that the Duration value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -121,10 +142,26 @@ def convert(self, unit: DurationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: DurationUnits = DurationUnits.Second) -> DurationDto: + """ + Get a new instance of Duration DTO representing the current unit. + + :param hold_in_unit: The specific Duration unit to store the Duration value in the DTO representation. + :type hold_in_unit: DurationUnits + :return: A new instance of DurationDto. + :rtype: DurationDto + """ return DurationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(duration_dto: DurationDto): + """ + Obtain a new instance of Duration from a DTO unit object. + + :param duration_dto: The Duration DTO representation. + :type duration_dto: DurationDto + :return: A new instance of Duration. + :rtype: Duration + """ return Duration(duration_dto.value, duration_dto.unit) def __convert_from_base(self, from_unit: DurationUnits) -> float: diff --git a/unitsnet_py/units/dynamic_viscosity.py b/unitsnet_py/units/dynamic_viscosity.py index 299521a..7771a94 100644 --- a/unitsnet_py/units/dynamic_viscosity.py +++ b/unitsnet_py/units/dynamic_viscosity.py @@ -62,9 +62,30 @@ class DynamicViscosityUnits(Enum): class DynamicViscosityDto: + """ + A DTO representation of a DynamicViscosity + + Attributes: + value (float): The value of the DynamicViscosity. + unit (DynamicViscosityUnits): The specific unit that the DynamicViscosity value is representing. + """ + def __init__(self, value: float, unit: DynamicViscosityUnits): + """ + Create a new DTO representation of a DynamicViscosity + + Parameters: + value (float): The value of the DynamicViscosity. + unit (DynamicViscosityUnits): The specific unit that the DynamicViscosity value is representing. + """ self.value: float = value + """ + The value of the DynamicViscosity + """ self.unit: DynamicViscosityUnits = unit + """ + The specific unit that the DynamicViscosity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -114,10 +135,26 @@ def convert(self, unit: DynamicViscosityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: DynamicViscosityUnits = DynamicViscosityUnits.NewtonSecondPerMeterSquared) -> DynamicViscosityDto: + """ + Get a new instance of DynamicViscosity DTO representing the current unit. + + :param hold_in_unit: The specific DynamicViscosity unit to store the DynamicViscosity value in the DTO representation. + :type hold_in_unit: DynamicViscosityUnits + :return: A new instance of DynamicViscosityDto. + :rtype: DynamicViscosityDto + """ return DynamicViscosityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(dynamic_viscosity_dto: DynamicViscosityDto): + """ + Obtain a new instance of DynamicViscosity from a DTO unit object. + + :param dynamic_viscosity_dto: The DynamicViscosity DTO representation. + :type dynamic_viscosity_dto: DynamicViscosityDto + :return: A new instance of DynamicViscosity. + :rtype: DynamicViscosity + """ return DynamicViscosity(dynamic_viscosity_dto.value, dynamic_viscosity_dto.unit) def __convert_from_base(self, from_unit: DynamicViscosityUnits) -> float: diff --git a/unitsnet_py/units/electric_admittance.py b/unitsnet_py/units/electric_admittance.py index dbeb8f6..a9b52c5 100644 --- a/unitsnet_py/units/electric_admittance.py +++ b/unitsnet_py/units/electric_admittance.py @@ -32,9 +32,30 @@ class ElectricAdmittanceUnits(Enum): class ElectricAdmittanceDto: + """ + A DTO representation of a ElectricAdmittance + + Attributes: + value (float): The value of the ElectricAdmittance. + unit (ElectricAdmittanceUnits): The specific unit that the ElectricAdmittance value is representing. + """ + def __init__(self, value: float, unit: ElectricAdmittanceUnits): + """ + Create a new DTO representation of a ElectricAdmittance + + Parameters: + value (float): The value of the ElectricAdmittance. + unit (ElectricAdmittanceUnits): The specific unit that the ElectricAdmittance value is representing. + """ self.value: float = value + """ + The value of the ElectricAdmittance + """ self.unit: ElectricAdmittanceUnits = unit + """ + The specific unit that the ElectricAdmittance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: ElectricAdmittanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricAdmittanceUnits = ElectricAdmittanceUnits.Siemens) -> ElectricAdmittanceDto: + """ + Get a new instance of ElectricAdmittance DTO representing the current unit. + + :param hold_in_unit: The specific ElectricAdmittance unit to store the ElectricAdmittance value in the DTO representation. + :type hold_in_unit: ElectricAdmittanceUnits + :return: A new instance of ElectricAdmittanceDto. + :rtype: ElectricAdmittanceDto + """ return ElectricAdmittanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_admittance_dto: ElectricAdmittanceDto): + """ + Obtain a new instance of ElectricAdmittance from a DTO unit object. + + :param electric_admittance_dto: The ElectricAdmittance DTO representation. + :type electric_admittance_dto: ElectricAdmittanceDto + :return: A new instance of ElectricAdmittance. + :rtype: ElectricAdmittance + """ return ElectricAdmittance(electric_admittance_dto.value, electric_admittance_dto.unit) def __convert_from_base(self, from_unit: ElectricAdmittanceUnits) -> float: diff --git a/unitsnet_py/units/electric_charge.py b/unitsnet_py/units/electric_charge.py index e07e880..e05d85c 100644 --- a/unitsnet_py/units/electric_charge.py +++ b/unitsnet_py/units/electric_charge.py @@ -67,9 +67,30 @@ class ElectricChargeUnits(Enum): class ElectricChargeDto: + """ + A DTO representation of a ElectricCharge + + Attributes: + value (float): The value of the ElectricCharge. + unit (ElectricChargeUnits): The specific unit that the ElectricCharge value is representing. + """ + def __init__(self, value: float, unit: ElectricChargeUnits): + """ + Create a new DTO representation of a ElectricCharge + + Parameters: + value (float): The value of the ElectricCharge. + unit (ElectricChargeUnits): The specific unit that the ElectricCharge value is representing. + """ self.value: float = value + """ + The value of the ElectricCharge + """ self.unit: ElectricChargeUnits = unit + """ + The specific unit that the ElectricCharge value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -121,10 +142,26 @@ def convert(self, unit: ElectricChargeUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricChargeUnits = ElectricChargeUnits.Coulomb) -> ElectricChargeDto: + """ + Get a new instance of ElectricCharge DTO representing the current unit. + + :param hold_in_unit: The specific ElectricCharge unit to store the ElectricCharge value in the DTO representation. + :type hold_in_unit: ElectricChargeUnits + :return: A new instance of ElectricChargeDto. + :rtype: ElectricChargeDto + """ return ElectricChargeDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_charge_dto: ElectricChargeDto): + """ + Obtain a new instance of ElectricCharge from a DTO unit object. + + :param electric_charge_dto: The ElectricCharge DTO representation. + :type electric_charge_dto: ElectricChargeDto + :return: A new instance of ElectricCharge. + :rtype: ElectricCharge + """ return ElectricCharge(electric_charge_dto.value, electric_charge_dto.unit) def __convert_from_base(self, from_unit: ElectricChargeUnits) -> float: diff --git a/unitsnet_py/units/electric_charge_density.py b/unitsnet_py/units/electric_charge_density.py index 533014b..e2c7583 100644 --- a/unitsnet_py/units/electric_charge_density.py +++ b/unitsnet_py/units/electric_charge_density.py @@ -17,9 +17,30 @@ class ElectricChargeDensityUnits(Enum): class ElectricChargeDensityDto: + """ + A DTO representation of a ElectricChargeDensity + + Attributes: + value (float): The value of the ElectricChargeDensity. + unit (ElectricChargeDensityUnits): The specific unit that the ElectricChargeDensity value is representing. + """ + def __init__(self, value: float, unit: ElectricChargeDensityUnits): + """ + Create a new DTO representation of a ElectricChargeDensity + + Parameters: + value (float): The value of the ElectricChargeDensity. + unit (ElectricChargeDensityUnits): The specific unit that the ElectricChargeDensity value is representing. + """ self.value: float = value + """ + The value of the ElectricChargeDensity + """ self.unit: ElectricChargeDensityUnits = unit + """ + The specific unit that the ElectricChargeDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: ElectricChargeDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricChargeDensityUnits = ElectricChargeDensityUnits.CoulombPerCubicMeter) -> ElectricChargeDensityDto: + """ + Get a new instance of ElectricChargeDensity DTO representing the current unit. + + :param hold_in_unit: The specific ElectricChargeDensity unit to store the ElectricChargeDensity value in the DTO representation. + :type hold_in_unit: ElectricChargeDensityUnits + :return: A new instance of ElectricChargeDensityDto. + :rtype: ElectricChargeDensityDto + """ return ElectricChargeDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_charge_density_dto: ElectricChargeDensityDto): + """ + Obtain a new instance of ElectricChargeDensity from a DTO unit object. + + :param electric_charge_density_dto: The ElectricChargeDensity DTO representation. + :type electric_charge_density_dto: ElectricChargeDensityDto + :return: A new instance of ElectricChargeDensity. + :rtype: ElectricChargeDensity + """ return ElectricChargeDensity(electric_charge_density_dto.value, electric_charge_density_dto.unit) def __convert_from_base(self, from_unit: ElectricChargeDensityUnits) -> float: diff --git a/unitsnet_py/units/electric_conductance.py b/unitsnet_py/units/electric_conductance.py index ba402bf..107e5f8 100644 --- a/unitsnet_py/units/electric_conductance.py +++ b/unitsnet_py/units/electric_conductance.py @@ -37,9 +37,30 @@ class ElectricConductanceUnits(Enum): class ElectricConductanceDto: + """ + A DTO representation of a ElectricConductance + + Attributes: + value (float): The value of the ElectricConductance. + unit (ElectricConductanceUnits): The specific unit that the ElectricConductance value is representing. + """ + def __init__(self, value: float, unit: ElectricConductanceUnits): + """ + Create a new DTO representation of a ElectricConductance + + Parameters: + value (float): The value of the ElectricConductance. + unit (ElectricConductanceUnits): The specific unit that the ElectricConductance value is representing. + """ self.value: float = value + """ + The value of the ElectricConductance + """ self.unit: ElectricConductanceUnits = unit + """ + The specific unit that the ElectricConductance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: ElectricConductanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricConductanceUnits = ElectricConductanceUnits.Siemens) -> ElectricConductanceDto: + """ + Get a new instance of ElectricConductance DTO representing the current unit. + + :param hold_in_unit: The specific ElectricConductance unit to store the ElectricConductance value in the DTO representation. + :type hold_in_unit: ElectricConductanceUnits + :return: A new instance of ElectricConductanceDto. + :rtype: ElectricConductanceDto + """ return ElectricConductanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_conductance_dto: ElectricConductanceDto): + """ + Obtain a new instance of ElectricConductance from a DTO unit object. + + :param electric_conductance_dto: The ElectricConductance DTO representation. + :type electric_conductance_dto: ElectricConductanceDto + :return: A new instance of ElectricConductance. + :rtype: ElectricConductance + """ return ElectricConductance(electric_conductance_dto.value, electric_conductance_dto.unit) def __convert_from_base(self, from_unit: ElectricConductanceUnits) -> float: diff --git a/unitsnet_py/units/electric_conductivity.py b/unitsnet_py/units/electric_conductivity.py index 43b7561..2a7d12f 100644 --- a/unitsnet_py/units/electric_conductivity.py +++ b/unitsnet_py/units/electric_conductivity.py @@ -42,9 +42,30 @@ class ElectricConductivityUnits(Enum): class ElectricConductivityDto: + """ + A DTO representation of a ElectricConductivity + + Attributes: + value (float): The value of the ElectricConductivity. + unit (ElectricConductivityUnits): The specific unit that the ElectricConductivity value is representing. + """ + def __init__(self, value: float, unit: ElectricConductivityUnits): + """ + Create a new DTO representation of a ElectricConductivity + + Parameters: + value (float): The value of the ElectricConductivity. + unit (ElectricConductivityUnits): The specific unit that the ElectricConductivity value is representing. + """ self.value: float = value + """ + The value of the ElectricConductivity + """ self.unit: ElectricConductivityUnits = unit + """ + The specific unit that the ElectricConductivity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: ElectricConductivityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricConductivityUnits = ElectricConductivityUnits.SiemensPerMeter) -> ElectricConductivityDto: + """ + Get a new instance of ElectricConductivity DTO representing the current unit. + + :param hold_in_unit: The specific ElectricConductivity unit to store the ElectricConductivity value in the DTO representation. + :type hold_in_unit: ElectricConductivityUnits + :return: A new instance of ElectricConductivityDto. + :rtype: ElectricConductivityDto + """ return ElectricConductivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_conductivity_dto: ElectricConductivityDto): + """ + Obtain a new instance of ElectricConductivity from a DTO unit object. + + :param electric_conductivity_dto: The ElectricConductivity DTO representation. + :type electric_conductivity_dto: ElectricConductivityDto + :return: A new instance of ElectricConductivity. + :rtype: ElectricConductivity + """ return ElectricConductivity(electric_conductivity_dto.value, electric_conductivity_dto.unit) def __convert_from_base(self, from_unit: ElectricConductivityUnits) -> float: diff --git a/unitsnet_py/units/electric_current.py b/unitsnet_py/units/electric_current.py index 6aa7808..0338df3 100644 --- a/unitsnet_py/units/electric_current.py +++ b/unitsnet_py/units/electric_current.py @@ -57,9 +57,30 @@ class ElectricCurrentUnits(Enum): class ElectricCurrentDto: + """ + A DTO representation of a ElectricCurrent + + Attributes: + value (float): The value of the ElectricCurrent. + unit (ElectricCurrentUnits): The specific unit that the ElectricCurrent value is representing. + """ + def __init__(self, value: float, unit: ElectricCurrentUnits): + """ + Create a new DTO representation of a ElectricCurrent + + Parameters: + value (float): The value of the ElectricCurrent. + unit (ElectricCurrentUnits): The specific unit that the ElectricCurrent value is representing. + """ self.value: float = value + """ + The value of the ElectricCurrent + """ self.unit: ElectricCurrentUnits = unit + """ + The specific unit that the ElectricCurrent value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: ElectricCurrentUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricCurrentUnits = ElectricCurrentUnits.Ampere) -> ElectricCurrentDto: + """ + Get a new instance of ElectricCurrent DTO representing the current unit. + + :param hold_in_unit: The specific ElectricCurrent unit to store the ElectricCurrent value in the DTO representation. + :type hold_in_unit: ElectricCurrentUnits + :return: A new instance of ElectricCurrentDto. + :rtype: ElectricCurrentDto + """ return ElectricCurrentDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_current_dto: ElectricCurrentDto): + """ + Obtain a new instance of ElectricCurrent from a DTO unit object. + + :param electric_current_dto: The ElectricCurrent DTO representation. + :type electric_current_dto: ElectricCurrentDto + :return: A new instance of ElectricCurrent. + :rtype: ElectricCurrent + """ return ElectricCurrent(electric_current_dto.value, electric_current_dto.unit) def __convert_from_base(self, from_unit: ElectricCurrentUnits) -> float: diff --git a/unitsnet_py/units/electric_current_density.py b/unitsnet_py/units/electric_current_density.py index 1595b9b..c4eb4e8 100644 --- a/unitsnet_py/units/electric_current_density.py +++ b/unitsnet_py/units/electric_current_density.py @@ -27,9 +27,30 @@ class ElectricCurrentDensityUnits(Enum): class ElectricCurrentDensityDto: + """ + A DTO representation of a ElectricCurrentDensity + + Attributes: + value (float): The value of the ElectricCurrentDensity. + unit (ElectricCurrentDensityUnits): The specific unit that the ElectricCurrentDensity value is representing. + """ + def __init__(self, value: float, unit: ElectricCurrentDensityUnits): + """ + Create a new DTO representation of a ElectricCurrentDensity + + Parameters: + value (float): The value of the ElectricCurrentDensity. + unit (ElectricCurrentDensityUnits): The specific unit that the ElectricCurrentDensity value is representing. + """ self.value: float = value + """ + The value of the ElectricCurrentDensity + """ self.unit: ElectricCurrentDensityUnits = unit + """ + The specific unit that the ElectricCurrentDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: ElectricCurrentDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricCurrentDensityUnits = ElectricCurrentDensityUnits.AmperePerSquareMeter) -> ElectricCurrentDensityDto: + """ + Get a new instance of ElectricCurrentDensity DTO representing the current unit. + + :param hold_in_unit: The specific ElectricCurrentDensity unit to store the ElectricCurrentDensity value in the DTO representation. + :type hold_in_unit: ElectricCurrentDensityUnits + :return: A new instance of ElectricCurrentDensityDto. + :rtype: ElectricCurrentDensityDto + """ return ElectricCurrentDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_current_density_dto: ElectricCurrentDensityDto): + """ + Obtain a new instance of ElectricCurrentDensity from a DTO unit object. + + :param electric_current_density_dto: The ElectricCurrentDensity DTO representation. + :type electric_current_density_dto: ElectricCurrentDensityDto + :return: A new instance of ElectricCurrentDensity. + :rtype: ElectricCurrentDensity + """ return ElectricCurrentDensity(electric_current_density_dto.value, electric_current_density_dto.unit) def __convert_from_base(self, from_unit: ElectricCurrentDensityUnits) -> float: diff --git a/unitsnet_py/units/electric_current_gradient.py b/unitsnet_py/units/electric_current_gradient.py index d3d9d50..0163e52 100644 --- a/unitsnet_py/units/electric_current_gradient.py +++ b/unitsnet_py/units/electric_current_gradient.py @@ -47,9 +47,30 @@ class ElectricCurrentGradientUnits(Enum): class ElectricCurrentGradientDto: + """ + A DTO representation of a ElectricCurrentGradient + + Attributes: + value (float): The value of the ElectricCurrentGradient. + unit (ElectricCurrentGradientUnits): The specific unit that the ElectricCurrentGradient value is representing. + """ + def __init__(self, value: float, unit: ElectricCurrentGradientUnits): + """ + Create a new DTO representation of a ElectricCurrentGradient + + Parameters: + value (float): The value of the ElectricCurrentGradient. + unit (ElectricCurrentGradientUnits): The specific unit that the ElectricCurrentGradient value is representing. + """ self.value: float = value + """ + The value of the ElectricCurrentGradient + """ self.unit: ElectricCurrentGradientUnits = unit + """ + The specific unit that the ElectricCurrentGradient value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -93,10 +114,26 @@ def convert(self, unit: ElectricCurrentGradientUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricCurrentGradientUnits = ElectricCurrentGradientUnits.AmperePerSecond) -> ElectricCurrentGradientDto: + """ + Get a new instance of ElectricCurrentGradient DTO representing the current unit. + + :param hold_in_unit: The specific ElectricCurrentGradient unit to store the ElectricCurrentGradient value in the DTO representation. + :type hold_in_unit: ElectricCurrentGradientUnits + :return: A new instance of ElectricCurrentGradientDto. + :rtype: ElectricCurrentGradientDto + """ return ElectricCurrentGradientDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_current_gradient_dto: ElectricCurrentGradientDto): + """ + Obtain a new instance of ElectricCurrentGradient from a DTO unit object. + + :param electric_current_gradient_dto: The ElectricCurrentGradient DTO representation. + :type electric_current_gradient_dto: ElectricCurrentGradientDto + :return: A new instance of ElectricCurrentGradient. + :rtype: ElectricCurrentGradient + """ return ElectricCurrentGradient(electric_current_gradient_dto.value, electric_current_gradient_dto.unit) def __convert_from_base(self, from_unit: ElectricCurrentGradientUnits) -> float: diff --git a/unitsnet_py/units/electric_field.py b/unitsnet_py/units/electric_field.py index 61723ce..91be7ac 100644 --- a/unitsnet_py/units/electric_field.py +++ b/unitsnet_py/units/electric_field.py @@ -17,9 +17,30 @@ class ElectricFieldUnits(Enum): class ElectricFieldDto: + """ + A DTO representation of a ElectricField + + Attributes: + value (float): The value of the ElectricField. + unit (ElectricFieldUnits): The specific unit that the ElectricField value is representing. + """ + def __init__(self, value: float, unit: ElectricFieldUnits): + """ + Create a new DTO representation of a ElectricField + + Parameters: + value (float): The value of the ElectricField. + unit (ElectricFieldUnits): The specific unit that the ElectricField value is representing. + """ self.value: float = value + """ + The value of the ElectricField + """ self.unit: ElectricFieldUnits = unit + """ + The specific unit that the ElectricField value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: ElectricFieldUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricFieldUnits = ElectricFieldUnits.VoltPerMeter) -> ElectricFieldDto: + """ + Get a new instance of ElectricField DTO representing the current unit. + + :param hold_in_unit: The specific ElectricField unit to store the ElectricField value in the DTO representation. + :type hold_in_unit: ElectricFieldUnits + :return: A new instance of ElectricFieldDto. + :rtype: ElectricFieldDto + """ return ElectricFieldDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_field_dto: ElectricFieldDto): + """ + Obtain a new instance of ElectricField from a DTO unit object. + + :param electric_field_dto: The ElectricField DTO representation. + :type electric_field_dto: ElectricFieldDto + :return: A new instance of ElectricField. + :rtype: ElectricField + """ return ElectricField(electric_field_dto.value, electric_field_dto.unit) def __convert_from_base(self, from_unit: ElectricFieldUnits) -> float: diff --git a/unitsnet_py/units/electric_inductance.py b/unitsnet_py/units/electric_inductance.py index bc45e8b..b07f9fd 100644 --- a/unitsnet_py/units/electric_inductance.py +++ b/unitsnet_py/units/electric_inductance.py @@ -37,9 +37,30 @@ class ElectricInductanceUnits(Enum): class ElectricInductanceDto: + """ + A DTO representation of a ElectricInductance + + Attributes: + value (float): The value of the ElectricInductance. + unit (ElectricInductanceUnits): The specific unit that the ElectricInductance value is representing. + """ + def __init__(self, value: float, unit: ElectricInductanceUnits): + """ + Create a new DTO representation of a ElectricInductance + + Parameters: + value (float): The value of the ElectricInductance. + unit (ElectricInductanceUnits): The specific unit that the ElectricInductance value is representing. + """ self.value: float = value + """ + The value of the ElectricInductance + """ self.unit: ElectricInductanceUnits = unit + """ + The specific unit that the ElectricInductance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: ElectricInductanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricInductanceUnits = ElectricInductanceUnits.Henry) -> ElectricInductanceDto: + """ + Get a new instance of ElectricInductance DTO representing the current unit. + + :param hold_in_unit: The specific ElectricInductance unit to store the ElectricInductance value in the DTO representation. + :type hold_in_unit: ElectricInductanceUnits + :return: A new instance of ElectricInductanceDto. + :rtype: ElectricInductanceDto + """ return ElectricInductanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_inductance_dto: ElectricInductanceDto): + """ + Obtain a new instance of ElectricInductance from a DTO unit object. + + :param electric_inductance_dto: The ElectricInductance DTO representation. + :type electric_inductance_dto: ElectricInductanceDto + :return: A new instance of ElectricInductance. + :rtype: ElectricInductance + """ return ElectricInductance(electric_inductance_dto.value, electric_inductance_dto.unit) def __convert_from_base(self, from_unit: ElectricInductanceUnits) -> float: diff --git a/unitsnet_py/units/electric_potential.py b/unitsnet_py/units/electric_potential.py index 968bce5..7c1d088 100644 --- a/unitsnet_py/units/electric_potential.py +++ b/unitsnet_py/units/electric_potential.py @@ -42,9 +42,30 @@ class ElectricPotentialUnits(Enum): class ElectricPotentialDto: + """ + A DTO representation of a ElectricPotential + + Attributes: + value (float): The value of the ElectricPotential. + unit (ElectricPotentialUnits): The specific unit that the ElectricPotential value is representing. + """ + def __init__(self, value: float, unit: ElectricPotentialUnits): + """ + Create a new DTO representation of a ElectricPotential + + Parameters: + value (float): The value of the ElectricPotential. + unit (ElectricPotentialUnits): The specific unit that the ElectricPotential value is representing. + """ self.value: float = value + """ + The value of the ElectricPotential + """ self.unit: ElectricPotentialUnits = unit + """ + The specific unit that the ElectricPotential value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: ElectricPotentialUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricPotentialUnits = ElectricPotentialUnits.Volt) -> ElectricPotentialDto: + """ + Get a new instance of ElectricPotential DTO representing the current unit. + + :param hold_in_unit: The specific ElectricPotential unit to store the ElectricPotential value in the DTO representation. + :type hold_in_unit: ElectricPotentialUnits + :return: A new instance of ElectricPotentialDto. + :rtype: ElectricPotentialDto + """ return ElectricPotentialDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_potential_dto: ElectricPotentialDto): + """ + Obtain a new instance of ElectricPotential from a DTO unit object. + + :param electric_potential_dto: The ElectricPotential DTO representation. + :type electric_potential_dto: ElectricPotentialDto + :return: A new instance of ElectricPotential. + :rtype: ElectricPotential + """ return ElectricPotential(electric_potential_dto.value, electric_potential_dto.unit) def __convert_from_base(self, from_unit: ElectricPotentialUnits) -> float: diff --git a/unitsnet_py/units/electric_potential_ac.py b/unitsnet_py/units/electric_potential_ac.py index 5de65f5..10f0db1 100644 --- a/unitsnet_py/units/electric_potential_ac.py +++ b/unitsnet_py/units/electric_potential_ac.py @@ -37,9 +37,30 @@ class ElectricPotentialAcUnits(Enum): class ElectricPotentialAcDto: + """ + A DTO representation of a ElectricPotentialAc + + Attributes: + value (float): The value of the ElectricPotentialAc. + unit (ElectricPotentialAcUnits): The specific unit that the ElectricPotentialAc value is representing. + """ + def __init__(self, value: float, unit: ElectricPotentialAcUnits): + """ + Create a new DTO representation of a ElectricPotentialAc + + Parameters: + value (float): The value of the ElectricPotentialAc. + unit (ElectricPotentialAcUnits): The specific unit that the ElectricPotentialAc value is representing. + """ self.value: float = value + """ + The value of the ElectricPotentialAc + """ self.unit: ElectricPotentialAcUnits = unit + """ + The specific unit that the ElectricPotentialAc value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: ElectricPotentialAcUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricPotentialAcUnits = ElectricPotentialAcUnits.VoltAc) -> ElectricPotentialAcDto: + """ + Get a new instance of ElectricPotentialAc DTO representing the current unit. + + :param hold_in_unit: The specific ElectricPotentialAc unit to store the ElectricPotentialAc value in the DTO representation. + :type hold_in_unit: ElectricPotentialAcUnits + :return: A new instance of ElectricPotentialAcDto. + :rtype: ElectricPotentialAcDto + """ return ElectricPotentialAcDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_potential_ac_dto: ElectricPotentialAcDto): + """ + Obtain a new instance of ElectricPotentialAc from a DTO unit object. + + :param electric_potential_ac_dto: The ElectricPotentialAc DTO representation. + :type electric_potential_ac_dto: ElectricPotentialAcDto + :return: A new instance of ElectricPotentialAc. + :rtype: ElectricPotentialAc + """ return ElectricPotentialAc(electric_potential_ac_dto.value, electric_potential_ac_dto.unit) def __convert_from_base(self, from_unit: ElectricPotentialAcUnits) -> float: diff --git a/unitsnet_py/units/electric_potential_change_rate.py b/unitsnet_py/units/electric_potential_change_rate.py index af18082..cc7d08e 100644 --- a/unitsnet_py/units/electric_potential_change_rate.py +++ b/unitsnet_py/units/electric_potential_change_rate.py @@ -112,9 +112,30 @@ class ElectricPotentialChangeRateUnits(Enum): class ElectricPotentialChangeRateDto: + """ + A DTO representation of a ElectricPotentialChangeRate + + Attributes: + value (float): The value of the ElectricPotentialChangeRate. + unit (ElectricPotentialChangeRateUnits): The specific unit that the ElectricPotentialChangeRate value is representing. + """ + def __init__(self, value: float, unit: ElectricPotentialChangeRateUnits): + """ + Create a new DTO representation of a ElectricPotentialChangeRate + + Parameters: + value (float): The value of the ElectricPotentialChangeRate. + unit (ElectricPotentialChangeRateUnits): The specific unit that the ElectricPotentialChangeRate value is representing. + """ self.value: float = value + """ + The value of the ElectricPotentialChangeRate + """ self.unit: ElectricPotentialChangeRateUnits = unit + """ + The specific unit that the ElectricPotentialChangeRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -184,10 +205,26 @@ def convert(self, unit: ElectricPotentialChangeRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricPotentialChangeRateUnits = ElectricPotentialChangeRateUnits.VoltPerSecond) -> ElectricPotentialChangeRateDto: + """ + Get a new instance of ElectricPotentialChangeRate DTO representing the current unit. + + :param hold_in_unit: The specific ElectricPotentialChangeRate unit to store the ElectricPotentialChangeRate value in the DTO representation. + :type hold_in_unit: ElectricPotentialChangeRateUnits + :return: A new instance of ElectricPotentialChangeRateDto. + :rtype: ElectricPotentialChangeRateDto + """ return ElectricPotentialChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_potential_change_rate_dto: ElectricPotentialChangeRateDto): + """ + Obtain a new instance of ElectricPotentialChangeRate from a DTO unit object. + + :param electric_potential_change_rate_dto: The ElectricPotentialChangeRate DTO representation. + :type electric_potential_change_rate_dto: ElectricPotentialChangeRateDto + :return: A new instance of ElectricPotentialChangeRate. + :rtype: ElectricPotentialChangeRate + """ return ElectricPotentialChangeRate(electric_potential_change_rate_dto.value, electric_potential_change_rate_dto.unit) def __convert_from_base(self, from_unit: ElectricPotentialChangeRateUnits) -> float: diff --git a/unitsnet_py/units/electric_potential_dc.py b/unitsnet_py/units/electric_potential_dc.py index ad08b01..4409b8e 100644 --- a/unitsnet_py/units/electric_potential_dc.py +++ b/unitsnet_py/units/electric_potential_dc.py @@ -37,9 +37,30 @@ class ElectricPotentialDcUnits(Enum): class ElectricPotentialDcDto: + """ + A DTO representation of a ElectricPotentialDc + + Attributes: + value (float): The value of the ElectricPotentialDc. + unit (ElectricPotentialDcUnits): The specific unit that the ElectricPotentialDc value is representing. + """ + def __init__(self, value: float, unit: ElectricPotentialDcUnits): + """ + Create a new DTO representation of a ElectricPotentialDc + + Parameters: + value (float): The value of the ElectricPotentialDc. + unit (ElectricPotentialDcUnits): The specific unit that the ElectricPotentialDc value is representing. + """ self.value: float = value + """ + The value of the ElectricPotentialDc + """ self.unit: ElectricPotentialDcUnits = unit + """ + The specific unit that the ElectricPotentialDc value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: ElectricPotentialDcUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricPotentialDcUnits = ElectricPotentialDcUnits.VoltDc) -> ElectricPotentialDcDto: + """ + Get a new instance of ElectricPotentialDc DTO representing the current unit. + + :param hold_in_unit: The specific ElectricPotentialDc unit to store the ElectricPotentialDc value in the DTO representation. + :type hold_in_unit: ElectricPotentialDcUnits + :return: A new instance of ElectricPotentialDcDto. + :rtype: ElectricPotentialDcDto + """ return ElectricPotentialDcDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_potential_dc_dto: ElectricPotentialDcDto): + """ + Obtain a new instance of ElectricPotentialDc from a DTO unit object. + + :param electric_potential_dc_dto: The ElectricPotentialDc DTO representation. + :type electric_potential_dc_dto: ElectricPotentialDcDto + :return: A new instance of ElectricPotentialDc. + :rtype: ElectricPotentialDc + """ return ElectricPotentialDc(electric_potential_dc_dto.value, electric_potential_dc_dto.unit) def __convert_from_base(self, from_unit: ElectricPotentialDcUnits) -> float: diff --git a/unitsnet_py/units/electric_resistance.py b/unitsnet_py/units/electric_resistance.py index 8a3a705..a91c667 100644 --- a/unitsnet_py/units/electric_resistance.py +++ b/unitsnet_py/units/electric_resistance.py @@ -47,9 +47,30 @@ class ElectricResistanceUnits(Enum): class ElectricResistanceDto: + """ + A DTO representation of a ElectricResistance + + Attributes: + value (float): The value of the ElectricResistance. + unit (ElectricResistanceUnits): The specific unit that the ElectricResistance value is representing. + """ + def __init__(self, value: float, unit: ElectricResistanceUnits): + """ + Create a new DTO representation of a ElectricResistance + + Parameters: + value (float): The value of the ElectricResistance. + unit (ElectricResistanceUnits): The specific unit that the ElectricResistance value is representing. + """ self.value: float = value + """ + The value of the ElectricResistance + """ self.unit: ElectricResistanceUnits = unit + """ + The specific unit that the ElectricResistance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -93,10 +114,26 @@ def convert(self, unit: ElectricResistanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricResistanceUnits = ElectricResistanceUnits.Ohm) -> ElectricResistanceDto: + """ + Get a new instance of ElectricResistance DTO representing the current unit. + + :param hold_in_unit: The specific ElectricResistance unit to store the ElectricResistance value in the DTO representation. + :type hold_in_unit: ElectricResistanceUnits + :return: A new instance of ElectricResistanceDto. + :rtype: ElectricResistanceDto + """ return ElectricResistanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_resistance_dto: ElectricResistanceDto): + """ + Obtain a new instance of ElectricResistance from a DTO unit object. + + :param electric_resistance_dto: The ElectricResistance DTO representation. + :type electric_resistance_dto: ElectricResistanceDto + :return: A new instance of ElectricResistance. + :rtype: ElectricResistance + """ return ElectricResistance(electric_resistance_dto.value, electric_resistance_dto.unit) def __convert_from_base(self, from_unit: ElectricResistanceUnits) -> float: diff --git a/unitsnet_py/units/electric_resistivity.py b/unitsnet_py/units/electric_resistivity.py index 644bcff..9c6aabe 100644 --- a/unitsnet_py/units/electric_resistivity.py +++ b/unitsnet_py/units/electric_resistivity.py @@ -82,9 +82,30 @@ class ElectricResistivityUnits(Enum): class ElectricResistivityDto: + """ + A DTO representation of a ElectricResistivity + + Attributes: + value (float): The value of the ElectricResistivity. + unit (ElectricResistivityUnits): The specific unit that the ElectricResistivity value is representing. + """ + def __init__(self, value: float, unit: ElectricResistivityUnits): + """ + Create a new DTO representation of a ElectricResistivity + + Parameters: + value (float): The value of the ElectricResistivity. + unit (ElectricResistivityUnits): The specific unit that the ElectricResistivity value is representing. + """ self.value: float = value + """ + The value of the ElectricResistivity + """ self.unit: ElectricResistivityUnits = unit + """ + The specific unit that the ElectricResistivity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: ElectricResistivityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricResistivityUnits = ElectricResistivityUnits.OhmMeter) -> ElectricResistivityDto: + """ + Get a new instance of ElectricResistivity DTO representing the current unit. + + :param hold_in_unit: The specific ElectricResistivity unit to store the ElectricResistivity value in the DTO representation. + :type hold_in_unit: ElectricResistivityUnits + :return: A new instance of ElectricResistivityDto. + :rtype: ElectricResistivityDto + """ return ElectricResistivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_resistivity_dto: ElectricResistivityDto): + """ + Obtain a new instance of ElectricResistivity from a DTO unit object. + + :param electric_resistivity_dto: The ElectricResistivity DTO representation. + :type electric_resistivity_dto: ElectricResistivityDto + :return: A new instance of ElectricResistivity. + :rtype: ElectricResistivity + """ return ElectricResistivity(electric_resistivity_dto.value, electric_resistivity_dto.unit) def __convert_from_base(self, from_unit: ElectricResistivityUnits) -> float: diff --git a/unitsnet_py/units/electric_surface_charge_density.py b/unitsnet_py/units/electric_surface_charge_density.py index c6761ba..3d25cbf 100644 --- a/unitsnet_py/units/electric_surface_charge_density.py +++ b/unitsnet_py/units/electric_surface_charge_density.py @@ -27,9 +27,30 @@ class ElectricSurfaceChargeDensityUnits(Enum): class ElectricSurfaceChargeDensityDto: + """ + A DTO representation of a ElectricSurfaceChargeDensity + + Attributes: + value (float): The value of the ElectricSurfaceChargeDensity. + unit (ElectricSurfaceChargeDensityUnits): The specific unit that the ElectricSurfaceChargeDensity value is representing. + """ + def __init__(self, value: float, unit: ElectricSurfaceChargeDensityUnits): + """ + Create a new DTO representation of a ElectricSurfaceChargeDensity + + Parameters: + value (float): The value of the ElectricSurfaceChargeDensity. + unit (ElectricSurfaceChargeDensityUnits): The specific unit that the ElectricSurfaceChargeDensity value is representing. + """ self.value: float = value + """ + The value of the ElectricSurfaceChargeDensity + """ self.unit: ElectricSurfaceChargeDensityUnits = unit + """ + The specific unit that the ElectricSurfaceChargeDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: ElectricSurfaceChargeDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ElectricSurfaceChargeDensityUnits = ElectricSurfaceChargeDensityUnits.CoulombPerSquareMeter) -> ElectricSurfaceChargeDensityDto: + """ + Get a new instance of ElectricSurfaceChargeDensity DTO representing the current unit. + + :param hold_in_unit: The specific ElectricSurfaceChargeDensity unit to store the ElectricSurfaceChargeDensity value in the DTO representation. + :type hold_in_unit: ElectricSurfaceChargeDensityUnits + :return: A new instance of ElectricSurfaceChargeDensityDto. + :rtype: ElectricSurfaceChargeDensityDto + """ return ElectricSurfaceChargeDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(electric_surface_charge_density_dto: ElectricSurfaceChargeDensityDto): + """ + Obtain a new instance of ElectricSurfaceChargeDensity from a DTO unit object. + + :param electric_surface_charge_density_dto: The ElectricSurfaceChargeDensity DTO representation. + :type electric_surface_charge_density_dto: ElectricSurfaceChargeDensityDto + :return: A new instance of ElectricSurfaceChargeDensity. + :rtype: ElectricSurfaceChargeDensity + """ return ElectricSurfaceChargeDensity(electric_surface_charge_density_dto.value, electric_surface_charge_density_dto.unit) def __convert_from_base(self, from_unit: ElectricSurfaceChargeDensityUnits) -> float: diff --git a/unitsnet_py/units/energy.py b/unitsnet_py/units/energy.py index 01d01a4..0c20d16 100644 --- a/unitsnet_py/units/energy.py +++ b/unitsnet_py/units/energy.py @@ -212,9 +212,30 @@ class EnergyUnits(Enum): class EnergyDto: + """ + A DTO representation of a Energy + + Attributes: + value (float): The value of the Energy. + unit (EnergyUnits): The specific unit that the Energy value is representing. + """ + def __init__(self, value: float, unit: EnergyUnits): + """ + Create a new DTO representation of a Energy + + Parameters: + value (float): The value of the Energy. + unit (EnergyUnits): The specific unit that the Energy value is representing. + """ self.value: float = value + """ + The value of the Energy + """ self.unit: EnergyUnits = unit + """ + The specific unit that the Energy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -324,10 +345,26 @@ def convert(self, unit: EnergyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: EnergyUnits = EnergyUnits.Joule) -> EnergyDto: + """ + Get a new instance of Energy DTO representing the current unit. + + :param hold_in_unit: The specific Energy unit to store the Energy value in the DTO representation. + :type hold_in_unit: EnergyUnits + :return: A new instance of EnergyDto. + :rtype: EnergyDto + """ return EnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(energy_dto: EnergyDto): + """ + Obtain a new instance of Energy from a DTO unit object. + + :param energy_dto: The Energy DTO representation. + :type energy_dto: EnergyDto + :return: A new instance of Energy. + :rtype: Energy + """ return Energy(energy_dto.value, energy_dto.unit) def __convert_from_base(self, from_unit: EnergyUnits) -> float: diff --git a/unitsnet_py/units/energy_density.py b/unitsnet_py/units/energy_density.py index b83c246..b4093f0 100644 --- a/unitsnet_py/units/energy_density.py +++ b/unitsnet_py/units/energy_density.py @@ -72,9 +72,30 @@ class EnergyDensityUnits(Enum): class EnergyDensityDto: + """ + A DTO representation of a EnergyDensity + + Attributes: + value (float): The value of the EnergyDensity. + unit (EnergyDensityUnits): The specific unit that the EnergyDensity value is representing. + """ + def __init__(self, value: float, unit: EnergyDensityUnits): + """ + Create a new DTO representation of a EnergyDensity + + Parameters: + value (float): The value of the EnergyDensity. + unit (EnergyDensityUnits): The specific unit that the EnergyDensity value is representing. + """ self.value: float = value + """ + The value of the EnergyDensity + """ self.unit: EnergyDensityUnits = unit + """ + The specific unit that the EnergyDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -128,10 +149,26 @@ def convert(self, unit: EnergyDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: EnergyDensityUnits = EnergyDensityUnits.JoulePerCubicMeter) -> EnergyDensityDto: + """ + Get a new instance of EnergyDensity DTO representing the current unit. + + :param hold_in_unit: The specific EnergyDensity unit to store the EnergyDensity value in the DTO representation. + :type hold_in_unit: EnergyDensityUnits + :return: A new instance of EnergyDensityDto. + :rtype: EnergyDensityDto + """ return EnergyDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(energy_density_dto: EnergyDensityDto): + """ + Obtain a new instance of EnergyDensity from a DTO unit object. + + :param energy_density_dto: The EnergyDensity DTO representation. + :type energy_density_dto: EnergyDensityDto + :return: A new instance of EnergyDensity. + :rtype: EnergyDensity + """ return EnergyDensity(energy_density_dto.value, energy_density_dto.unit) def __convert_from_base(self, from_unit: EnergyDensityUnits) -> float: diff --git a/unitsnet_py/units/entropy.py b/unitsnet_py/units/entropy.py index 4c50d97..6a933f2 100644 --- a/unitsnet_py/units/entropy.py +++ b/unitsnet_py/units/entropy.py @@ -47,9 +47,30 @@ class EntropyUnits(Enum): class EntropyDto: + """ + A DTO representation of a Entropy + + Attributes: + value (float): The value of the Entropy. + unit (EntropyUnits): The specific unit that the Entropy value is representing. + """ + def __init__(self, value: float, unit: EntropyUnits): + """ + Create a new DTO representation of a Entropy + + Parameters: + value (float): The value of the Entropy. + unit (EntropyUnits): The specific unit that the Entropy value is representing. + """ self.value: float = value + """ + The value of the Entropy + """ self.unit: EntropyUnits = unit + """ + The specific unit that the Entropy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -93,10 +114,26 @@ def convert(self, unit: EntropyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: EntropyUnits = EntropyUnits.JoulePerKelvin) -> EntropyDto: + """ + Get a new instance of Entropy DTO representing the current unit. + + :param hold_in_unit: The specific Entropy unit to store the Entropy value in the DTO representation. + :type hold_in_unit: EntropyUnits + :return: A new instance of EntropyDto. + :rtype: EntropyDto + """ return EntropyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(entropy_dto: EntropyDto): + """ + Obtain a new instance of Entropy from a DTO unit object. + + :param entropy_dto: The Entropy DTO representation. + :type entropy_dto: EntropyDto + :return: A new instance of Entropy. + :rtype: Entropy + """ return Entropy(entropy_dto.value, entropy_dto.unit) def __convert_from_base(self, from_unit: EntropyUnits) -> float: diff --git a/unitsnet_py/units/force.py b/unitsnet_py/units/force.py index 3846463..c9dc658 100644 --- a/unitsnet_py/units/force.py +++ b/unitsnet_py/units/force.py @@ -87,9 +87,30 @@ class ForceUnits(Enum): class ForceDto: + """ + A DTO representation of a Force + + Attributes: + value (float): The value of the Force. + unit (ForceUnits): The specific unit that the Force value is representing. + """ + def __init__(self, value: float, unit: ForceUnits): + """ + Create a new DTO representation of a Force + + Parameters: + value (float): The value of the Force. + unit (ForceUnits): The specific unit that the Force value is representing. + """ self.value: float = value + """ + The value of the Force + """ self.unit: ForceUnits = unit + """ + The specific unit that the Force value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -149,10 +170,26 @@ def convert(self, unit: ForceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ForceUnits = ForceUnits.Newton) -> ForceDto: + """ + Get a new instance of Force DTO representing the current unit. + + :param hold_in_unit: The specific Force unit to store the Force value in the DTO representation. + :type hold_in_unit: ForceUnits + :return: A new instance of ForceDto. + :rtype: ForceDto + """ return ForceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(force_dto: ForceDto): + """ + Obtain a new instance of Force from a DTO unit object. + + :param force_dto: The Force DTO representation. + :type force_dto: ForceDto + :return: A new instance of Force. + :rtype: Force + """ return Force(force_dto.value, force_dto.unit) def __convert_from_base(self, from_unit: ForceUnits) -> float: diff --git a/unitsnet_py/units/force_change_rate.py b/unitsnet_py/units/force_change_rate.py index e289a04..3e16aa2 100644 --- a/unitsnet_py/units/force_change_rate.py +++ b/unitsnet_py/units/force_change_rate.py @@ -87,9 +87,30 @@ class ForceChangeRateUnits(Enum): class ForceChangeRateDto: + """ + A DTO representation of a ForceChangeRate + + Attributes: + value (float): The value of the ForceChangeRate. + unit (ForceChangeRateUnits): The specific unit that the ForceChangeRate value is representing. + """ + def __init__(self, value: float, unit: ForceChangeRateUnits): + """ + Create a new DTO representation of a ForceChangeRate + + Parameters: + value (float): The value of the ForceChangeRate. + unit (ForceChangeRateUnits): The specific unit that the ForceChangeRate value is representing. + """ self.value: float = value + """ + The value of the ForceChangeRate + """ self.unit: ForceChangeRateUnits = unit + """ + The specific unit that the ForceChangeRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -149,10 +170,26 @@ def convert(self, unit: ForceChangeRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ForceChangeRateUnits = ForceChangeRateUnits.NewtonPerSecond) -> ForceChangeRateDto: + """ + Get a new instance of ForceChangeRate DTO representing the current unit. + + :param hold_in_unit: The specific ForceChangeRate unit to store the ForceChangeRate value in the DTO representation. + :type hold_in_unit: ForceChangeRateUnits + :return: A new instance of ForceChangeRateDto. + :rtype: ForceChangeRateDto + """ return ForceChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(force_change_rate_dto: ForceChangeRateDto): + """ + Obtain a new instance of ForceChangeRate from a DTO unit object. + + :param force_change_rate_dto: The ForceChangeRate DTO representation. + :type force_change_rate_dto: ForceChangeRateDto + :return: A new instance of ForceChangeRate. + :rtype: ForceChangeRate + """ return ForceChangeRate(force_change_rate_dto.value, force_change_rate_dto.unit) def __convert_from_base(self, from_unit: ForceChangeRateUnits) -> float: diff --git a/unitsnet_py/units/force_per_length.py b/unitsnet_py/units/force_per_length.py index 966ba21..5dc2488 100644 --- a/unitsnet_py/units/force_per_length.py +++ b/unitsnet_py/units/force_per_length.py @@ -202,9 +202,30 @@ class ForcePerLengthUnits(Enum): class ForcePerLengthDto: + """ + A DTO representation of a ForcePerLength + + Attributes: + value (float): The value of the ForcePerLength. + unit (ForcePerLengthUnits): The specific unit that the ForcePerLength value is representing. + """ + def __init__(self, value: float, unit: ForcePerLengthUnits): + """ + Create a new DTO representation of a ForcePerLength + + Parameters: + value (float): The value of the ForcePerLength. + unit (ForcePerLengthUnits): The specific unit that the ForcePerLength value is representing. + """ self.value: float = value + """ + The value of the ForcePerLength + """ self.unit: ForcePerLengthUnits = unit + """ + The specific unit that the ForcePerLength value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -310,10 +331,26 @@ def convert(self, unit: ForcePerLengthUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ForcePerLengthUnits = ForcePerLengthUnits.NewtonPerMeter) -> ForcePerLengthDto: + """ + Get a new instance of ForcePerLength DTO representing the current unit. + + :param hold_in_unit: The specific ForcePerLength unit to store the ForcePerLength value in the DTO representation. + :type hold_in_unit: ForcePerLengthUnits + :return: A new instance of ForcePerLengthDto. + :rtype: ForcePerLengthDto + """ return ForcePerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(force_per_length_dto: ForcePerLengthDto): + """ + Obtain a new instance of ForcePerLength from a DTO unit object. + + :param force_per_length_dto: The ForcePerLength DTO representation. + :type force_per_length_dto: ForcePerLengthDto + :return: A new instance of ForcePerLength. + :rtype: ForcePerLength + """ return ForcePerLength(force_per_length_dto.value, force_per_length_dto.unit) def __convert_from_base(self, from_unit: ForcePerLengthUnits) -> float: diff --git a/unitsnet_py/units/frequency.py b/unitsnet_py/units/frequency.py index 6542704..c3c334a 100644 --- a/unitsnet_py/units/frequency.py +++ b/unitsnet_py/units/frequency.py @@ -77,9 +77,30 @@ class FrequencyUnits(Enum): class FrequencyDto: + """ + A DTO representation of a Frequency + + Attributes: + value (float): The value of the Frequency. + unit (FrequencyUnits): The specific unit that the Frequency value is representing. + """ + def __init__(self, value: float, unit: FrequencyUnits): + """ + Create a new DTO representation of a Frequency + + Parameters: + value (float): The value of the Frequency. + unit (FrequencyUnits): The specific unit that the Frequency value is representing. + """ self.value: float = value + """ + The value of the Frequency + """ self.unit: FrequencyUnits = unit + """ + The specific unit that the Frequency value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -135,10 +156,26 @@ def convert(self, unit: FrequencyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: FrequencyUnits = FrequencyUnits.Hertz) -> FrequencyDto: + """ + Get a new instance of Frequency DTO representing the current unit. + + :param hold_in_unit: The specific Frequency unit to store the Frequency value in the DTO representation. + :type hold_in_unit: FrequencyUnits + :return: A new instance of FrequencyDto. + :rtype: FrequencyDto + """ return FrequencyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(frequency_dto: FrequencyDto): + """ + Obtain a new instance of Frequency from a DTO unit object. + + :param frequency_dto: The Frequency DTO representation. + :type frequency_dto: FrequencyDto + :return: A new instance of Frequency. + :rtype: Frequency + """ return Frequency(frequency_dto.value, frequency_dto.unit) def __convert_from_base(self, from_unit: FrequencyUnits) -> float: diff --git a/unitsnet_py/units/fuel_efficiency.py b/unitsnet_py/units/fuel_efficiency.py index f27a72e..ddf10d8 100644 --- a/unitsnet_py/units/fuel_efficiency.py +++ b/unitsnet_py/units/fuel_efficiency.py @@ -32,9 +32,30 @@ class FuelEfficiencyUnits(Enum): class FuelEfficiencyDto: + """ + A DTO representation of a FuelEfficiency + + Attributes: + value (float): The value of the FuelEfficiency. + unit (FuelEfficiencyUnits): The specific unit that the FuelEfficiency value is representing. + """ + def __init__(self, value: float, unit: FuelEfficiencyUnits): + """ + Create a new DTO representation of a FuelEfficiency + + Parameters: + value (float): The value of the FuelEfficiency. + unit (FuelEfficiencyUnits): The specific unit that the FuelEfficiency value is representing. + """ self.value: float = value + """ + The value of the FuelEfficiency + """ self.unit: FuelEfficiencyUnits = unit + """ + The specific unit that the FuelEfficiency value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: FuelEfficiencyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: FuelEfficiencyUnits = FuelEfficiencyUnits.LiterPer100Kilometers) -> FuelEfficiencyDto: + """ + Get a new instance of FuelEfficiency DTO representing the current unit. + + :param hold_in_unit: The specific FuelEfficiency unit to store the FuelEfficiency value in the DTO representation. + :type hold_in_unit: FuelEfficiencyUnits + :return: A new instance of FuelEfficiencyDto. + :rtype: FuelEfficiencyDto + """ return FuelEfficiencyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(fuel_efficiency_dto: FuelEfficiencyDto): + """ + Obtain a new instance of FuelEfficiency from a DTO unit object. + + :param fuel_efficiency_dto: The FuelEfficiency DTO representation. + :type fuel_efficiency_dto: FuelEfficiencyDto + :return: A new instance of FuelEfficiency. + :rtype: FuelEfficiency + """ return FuelEfficiency(fuel_efficiency_dto.value, fuel_efficiency_dto.unit) def __convert_from_base(self, from_unit: FuelEfficiencyUnits) -> float: diff --git a/unitsnet_py/units/heat_flux.py b/unitsnet_py/units/heat_flux.py index 8200ab2..92bed89 100644 --- a/unitsnet_py/units/heat_flux.py +++ b/unitsnet_py/units/heat_flux.py @@ -102,9 +102,30 @@ class HeatFluxUnits(Enum): class HeatFluxDto: + """ + A DTO representation of a HeatFlux + + Attributes: + value (float): The value of the HeatFlux. + unit (HeatFluxUnits): The specific unit that the HeatFlux value is representing. + """ + def __init__(self, value: float, unit: HeatFluxUnits): + """ + Create a new DTO representation of a HeatFlux + + Parameters: + value (float): The value of the HeatFlux. + unit (HeatFluxUnits): The specific unit that the HeatFlux value is representing. + """ self.value: float = value + """ + The value of the HeatFlux + """ self.unit: HeatFluxUnits = unit + """ + The specific unit that the HeatFlux value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -170,10 +191,26 @@ def convert(self, unit: HeatFluxUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: HeatFluxUnits = HeatFluxUnits.WattPerSquareMeter) -> HeatFluxDto: + """ + Get a new instance of HeatFlux DTO representing the current unit. + + :param hold_in_unit: The specific HeatFlux unit to store the HeatFlux value in the DTO representation. + :type hold_in_unit: HeatFluxUnits + :return: A new instance of HeatFluxDto. + :rtype: HeatFluxDto + """ return HeatFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(heat_flux_dto: HeatFluxDto): + """ + Obtain a new instance of HeatFlux from a DTO unit object. + + :param heat_flux_dto: The HeatFlux DTO representation. + :type heat_flux_dto: HeatFluxDto + :return: A new instance of HeatFlux. + :rtype: HeatFlux + """ return HeatFlux(heat_flux_dto.value, heat_flux_dto.unit) def __convert_from_base(self, from_unit: HeatFluxUnits) -> float: diff --git a/unitsnet_py/units/heat_transfer_coefficient.py b/unitsnet_py/units/heat_transfer_coefficient.py index 595417c..3026c3b 100644 --- a/unitsnet_py/units/heat_transfer_coefficient.py +++ b/unitsnet_py/units/heat_transfer_coefficient.py @@ -37,9 +37,30 @@ class HeatTransferCoefficientUnits(Enum): class HeatTransferCoefficientDto: + """ + A DTO representation of a HeatTransferCoefficient + + Attributes: + value (float): The value of the HeatTransferCoefficient. + unit (HeatTransferCoefficientUnits): The specific unit that the HeatTransferCoefficient value is representing. + """ + def __init__(self, value: float, unit: HeatTransferCoefficientUnits): + """ + Create a new DTO representation of a HeatTransferCoefficient + + Parameters: + value (float): The value of the HeatTransferCoefficient. + unit (HeatTransferCoefficientUnits): The specific unit that the HeatTransferCoefficient value is representing. + """ self.value: float = value + """ + The value of the HeatTransferCoefficient + """ self.unit: HeatTransferCoefficientUnits = unit + """ + The specific unit that the HeatTransferCoefficient value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: HeatTransferCoefficientUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: HeatTransferCoefficientUnits = HeatTransferCoefficientUnits.WattPerSquareMeterKelvin) -> HeatTransferCoefficientDto: + """ + Get a new instance of HeatTransferCoefficient DTO representing the current unit. + + :param hold_in_unit: The specific HeatTransferCoefficient unit to store the HeatTransferCoefficient value in the DTO representation. + :type hold_in_unit: HeatTransferCoefficientUnits + :return: A new instance of HeatTransferCoefficientDto. + :rtype: HeatTransferCoefficientDto + """ return HeatTransferCoefficientDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(heat_transfer_coefficient_dto: HeatTransferCoefficientDto): + """ + Obtain a new instance of HeatTransferCoefficient from a DTO unit object. + + :param heat_transfer_coefficient_dto: The HeatTransferCoefficient DTO representation. + :type heat_transfer_coefficient_dto: HeatTransferCoefficientDto + :return: A new instance of HeatTransferCoefficient. + :rtype: HeatTransferCoefficient + """ return HeatTransferCoefficient(heat_transfer_coefficient_dto.value, heat_transfer_coefficient_dto.unit) def __convert_from_base(self, from_unit: HeatTransferCoefficientUnits) -> float: diff --git a/unitsnet_py/units/illuminance.py b/unitsnet_py/units/illuminance.py index 736f702..654b50e 100644 --- a/unitsnet_py/units/illuminance.py +++ b/unitsnet_py/units/illuminance.py @@ -32,9 +32,30 @@ class IlluminanceUnits(Enum): class IlluminanceDto: + """ + A DTO representation of a Illuminance + + Attributes: + value (float): The value of the Illuminance. + unit (IlluminanceUnits): The specific unit that the Illuminance value is representing. + """ + def __init__(self, value: float, unit: IlluminanceUnits): + """ + Create a new DTO representation of a Illuminance + + Parameters: + value (float): The value of the Illuminance. + unit (IlluminanceUnits): The specific unit that the Illuminance value is representing. + """ self.value: float = value + """ + The value of the Illuminance + """ self.unit: IlluminanceUnits = unit + """ + The specific unit that the Illuminance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: IlluminanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: IlluminanceUnits = IlluminanceUnits.Lux) -> IlluminanceDto: + """ + Get a new instance of Illuminance DTO representing the current unit. + + :param hold_in_unit: The specific Illuminance unit to store the Illuminance value in the DTO representation. + :type hold_in_unit: IlluminanceUnits + :return: A new instance of IlluminanceDto. + :rtype: IlluminanceDto + """ return IlluminanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(illuminance_dto: IlluminanceDto): + """ + Obtain a new instance of Illuminance from a DTO unit object. + + :param illuminance_dto: The Illuminance DTO representation. + :type illuminance_dto: IlluminanceDto + :return: A new instance of Illuminance. + :rtype: Illuminance + """ return Illuminance(illuminance_dto.value, illuminance_dto.unit) def __convert_from_base(self, from_unit: IlluminanceUnits) -> float: diff --git a/unitsnet_py/units/impulse.py b/unitsnet_py/units/impulse.py index b9b3cd4..8ca44fc 100644 --- a/unitsnet_py/units/impulse.py +++ b/unitsnet_py/units/impulse.py @@ -77,9 +77,30 @@ class ImpulseUnits(Enum): class ImpulseDto: + """ + A DTO representation of a Impulse + + Attributes: + value (float): The value of the Impulse. + unit (ImpulseUnits): The specific unit that the Impulse value is representing. + """ + def __init__(self, value: float, unit: ImpulseUnits): + """ + Create a new DTO representation of a Impulse + + Parameters: + value (float): The value of the Impulse. + unit (ImpulseUnits): The specific unit that the Impulse value is representing. + """ self.value: float = value + """ + The value of the Impulse + """ self.unit: ImpulseUnits = unit + """ + The specific unit that the Impulse value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -135,10 +156,26 @@ def convert(self, unit: ImpulseUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ImpulseUnits = ImpulseUnits.NewtonSecond) -> ImpulseDto: + """ + Get a new instance of Impulse DTO representing the current unit. + + :param hold_in_unit: The specific Impulse unit to store the Impulse value in the DTO representation. + :type hold_in_unit: ImpulseUnits + :return: A new instance of ImpulseDto. + :rtype: ImpulseDto + """ return ImpulseDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(impulse_dto: ImpulseDto): + """ + Obtain a new instance of Impulse from a DTO unit object. + + :param impulse_dto: The Impulse DTO representation. + :type impulse_dto: ImpulseDto + :return: A new instance of Impulse. + :rtype: Impulse + """ return Impulse(impulse_dto.value, impulse_dto.unit) def __convert_from_base(self, from_unit: ImpulseUnits) -> float: diff --git a/unitsnet_py/units/information.py b/unitsnet_py/units/information.py index aa3e8bb..5303d67 100644 --- a/unitsnet_py/units/information.py +++ b/unitsnet_py/units/information.py @@ -82,9 +82,30 @@ class InformationUnits(Enum): class InformationDto: + """ + A DTO representation of a Information + + Attributes: + value (float): The value of the Information. + unit (InformationUnits): The specific unit that the Information value is representing. + """ + def __init__(self, value: float, unit: InformationUnits): + """ + Create a new DTO representation of a Information + + Parameters: + value (float): The value of the Information. + unit (InformationUnits): The specific unit that the Information value is representing. + """ self.value: float = value + """ + The value of the Information + """ self.unit: InformationUnits = unit + """ + The specific unit that the Information value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: InformationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: InformationUnits = InformationUnits.Bit) -> InformationDto: + """ + Get a new instance of Information DTO representing the current unit. + + :param hold_in_unit: The specific Information unit to store the Information value in the DTO representation. + :type hold_in_unit: InformationUnits + :return: A new instance of InformationDto. + :rtype: InformationDto + """ return InformationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(information_dto: InformationDto): + """ + Obtain a new instance of Information from a DTO unit object. + + :param information_dto: The Information DTO representation. + :type information_dto: InformationDto + :return: A new instance of Information. + :rtype: Information + """ return Information(information_dto.value, information_dto.unit) def __convert_from_base(self, from_unit: InformationUnits) -> float: diff --git a/unitsnet_py/units/irradiance.py b/unitsnet_py/units/irradiance.py index 0173d34..99714ce 100644 --- a/unitsnet_py/units/irradiance.py +++ b/unitsnet_py/units/irradiance.py @@ -82,9 +82,30 @@ class IrradianceUnits(Enum): class IrradianceDto: + """ + A DTO representation of a Irradiance + + Attributes: + value (float): The value of the Irradiance. + unit (IrradianceUnits): The specific unit that the Irradiance value is representing. + """ + def __init__(self, value: float, unit: IrradianceUnits): + """ + Create a new DTO representation of a Irradiance + + Parameters: + value (float): The value of the Irradiance. + unit (IrradianceUnits): The specific unit that the Irradiance value is representing. + """ self.value: float = value + """ + The value of the Irradiance + """ self.unit: IrradianceUnits = unit + """ + The specific unit that the Irradiance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: IrradianceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: IrradianceUnits = IrradianceUnits.WattPerSquareMeter) -> IrradianceDto: + """ + Get a new instance of Irradiance DTO representing the current unit. + + :param hold_in_unit: The specific Irradiance unit to store the Irradiance value in the DTO representation. + :type hold_in_unit: IrradianceUnits + :return: A new instance of IrradianceDto. + :rtype: IrradianceDto + """ return IrradianceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(irradiance_dto: IrradianceDto): + """ + Obtain a new instance of Irradiance from a DTO unit object. + + :param irradiance_dto: The Irradiance DTO representation. + :type irradiance_dto: IrradianceDto + :return: A new instance of Irradiance. + :rtype: Irradiance + """ return Irradiance(irradiance_dto.value, irradiance_dto.unit) def __convert_from_base(self, from_unit: IrradianceUnits) -> float: diff --git a/unitsnet_py/units/irradiation.py b/unitsnet_py/units/irradiation.py index be8d925..46bff18 100644 --- a/unitsnet_py/units/irradiation.py +++ b/unitsnet_py/units/irradiation.py @@ -57,9 +57,30 @@ class IrradiationUnits(Enum): class IrradiationDto: + """ + A DTO representation of a Irradiation + + Attributes: + value (float): The value of the Irradiation. + unit (IrradiationUnits): The specific unit that the Irradiation value is representing. + """ + def __init__(self, value: float, unit: IrradiationUnits): + """ + Create a new DTO representation of a Irradiation + + Parameters: + value (float): The value of the Irradiation. + unit (IrradiationUnits): The specific unit that the Irradiation value is representing. + """ self.value: float = value + """ + The value of the Irradiation + """ self.unit: IrradiationUnits = unit + """ + The specific unit that the Irradiation value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: IrradiationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: IrradiationUnits = IrradiationUnits.JoulePerSquareMeter) -> IrradiationDto: + """ + Get a new instance of Irradiation DTO representing the current unit. + + :param hold_in_unit: The specific Irradiation unit to store the Irradiation value in the DTO representation. + :type hold_in_unit: IrradiationUnits + :return: A new instance of IrradiationDto. + :rtype: IrradiationDto + """ return IrradiationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(irradiation_dto: IrradiationDto): + """ + Obtain a new instance of Irradiation from a DTO unit object. + + :param irradiation_dto: The Irradiation DTO representation. + :type irradiation_dto: IrradiationDto + :return: A new instance of Irradiation. + :rtype: Irradiation + """ return Irradiation(irradiation_dto.value, irradiation_dto.unit) def __convert_from_base(self, from_unit: IrradiationUnits) -> float: diff --git a/unitsnet_py/units/jerk.py b/unitsnet_py/units/jerk.py index 35a9001..a6e57c1 100644 --- a/unitsnet_py/units/jerk.py +++ b/unitsnet_py/units/jerk.py @@ -67,9 +67,30 @@ class JerkUnits(Enum): class JerkDto: + """ + A DTO representation of a Jerk + + Attributes: + value (float): The value of the Jerk. + unit (JerkUnits): The specific unit that the Jerk value is representing. + """ + def __init__(self, value: float, unit: JerkUnits): + """ + Create a new DTO representation of a Jerk + + Parameters: + value (float): The value of the Jerk. + unit (JerkUnits): The specific unit that the Jerk value is representing. + """ self.value: float = value + """ + The value of the Jerk + """ self.unit: JerkUnits = unit + """ + The specific unit that the Jerk value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -121,10 +142,26 @@ def convert(self, unit: JerkUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: JerkUnits = JerkUnits.MeterPerSecondCubed) -> JerkDto: + """ + Get a new instance of Jerk DTO representing the current unit. + + :param hold_in_unit: The specific Jerk unit to store the Jerk value in the DTO representation. + :type hold_in_unit: JerkUnits + :return: A new instance of JerkDto. + :rtype: JerkDto + """ return JerkDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(jerk_dto: JerkDto): + """ + Obtain a new instance of Jerk from a DTO unit object. + + :param jerk_dto: The Jerk DTO representation. + :type jerk_dto: JerkDto + :return: A new instance of Jerk. + :rtype: Jerk + """ return Jerk(jerk_dto.value, jerk_dto.unit) def __convert_from_base(self, from_unit: JerkUnits) -> float: diff --git a/unitsnet_py/units/kinematic_viscosity.py b/unitsnet_py/units/kinematic_viscosity.py index 3d06859..8a00006 100644 --- a/unitsnet_py/units/kinematic_viscosity.py +++ b/unitsnet_py/units/kinematic_viscosity.py @@ -57,9 +57,30 @@ class KinematicViscosityUnits(Enum): class KinematicViscosityDto: + """ + A DTO representation of a KinematicViscosity + + Attributes: + value (float): The value of the KinematicViscosity. + unit (KinematicViscosityUnits): The specific unit that the KinematicViscosity value is representing. + """ + def __init__(self, value: float, unit: KinematicViscosityUnits): + """ + Create a new DTO representation of a KinematicViscosity + + Parameters: + value (float): The value of the KinematicViscosity. + unit (KinematicViscosityUnits): The specific unit that the KinematicViscosity value is representing. + """ self.value: float = value + """ + The value of the KinematicViscosity + """ self.unit: KinematicViscosityUnits = unit + """ + The specific unit that the KinematicViscosity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: KinematicViscosityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: KinematicViscosityUnits = KinematicViscosityUnits.SquareMeterPerSecond) -> KinematicViscosityDto: + """ + Get a new instance of KinematicViscosity DTO representing the current unit. + + :param hold_in_unit: The specific KinematicViscosity unit to store the KinematicViscosity value in the DTO representation. + :type hold_in_unit: KinematicViscosityUnits + :return: A new instance of KinematicViscosityDto. + :rtype: KinematicViscosityDto + """ return KinematicViscosityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(kinematic_viscosity_dto: KinematicViscosityDto): + """ + Obtain a new instance of KinematicViscosity from a DTO unit object. + + :param kinematic_viscosity_dto: The KinematicViscosity DTO representation. + :type kinematic_viscosity_dto: KinematicViscosityDto + :return: A new instance of KinematicViscosity. + :rtype: KinematicViscosity + """ return KinematicViscosity(kinematic_viscosity_dto.value, kinematic_viscosity_dto.unit) def __convert_from_base(self, from_unit: KinematicViscosityUnits) -> float: diff --git a/unitsnet_py/units/leak_rate.py b/unitsnet_py/units/leak_rate.py index 6892554..b316a5f 100644 --- a/unitsnet_py/units/leak_rate.py +++ b/unitsnet_py/units/leak_rate.py @@ -27,9 +27,30 @@ class LeakRateUnits(Enum): class LeakRateDto: + """ + A DTO representation of a LeakRate + + Attributes: + value (float): The value of the LeakRate. + unit (LeakRateUnits): The specific unit that the LeakRate value is representing. + """ + def __init__(self, value: float, unit: LeakRateUnits): + """ + Create a new DTO representation of a LeakRate + + Parameters: + value (float): The value of the LeakRate. + unit (LeakRateUnits): The specific unit that the LeakRate value is representing. + """ self.value: float = value + """ + The value of the LeakRate + """ self.unit: LeakRateUnits = unit + """ + The specific unit that the LeakRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: LeakRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LeakRateUnits = LeakRateUnits.PascalCubicMeterPerSecond) -> LeakRateDto: + """ + Get a new instance of LeakRate DTO representing the current unit. + + :param hold_in_unit: The specific LeakRate unit to store the LeakRate value in the DTO representation. + :type hold_in_unit: LeakRateUnits + :return: A new instance of LeakRateDto. + :rtype: LeakRateDto + """ return LeakRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(leak_rate_dto: LeakRateDto): + """ + Obtain a new instance of LeakRate from a DTO unit object. + + :param leak_rate_dto: The LeakRate DTO representation. + :type leak_rate_dto: LeakRateDto + :return: A new instance of LeakRate. + :rtype: LeakRate + """ return LeakRate(leak_rate_dto.value, leak_rate_dto.unit) def __convert_from_base(self, from_unit: LeakRateUnits) -> float: diff --git a/unitsnet_py/units/length.py b/unitsnet_py/units/length.py index fcf555b..7955732 100644 --- a/unitsnet_py/units/length.py +++ b/unitsnet_py/units/length.py @@ -222,9 +222,30 @@ class LengthUnits(Enum): class LengthDto: + """ + A DTO representation of a Length + + Attributes: + value (float): The value of the Length. + unit (LengthUnits): The specific unit that the Length value is representing. + """ + def __init__(self, value: float, unit: LengthUnits): + """ + Create a new DTO representation of a Length + + Parameters: + value (float): The value of the Length. + unit (LengthUnits): The specific unit that the Length value is representing. + """ self.value: float = value + """ + The value of the Length + """ self.unit: LengthUnits = unit + """ + The specific unit that the Length value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -338,10 +359,26 @@ def convert(self, unit: LengthUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LengthUnits = LengthUnits.Meter) -> LengthDto: + """ + Get a new instance of Length DTO representing the current unit. + + :param hold_in_unit: The specific Length unit to store the Length value in the DTO representation. + :type hold_in_unit: LengthUnits + :return: A new instance of LengthDto. + :rtype: LengthDto + """ return LengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(length_dto: LengthDto): + """ + Obtain a new instance of Length from a DTO unit object. + + :param length_dto: The Length DTO representation. + :type length_dto: LengthDto + :return: A new instance of Length. + :rtype: Length + """ return Length(length_dto.value, length_dto.unit) def __convert_from_base(self, from_unit: LengthUnits) -> float: diff --git a/unitsnet_py/units/level.py b/unitsnet_py/units/level.py index a9b41be..6f91de2 100644 --- a/unitsnet_py/units/level.py +++ b/unitsnet_py/units/level.py @@ -22,9 +22,30 @@ class LevelUnits(Enum): class LevelDto: + """ + A DTO representation of a Level + + Attributes: + value (float): The value of the Level. + unit (LevelUnits): The specific unit that the Level value is representing. + """ + def __init__(self, value: float, unit: LevelUnits): + """ + Create a new DTO representation of a Level + + Parameters: + value (float): The value of the Level. + unit (LevelUnits): The specific unit that the Level value is representing. + """ self.value: float = value + """ + The value of the Level + """ self.unit: LevelUnits = unit + """ + The specific unit that the Level value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -58,10 +79,26 @@ def convert(self, unit: LevelUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LevelUnits = LevelUnits.Decibel) -> LevelDto: + """ + Get a new instance of Level DTO representing the current unit. + + :param hold_in_unit: The specific Level unit to store the Level value in the DTO representation. + :type hold_in_unit: LevelUnits + :return: A new instance of LevelDto. + :rtype: LevelDto + """ return LevelDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(level_dto: LevelDto): + """ + Obtain a new instance of Level from a DTO unit object. + + :param level_dto: The Level DTO representation. + :type level_dto: LevelDto + :return: A new instance of Level. + :rtype: Level + """ return Level(level_dto.value, level_dto.unit) def __convert_from_base(self, from_unit: LevelUnits) -> float: diff --git a/unitsnet_py/units/linear_density.py b/unitsnet_py/units/linear_density.py index 7a425c3..f74d100 100644 --- a/unitsnet_py/units/linear_density.py +++ b/unitsnet_py/units/linear_density.py @@ -82,9 +82,30 @@ class LinearDensityUnits(Enum): class LinearDensityDto: + """ + A DTO representation of a LinearDensity + + Attributes: + value (float): The value of the LinearDensity. + unit (LinearDensityUnits): The specific unit that the LinearDensity value is representing. + """ + def __init__(self, value: float, unit: LinearDensityUnits): + """ + Create a new DTO representation of a LinearDensity + + Parameters: + value (float): The value of the LinearDensity. + unit (LinearDensityUnits): The specific unit that the LinearDensity value is representing. + """ self.value: float = value + """ + The value of the LinearDensity + """ self.unit: LinearDensityUnits = unit + """ + The specific unit that the LinearDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: LinearDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LinearDensityUnits = LinearDensityUnits.KilogramPerMeter) -> LinearDensityDto: + """ + Get a new instance of LinearDensity DTO representing the current unit. + + :param hold_in_unit: The specific LinearDensity unit to store the LinearDensity value in the DTO representation. + :type hold_in_unit: LinearDensityUnits + :return: A new instance of LinearDensityDto. + :rtype: LinearDensityDto + """ return LinearDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(linear_density_dto: LinearDensityDto): + """ + Obtain a new instance of LinearDensity from a DTO unit object. + + :param linear_density_dto: The LinearDensity DTO representation. + :type linear_density_dto: LinearDensityDto + :return: A new instance of LinearDensity. + :rtype: LinearDensity + """ return LinearDensity(linear_density_dto.value, linear_density_dto.unit) def __convert_from_base(self, from_unit: LinearDensityUnits) -> float: diff --git a/unitsnet_py/units/linear_power_density.py b/unitsnet_py/units/linear_power_density.py index 2bdcf51..ece5b3b 100644 --- a/unitsnet_py/units/linear_power_density.py +++ b/unitsnet_py/units/linear_power_density.py @@ -137,9 +137,30 @@ class LinearPowerDensityUnits(Enum): class LinearPowerDensityDto: + """ + A DTO representation of a LinearPowerDensity + + Attributes: + value (float): The value of the LinearPowerDensity. + unit (LinearPowerDensityUnits): The specific unit that the LinearPowerDensity value is representing. + """ + def __init__(self, value: float, unit: LinearPowerDensityUnits): + """ + Create a new DTO representation of a LinearPowerDensity + + Parameters: + value (float): The value of the LinearPowerDensity. + unit (LinearPowerDensityUnits): The specific unit that the LinearPowerDensity value is representing. + """ self.value: float = value + """ + The value of the LinearPowerDensity + """ self.unit: LinearPowerDensityUnits = unit + """ + The specific unit that the LinearPowerDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -219,10 +240,26 @@ def convert(self, unit: LinearPowerDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LinearPowerDensityUnits = LinearPowerDensityUnits.WattPerMeter) -> LinearPowerDensityDto: + """ + Get a new instance of LinearPowerDensity DTO representing the current unit. + + :param hold_in_unit: The specific LinearPowerDensity unit to store the LinearPowerDensity value in the DTO representation. + :type hold_in_unit: LinearPowerDensityUnits + :return: A new instance of LinearPowerDensityDto. + :rtype: LinearPowerDensityDto + """ return LinearPowerDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(linear_power_density_dto: LinearPowerDensityDto): + """ + Obtain a new instance of LinearPowerDensity from a DTO unit object. + + :param linear_power_density_dto: The LinearPowerDensity DTO representation. + :type linear_power_density_dto: LinearPowerDensityDto + :return: A new instance of LinearPowerDensity. + :rtype: LinearPowerDensity + """ return LinearPowerDensity(linear_power_density_dto.value, linear_power_density_dto.unit) def __convert_from_base(self, from_unit: LinearPowerDensityUnits) -> float: diff --git a/unitsnet_py/units/luminance.py b/unitsnet_py/units/luminance.py index 13f5b83..d730fe8 100644 --- a/unitsnet_py/units/luminance.py +++ b/unitsnet_py/units/luminance.py @@ -62,9 +62,30 @@ class LuminanceUnits(Enum): class LuminanceDto: + """ + A DTO representation of a Luminance + + Attributes: + value (float): The value of the Luminance. + unit (LuminanceUnits): The specific unit that the Luminance value is representing. + """ + def __init__(self, value: float, unit: LuminanceUnits): + """ + Create a new DTO representation of a Luminance + + Parameters: + value (float): The value of the Luminance. + unit (LuminanceUnits): The specific unit that the Luminance value is representing. + """ self.value: float = value + """ + The value of the Luminance + """ self.unit: LuminanceUnits = unit + """ + The specific unit that the Luminance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -114,10 +135,26 @@ def convert(self, unit: LuminanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LuminanceUnits = LuminanceUnits.CandelaPerSquareMeter) -> LuminanceDto: + """ + Get a new instance of Luminance DTO representing the current unit. + + :param hold_in_unit: The specific Luminance unit to store the Luminance value in the DTO representation. + :type hold_in_unit: LuminanceUnits + :return: A new instance of LuminanceDto. + :rtype: LuminanceDto + """ return LuminanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(luminance_dto: LuminanceDto): + """ + Obtain a new instance of Luminance from a DTO unit object. + + :param luminance_dto: The Luminance DTO representation. + :type luminance_dto: LuminanceDto + :return: A new instance of Luminance. + :rtype: Luminance + """ return Luminance(luminance_dto.value, luminance_dto.unit) def __convert_from_base(self, from_unit: LuminanceUnits) -> float: diff --git a/unitsnet_py/units/luminosity.py b/unitsnet_py/units/luminosity.py index 98594e6..bd4b03e 100644 --- a/unitsnet_py/units/luminosity.py +++ b/unitsnet_py/units/luminosity.py @@ -82,9 +82,30 @@ class LuminosityUnits(Enum): class LuminosityDto: + """ + A DTO representation of a Luminosity + + Attributes: + value (float): The value of the Luminosity. + unit (LuminosityUnits): The specific unit that the Luminosity value is representing. + """ + def __init__(self, value: float, unit: LuminosityUnits): + """ + Create a new DTO representation of a Luminosity + + Parameters: + value (float): The value of the Luminosity. + unit (LuminosityUnits): The specific unit that the Luminosity value is representing. + """ self.value: float = value + """ + The value of the Luminosity + """ self.unit: LuminosityUnits = unit + """ + The specific unit that the Luminosity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -142,10 +163,26 @@ def convert(self, unit: LuminosityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LuminosityUnits = LuminosityUnits.Watt) -> LuminosityDto: + """ + Get a new instance of Luminosity DTO representing the current unit. + + :param hold_in_unit: The specific Luminosity unit to store the Luminosity value in the DTO representation. + :type hold_in_unit: LuminosityUnits + :return: A new instance of LuminosityDto. + :rtype: LuminosityDto + """ return LuminosityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(luminosity_dto: LuminosityDto): + """ + Obtain a new instance of Luminosity from a DTO unit object. + + :param luminosity_dto: The Luminosity DTO representation. + :type luminosity_dto: LuminosityDto + :return: A new instance of Luminosity. + :rtype: Luminosity + """ return Luminosity(luminosity_dto.value, luminosity_dto.unit) def __convert_from_base(self, from_unit: LuminosityUnits) -> float: diff --git a/unitsnet_py/units/luminous_flux.py b/unitsnet_py/units/luminous_flux.py index 9689597..d4e5060 100644 --- a/unitsnet_py/units/luminous_flux.py +++ b/unitsnet_py/units/luminous_flux.py @@ -17,9 +17,30 @@ class LuminousFluxUnits(Enum): class LuminousFluxDto: + """ + A DTO representation of a LuminousFlux + + Attributes: + value (float): The value of the LuminousFlux. + unit (LuminousFluxUnits): The specific unit that the LuminousFlux value is representing. + """ + def __init__(self, value: float, unit: LuminousFluxUnits): + """ + Create a new DTO representation of a LuminousFlux + + Parameters: + value (float): The value of the LuminousFlux. + unit (LuminousFluxUnits): The specific unit that the LuminousFlux value is representing. + """ self.value: float = value + """ + The value of the LuminousFlux + """ self.unit: LuminousFluxUnits = unit + """ + The specific unit that the LuminousFlux value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: LuminousFluxUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LuminousFluxUnits = LuminousFluxUnits.Lumen) -> LuminousFluxDto: + """ + Get a new instance of LuminousFlux DTO representing the current unit. + + :param hold_in_unit: The specific LuminousFlux unit to store the LuminousFlux value in the DTO representation. + :type hold_in_unit: LuminousFluxUnits + :return: A new instance of LuminousFluxDto. + :rtype: LuminousFluxDto + """ return LuminousFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(luminous_flux_dto: LuminousFluxDto): + """ + Obtain a new instance of LuminousFlux from a DTO unit object. + + :param luminous_flux_dto: The LuminousFlux DTO representation. + :type luminous_flux_dto: LuminousFluxDto + :return: A new instance of LuminousFlux. + :rtype: LuminousFlux + """ return LuminousFlux(luminous_flux_dto.value, luminous_flux_dto.unit) def __convert_from_base(self, from_unit: LuminousFluxUnits) -> float: diff --git a/unitsnet_py/units/luminous_intensity.py b/unitsnet_py/units/luminous_intensity.py index 06b82a1..33b58ea 100644 --- a/unitsnet_py/units/luminous_intensity.py +++ b/unitsnet_py/units/luminous_intensity.py @@ -17,9 +17,30 @@ class LuminousIntensityUnits(Enum): class LuminousIntensityDto: + """ + A DTO representation of a LuminousIntensity + + Attributes: + value (float): The value of the LuminousIntensity. + unit (LuminousIntensityUnits): The specific unit that the LuminousIntensity value is representing. + """ + def __init__(self, value: float, unit: LuminousIntensityUnits): + """ + Create a new DTO representation of a LuminousIntensity + + Parameters: + value (float): The value of the LuminousIntensity. + unit (LuminousIntensityUnits): The specific unit that the LuminousIntensity value is representing. + """ self.value: float = value + """ + The value of the LuminousIntensity + """ self.unit: LuminousIntensityUnits = unit + """ + The specific unit that the LuminousIntensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: LuminousIntensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: LuminousIntensityUnits = LuminousIntensityUnits.Candela) -> LuminousIntensityDto: + """ + Get a new instance of LuminousIntensity DTO representing the current unit. + + :param hold_in_unit: The specific LuminousIntensity unit to store the LuminousIntensity value in the DTO representation. + :type hold_in_unit: LuminousIntensityUnits + :return: A new instance of LuminousIntensityDto. + :rtype: LuminousIntensityDto + """ return LuminousIntensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(luminous_intensity_dto: LuminousIntensityDto): + """ + Obtain a new instance of LuminousIntensity from a DTO unit object. + + :param luminous_intensity_dto: The LuminousIntensity DTO representation. + :type luminous_intensity_dto: LuminousIntensityDto + :return: A new instance of LuminousIntensity. + :rtype: LuminousIntensity + """ return LuminousIntensity(luminous_intensity_dto.value, luminous_intensity_dto.unit) def __convert_from_base(self, from_unit: LuminousIntensityUnits) -> float: diff --git a/unitsnet_py/units/magnetic_field.py b/unitsnet_py/units/magnetic_field.py index b0f73a5..128ddac 100644 --- a/unitsnet_py/units/magnetic_field.py +++ b/unitsnet_py/units/magnetic_field.py @@ -42,9 +42,30 @@ class MagneticFieldUnits(Enum): class MagneticFieldDto: + """ + A DTO representation of a MagneticField + + Attributes: + value (float): The value of the MagneticField. + unit (MagneticFieldUnits): The specific unit that the MagneticField value is representing. + """ + def __init__(self, value: float, unit: MagneticFieldUnits): + """ + Create a new DTO representation of a MagneticField + + Parameters: + value (float): The value of the MagneticField. + unit (MagneticFieldUnits): The specific unit that the MagneticField value is representing. + """ self.value: float = value + """ + The value of the MagneticField + """ self.unit: MagneticFieldUnits = unit + """ + The specific unit that the MagneticField value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: MagneticFieldUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MagneticFieldUnits = MagneticFieldUnits.Tesla) -> MagneticFieldDto: + """ + Get a new instance of MagneticField DTO representing the current unit. + + :param hold_in_unit: The specific MagneticField unit to store the MagneticField value in the DTO representation. + :type hold_in_unit: MagneticFieldUnits + :return: A new instance of MagneticFieldDto. + :rtype: MagneticFieldDto + """ return MagneticFieldDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(magnetic_field_dto: MagneticFieldDto): + """ + Obtain a new instance of MagneticField from a DTO unit object. + + :param magnetic_field_dto: The MagneticField DTO representation. + :type magnetic_field_dto: MagneticFieldDto + :return: A new instance of MagneticField. + :rtype: MagneticField + """ return MagneticField(magnetic_field_dto.value, magnetic_field_dto.unit) def __convert_from_base(self, from_unit: MagneticFieldUnits) -> float: diff --git a/unitsnet_py/units/magnetic_flux.py b/unitsnet_py/units/magnetic_flux.py index 54d1f96..4a65028 100644 --- a/unitsnet_py/units/magnetic_flux.py +++ b/unitsnet_py/units/magnetic_flux.py @@ -17,9 +17,30 @@ class MagneticFluxUnits(Enum): class MagneticFluxDto: + """ + A DTO representation of a MagneticFlux + + Attributes: + value (float): The value of the MagneticFlux. + unit (MagneticFluxUnits): The specific unit that the MagneticFlux value is representing. + """ + def __init__(self, value: float, unit: MagneticFluxUnits): + """ + Create a new DTO representation of a MagneticFlux + + Parameters: + value (float): The value of the MagneticFlux. + unit (MagneticFluxUnits): The specific unit that the MagneticFlux value is representing. + """ self.value: float = value + """ + The value of the MagneticFlux + """ self.unit: MagneticFluxUnits = unit + """ + The specific unit that the MagneticFlux value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: MagneticFluxUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MagneticFluxUnits = MagneticFluxUnits.Weber) -> MagneticFluxDto: + """ + Get a new instance of MagneticFlux DTO representing the current unit. + + :param hold_in_unit: The specific MagneticFlux unit to store the MagneticFlux value in the DTO representation. + :type hold_in_unit: MagneticFluxUnits + :return: A new instance of MagneticFluxDto. + :rtype: MagneticFluxDto + """ return MagneticFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(magnetic_flux_dto: MagneticFluxDto): + """ + Obtain a new instance of MagneticFlux from a DTO unit object. + + :param magnetic_flux_dto: The MagneticFlux DTO representation. + :type magnetic_flux_dto: MagneticFluxDto + :return: A new instance of MagneticFlux. + :rtype: MagneticFlux + """ return MagneticFlux(magnetic_flux_dto.value, magnetic_flux_dto.unit) def __convert_from_base(self, from_unit: MagneticFluxUnits) -> float: diff --git a/unitsnet_py/units/magnetization.py b/unitsnet_py/units/magnetization.py index 4015a6a..e66d0d4 100644 --- a/unitsnet_py/units/magnetization.py +++ b/unitsnet_py/units/magnetization.py @@ -17,9 +17,30 @@ class MagnetizationUnits(Enum): class MagnetizationDto: + """ + A DTO representation of a Magnetization + + Attributes: + value (float): The value of the Magnetization. + unit (MagnetizationUnits): The specific unit that the Magnetization value is representing. + """ + def __init__(self, value: float, unit: MagnetizationUnits): + """ + Create a new DTO representation of a Magnetization + + Parameters: + value (float): The value of the Magnetization. + unit (MagnetizationUnits): The specific unit that the Magnetization value is representing. + """ self.value: float = value + """ + The value of the Magnetization + """ self.unit: MagnetizationUnits = unit + """ + The specific unit that the Magnetization value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: MagnetizationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MagnetizationUnits = MagnetizationUnits.AmperePerMeter) -> MagnetizationDto: + """ + Get a new instance of Magnetization DTO representing the current unit. + + :param hold_in_unit: The specific Magnetization unit to store the Magnetization value in the DTO representation. + :type hold_in_unit: MagnetizationUnits + :return: A new instance of MagnetizationDto. + :rtype: MagnetizationDto + """ return MagnetizationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(magnetization_dto: MagnetizationDto): + """ + Obtain a new instance of Magnetization from a DTO unit object. + + :param magnetization_dto: The Magnetization DTO representation. + :type magnetization_dto: MagnetizationDto + :return: A new instance of Magnetization. + :rtype: Magnetization + """ return Magnetization(magnetization_dto.value, magnetization_dto.unit) def __convert_from_base(self, from_unit: MagnetizationUnits) -> float: diff --git a/unitsnet_py/units/mass.py b/unitsnet_py/units/mass.py index 2ea2a3a..f415f1a 100644 --- a/unitsnet_py/units/mass.py +++ b/unitsnet_py/units/mass.py @@ -147,9 +147,30 @@ class MassUnits(Enum): class MassDto: + """ + A DTO representation of a Mass + + Attributes: + value (float): The value of the Mass. + unit (MassUnits): The specific unit that the Mass value is representing. + """ + def __init__(self, value: float, unit: MassUnits): + """ + Create a new DTO representation of a Mass + + Parameters: + value (float): The value of the Mass. + unit (MassUnits): The specific unit that the Mass value is representing. + """ self.value: float = value + """ + The value of the Mass + """ self.unit: MassUnits = unit + """ + The specific unit that the Mass value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -233,10 +254,26 @@ def convert(self, unit: MassUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MassUnits = MassUnits.Kilogram) -> MassDto: + """ + Get a new instance of Mass DTO representing the current unit. + + :param hold_in_unit: The specific Mass unit to store the Mass value in the DTO representation. + :type hold_in_unit: MassUnits + :return: A new instance of MassDto. + :rtype: MassDto + """ return MassDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(mass_dto: MassDto): + """ + Obtain a new instance of Mass from a DTO unit object. + + :param mass_dto: The Mass DTO representation. + :type mass_dto: MassDto + :return: A new instance of Mass. + :rtype: Mass + """ return Mass(mass_dto.value, mass_dto.unit) def __convert_from_base(self, from_unit: MassUnits) -> float: diff --git a/unitsnet_py/units/mass_concentration.py b/unitsnet_py/units/mass_concentration.py index 14d9606..6a85499 100644 --- a/unitsnet_py/units/mass_concentration.py +++ b/unitsnet_py/units/mass_concentration.py @@ -257,9 +257,30 @@ class MassConcentrationUnits(Enum): class MassConcentrationDto: + """ + A DTO representation of a MassConcentration + + Attributes: + value (float): The value of the MassConcentration. + unit (MassConcentrationUnits): The specific unit that the MassConcentration value is representing. + """ + def __init__(self, value: float, unit: MassConcentrationUnits): + """ + Create a new DTO representation of a MassConcentration + + Parameters: + value (float): The value of the MassConcentration. + unit (MassConcentrationUnits): The specific unit that the MassConcentration value is representing. + """ self.value: float = value + """ + The value of the MassConcentration + """ self.unit: MassConcentrationUnits = unit + """ + The specific unit that the MassConcentration value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -387,10 +408,26 @@ def convert(self, unit: MassConcentrationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MassConcentrationUnits = MassConcentrationUnits.KilogramPerCubicMeter) -> MassConcentrationDto: + """ + Get a new instance of MassConcentration DTO representing the current unit. + + :param hold_in_unit: The specific MassConcentration unit to store the MassConcentration value in the DTO representation. + :type hold_in_unit: MassConcentrationUnits + :return: A new instance of MassConcentrationDto. + :rtype: MassConcentrationDto + """ return MassConcentrationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(mass_concentration_dto: MassConcentrationDto): + """ + Obtain a new instance of MassConcentration from a DTO unit object. + + :param mass_concentration_dto: The MassConcentration DTO representation. + :type mass_concentration_dto: MassConcentrationDto + :return: A new instance of MassConcentration. + :rtype: MassConcentration + """ return MassConcentration(mass_concentration_dto.value, mass_concentration_dto.unit) def __convert_from_base(self, from_unit: MassConcentrationUnits) -> float: diff --git a/unitsnet_py/units/mass_flow.py b/unitsnet_py/units/mass_flow.py index b5e2c60..426089b 100644 --- a/unitsnet_py/units/mass_flow.py +++ b/unitsnet_py/units/mass_flow.py @@ -177,9 +177,30 @@ class MassFlowUnits(Enum): class MassFlowDto: + """ + A DTO representation of a MassFlow + + Attributes: + value (float): The value of the MassFlow. + unit (MassFlowUnits): The specific unit that the MassFlow value is representing. + """ + def __init__(self, value: float, unit: MassFlowUnits): + """ + Create a new DTO representation of a MassFlow + + Parameters: + value (float): The value of the MassFlow. + unit (MassFlowUnits): The specific unit that the MassFlow value is representing. + """ self.value: float = value + """ + The value of the MassFlow + """ self.unit: MassFlowUnits = unit + """ + The specific unit that the MassFlow value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -275,10 +296,26 @@ def convert(self, unit: MassFlowUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MassFlowUnits = MassFlowUnits.GramPerSecond) -> MassFlowDto: + """ + Get a new instance of MassFlow DTO representing the current unit. + + :param hold_in_unit: The specific MassFlow unit to store the MassFlow value in the DTO representation. + :type hold_in_unit: MassFlowUnits + :return: A new instance of MassFlowDto. + :rtype: MassFlowDto + """ return MassFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(mass_flow_dto: MassFlowDto): + """ + Obtain a new instance of MassFlow from a DTO unit object. + + :param mass_flow_dto: The MassFlow DTO representation. + :type mass_flow_dto: MassFlowDto + :return: A new instance of MassFlow. + :rtype: MassFlow + """ return MassFlow(mass_flow_dto.value, mass_flow_dto.unit) def __convert_from_base(self, from_unit: MassFlowUnits) -> float: diff --git a/unitsnet_py/units/mass_flux.py b/unitsnet_py/units/mass_flux.py index 376ec9c..caea9c8 100644 --- a/unitsnet_py/units/mass_flux.py +++ b/unitsnet_py/units/mass_flux.py @@ -72,9 +72,30 @@ class MassFluxUnits(Enum): class MassFluxDto: + """ + A DTO representation of a MassFlux + + Attributes: + value (float): The value of the MassFlux. + unit (MassFluxUnits): The specific unit that the MassFlux value is representing. + """ + def __init__(self, value: float, unit: MassFluxUnits): + """ + Create a new DTO representation of a MassFlux + + Parameters: + value (float): The value of the MassFlux. + unit (MassFluxUnits): The specific unit that the MassFlux value is representing. + """ self.value: float = value + """ + The value of the MassFlux + """ self.unit: MassFluxUnits = unit + """ + The specific unit that the MassFlux value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -128,10 +149,26 @@ def convert(self, unit: MassFluxUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MassFluxUnits = MassFluxUnits.KilogramPerSecondPerSquareMeter) -> MassFluxDto: + """ + Get a new instance of MassFlux DTO representing the current unit. + + :param hold_in_unit: The specific MassFlux unit to store the MassFlux value in the DTO representation. + :type hold_in_unit: MassFluxUnits + :return: A new instance of MassFluxDto. + :rtype: MassFluxDto + """ return MassFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(mass_flux_dto: MassFluxDto): + """ + Obtain a new instance of MassFlux from a DTO unit object. + + :param mass_flux_dto: The MassFlux DTO representation. + :type mass_flux_dto: MassFluxDto + :return: A new instance of MassFlux. + :rtype: MassFlux + """ return MassFlux(mass_flux_dto.value, mass_flux_dto.unit) def __convert_from_base(self, from_unit: MassFluxUnits) -> float: diff --git a/unitsnet_py/units/mass_fraction.py b/unitsnet_py/units/mass_fraction.py index 094b71d..967468c 100644 --- a/unitsnet_py/units/mass_fraction.py +++ b/unitsnet_py/units/mass_fraction.py @@ -132,9 +132,30 @@ class MassFractionUnits(Enum): class MassFractionDto: + """ + A DTO representation of a MassFraction + + Attributes: + value (float): The value of the MassFraction. + unit (MassFractionUnits): The specific unit that the MassFraction value is representing. + """ + def __init__(self, value: float, unit: MassFractionUnits): + """ + Create a new DTO representation of a MassFraction + + Parameters: + value (float): The value of the MassFraction. + unit (MassFractionUnits): The specific unit that the MassFraction value is representing. + """ self.value: float = value + """ + The value of the MassFraction + """ self.unit: MassFractionUnits = unit + """ + The specific unit that the MassFraction value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -212,10 +233,26 @@ def convert(self, unit: MassFractionUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MassFractionUnits = MassFractionUnits.DecimalFraction) -> MassFractionDto: + """ + Get a new instance of MassFraction DTO representing the current unit. + + :param hold_in_unit: The specific MassFraction unit to store the MassFraction value in the DTO representation. + :type hold_in_unit: MassFractionUnits + :return: A new instance of MassFractionDto. + :rtype: MassFractionDto + """ return MassFractionDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(mass_fraction_dto: MassFractionDto): + """ + Obtain a new instance of MassFraction from a DTO unit object. + + :param mass_fraction_dto: The MassFraction DTO representation. + :type mass_fraction_dto: MassFractionDto + :return: A new instance of MassFraction. + :rtype: MassFraction + """ return MassFraction(mass_fraction_dto.value, mass_fraction_dto.unit) def __convert_from_base(self, from_unit: MassFractionUnits) -> float: diff --git a/unitsnet_py/units/mass_moment_of_inertia.py b/unitsnet_py/units/mass_moment_of_inertia.py index 44cda7d..1e7f646 100644 --- a/unitsnet_py/units/mass_moment_of_inertia.py +++ b/unitsnet_py/units/mass_moment_of_inertia.py @@ -152,9 +152,30 @@ class MassMomentOfInertiaUnits(Enum): class MassMomentOfInertiaDto: + """ + A DTO representation of a MassMomentOfInertia + + Attributes: + value (float): The value of the MassMomentOfInertia. + unit (MassMomentOfInertiaUnits): The specific unit that the MassMomentOfInertia value is representing. + """ + def __init__(self, value: float, unit: MassMomentOfInertiaUnits): + """ + Create a new DTO representation of a MassMomentOfInertia + + Parameters: + value (float): The value of the MassMomentOfInertia. + unit (MassMomentOfInertiaUnits): The specific unit that the MassMomentOfInertia value is representing. + """ self.value: float = value + """ + The value of the MassMomentOfInertia + """ self.unit: MassMomentOfInertiaUnits = unit + """ + The specific unit that the MassMomentOfInertia value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -240,10 +261,26 @@ def convert(self, unit: MassMomentOfInertiaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MassMomentOfInertiaUnits = MassMomentOfInertiaUnits.KilogramSquareMeter) -> MassMomentOfInertiaDto: + """ + Get a new instance of MassMomentOfInertia DTO representing the current unit. + + :param hold_in_unit: The specific MassMomentOfInertia unit to store the MassMomentOfInertia value in the DTO representation. + :type hold_in_unit: MassMomentOfInertiaUnits + :return: A new instance of MassMomentOfInertiaDto. + :rtype: MassMomentOfInertiaDto + """ return MassMomentOfInertiaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(mass_moment_of_inertia_dto: MassMomentOfInertiaDto): + """ + Obtain a new instance of MassMomentOfInertia from a DTO unit object. + + :param mass_moment_of_inertia_dto: The MassMomentOfInertia DTO representation. + :type mass_moment_of_inertia_dto: MassMomentOfInertiaDto + :return: A new instance of MassMomentOfInertia. + :rtype: MassMomentOfInertia + """ return MassMomentOfInertia(mass_moment_of_inertia_dto.value, mass_moment_of_inertia_dto.unit) def __convert_from_base(self, from_unit: MassMomentOfInertiaUnits) -> float: diff --git a/unitsnet_py/units/molality.py b/unitsnet_py/units/molality.py index b1adf1b..920d9ab 100644 --- a/unitsnet_py/units/molality.py +++ b/unitsnet_py/units/molality.py @@ -22,9 +22,30 @@ class MolalityUnits(Enum): class MolalityDto: + """ + A DTO representation of a Molality + + Attributes: + value (float): The value of the Molality. + unit (MolalityUnits): The specific unit that the Molality value is representing. + """ + def __init__(self, value: float, unit: MolalityUnits): + """ + Create a new DTO representation of a Molality + + Parameters: + value (float): The value of the Molality. + unit (MolalityUnits): The specific unit that the Molality value is representing. + """ self.value: float = value + """ + The value of the Molality + """ self.unit: MolalityUnits = unit + """ + The specific unit that the Molality value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -58,10 +79,26 @@ def convert(self, unit: MolalityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MolalityUnits = MolalityUnits.MolePerKilogram) -> MolalityDto: + """ + Get a new instance of Molality DTO representing the current unit. + + :param hold_in_unit: The specific Molality unit to store the Molality value in the DTO representation. + :type hold_in_unit: MolalityUnits + :return: A new instance of MolalityDto. + :rtype: MolalityDto + """ return MolalityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(molality_dto: MolalityDto): + """ + Obtain a new instance of Molality from a DTO unit object. + + :param molality_dto: The Molality DTO representation. + :type molality_dto: MolalityDto + :return: A new instance of Molality. + :rtype: Molality + """ return Molality(molality_dto.value, molality_dto.unit) def __convert_from_base(self, from_unit: MolalityUnits) -> float: diff --git a/unitsnet_py/units/molar_energy.py b/unitsnet_py/units/molar_energy.py index e8dcd7d..6229beb 100644 --- a/unitsnet_py/units/molar_energy.py +++ b/unitsnet_py/units/molar_energy.py @@ -27,9 +27,30 @@ class MolarEnergyUnits(Enum): class MolarEnergyDto: + """ + A DTO representation of a MolarEnergy + + Attributes: + value (float): The value of the MolarEnergy. + unit (MolarEnergyUnits): The specific unit that the MolarEnergy value is representing. + """ + def __init__(self, value: float, unit: MolarEnergyUnits): + """ + Create a new DTO representation of a MolarEnergy + + Parameters: + value (float): The value of the MolarEnergy. + unit (MolarEnergyUnits): The specific unit that the MolarEnergy value is representing. + """ self.value: float = value + """ + The value of the MolarEnergy + """ self.unit: MolarEnergyUnits = unit + """ + The specific unit that the MolarEnergy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: MolarEnergyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MolarEnergyUnits = MolarEnergyUnits.JoulePerMole) -> MolarEnergyDto: + """ + Get a new instance of MolarEnergy DTO representing the current unit. + + :param hold_in_unit: The specific MolarEnergy unit to store the MolarEnergy value in the DTO representation. + :type hold_in_unit: MolarEnergyUnits + :return: A new instance of MolarEnergyDto. + :rtype: MolarEnergyDto + """ return MolarEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(molar_energy_dto: MolarEnergyDto): + """ + Obtain a new instance of MolarEnergy from a DTO unit object. + + :param molar_energy_dto: The MolarEnergy DTO representation. + :type molar_energy_dto: MolarEnergyDto + :return: A new instance of MolarEnergy. + :rtype: MolarEnergy + """ return MolarEnergy(molar_energy_dto.value, molar_energy_dto.unit) def __convert_from_base(self, from_unit: MolarEnergyUnits) -> float: diff --git a/unitsnet_py/units/molar_entropy.py b/unitsnet_py/units/molar_entropy.py index 20b322e..a94a3e5 100644 --- a/unitsnet_py/units/molar_entropy.py +++ b/unitsnet_py/units/molar_entropy.py @@ -27,9 +27,30 @@ class MolarEntropyUnits(Enum): class MolarEntropyDto: + """ + A DTO representation of a MolarEntropy + + Attributes: + value (float): The value of the MolarEntropy. + unit (MolarEntropyUnits): The specific unit that the MolarEntropy value is representing. + """ + def __init__(self, value: float, unit: MolarEntropyUnits): + """ + Create a new DTO representation of a MolarEntropy + + Parameters: + value (float): The value of the MolarEntropy. + unit (MolarEntropyUnits): The specific unit that the MolarEntropy value is representing. + """ self.value: float = value + """ + The value of the MolarEntropy + """ self.unit: MolarEntropyUnits = unit + """ + The specific unit that the MolarEntropy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: MolarEntropyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MolarEntropyUnits = MolarEntropyUnits.JoulePerMoleKelvin) -> MolarEntropyDto: + """ + Get a new instance of MolarEntropy DTO representing the current unit. + + :param hold_in_unit: The specific MolarEntropy unit to store the MolarEntropy value in the DTO representation. + :type hold_in_unit: MolarEntropyUnits + :return: A new instance of MolarEntropyDto. + :rtype: MolarEntropyDto + """ return MolarEntropyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(molar_entropy_dto: MolarEntropyDto): + """ + Obtain a new instance of MolarEntropy from a DTO unit object. + + :param molar_entropy_dto: The MolarEntropy DTO representation. + :type molar_entropy_dto: MolarEntropyDto + :return: A new instance of MolarEntropy. + :rtype: MolarEntropy + """ return MolarEntropy(molar_entropy_dto.value, molar_entropy_dto.unit) def __convert_from_base(self, from_unit: MolarEntropyUnits) -> float: diff --git a/unitsnet_py/units/molar_flow.py b/unitsnet_py/units/molar_flow.py index 24942f1..9c62899 100644 --- a/unitsnet_py/units/molar_flow.py +++ b/unitsnet_py/units/molar_flow.py @@ -57,9 +57,30 @@ class MolarFlowUnits(Enum): class MolarFlowDto: + """ + A DTO representation of a MolarFlow + + Attributes: + value (float): The value of the MolarFlow. + unit (MolarFlowUnits): The specific unit that the MolarFlow value is representing. + """ + def __init__(self, value: float, unit: MolarFlowUnits): + """ + Create a new DTO representation of a MolarFlow + + Parameters: + value (float): The value of the MolarFlow. + unit (MolarFlowUnits): The specific unit that the MolarFlow value is representing. + """ self.value: float = value + """ + The value of the MolarFlow + """ self.unit: MolarFlowUnits = unit + """ + The specific unit that the MolarFlow value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: MolarFlowUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MolarFlowUnits = MolarFlowUnits.MolePerSecond) -> MolarFlowDto: + """ + Get a new instance of MolarFlow DTO representing the current unit. + + :param hold_in_unit: The specific MolarFlow unit to store the MolarFlow value in the DTO representation. + :type hold_in_unit: MolarFlowUnits + :return: A new instance of MolarFlowDto. + :rtype: MolarFlowDto + """ return MolarFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(molar_flow_dto: MolarFlowDto): + """ + Obtain a new instance of MolarFlow from a DTO unit object. + + :param molar_flow_dto: The MolarFlow DTO representation. + :type molar_flow_dto: MolarFlowDto + :return: A new instance of MolarFlow. + :rtype: MolarFlow + """ return MolarFlow(molar_flow_dto.value, molar_flow_dto.unit) def __convert_from_base(self, from_unit: MolarFlowUnits) -> float: diff --git a/unitsnet_py/units/molar_mass.py b/unitsnet_py/units/molar_mass.py index 5569d5a..67ef46f 100644 --- a/unitsnet_py/units/molar_mass.py +++ b/unitsnet_py/units/molar_mass.py @@ -77,9 +77,30 @@ class MolarMassUnits(Enum): class MolarMassDto: + """ + A DTO representation of a MolarMass + + Attributes: + value (float): The value of the MolarMass. + unit (MolarMassUnits): The specific unit that the MolarMass value is representing. + """ + def __init__(self, value: float, unit: MolarMassUnits): + """ + Create a new DTO representation of a MolarMass + + Parameters: + value (float): The value of the MolarMass. + unit (MolarMassUnits): The specific unit that the MolarMass value is representing. + """ self.value: float = value + """ + The value of the MolarMass + """ self.unit: MolarMassUnits = unit + """ + The specific unit that the MolarMass value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -135,10 +156,26 @@ def convert(self, unit: MolarMassUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MolarMassUnits = MolarMassUnits.KilogramPerMole) -> MolarMassDto: + """ + Get a new instance of MolarMass DTO representing the current unit. + + :param hold_in_unit: The specific MolarMass unit to store the MolarMass value in the DTO representation. + :type hold_in_unit: MolarMassUnits + :return: A new instance of MolarMassDto. + :rtype: MolarMassDto + """ return MolarMassDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(molar_mass_dto: MolarMassDto): + """ + Obtain a new instance of MolarMass from a DTO unit object. + + :param molar_mass_dto: The MolarMass DTO representation. + :type molar_mass_dto: MolarMassDto + :return: A new instance of MolarMass. + :rtype: MolarMass + """ return MolarMass(molar_mass_dto.value, molar_mass_dto.unit) def __convert_from_base(self, from_unit: MolarMassUnits) -> float: diff --git a/unitsnet_py/units/molarity.py b/unitsnet_py/units/molarity.py index d2d310b..04fd71a 100644 --- a/unitsnet_py/units/molarity.py +++ b/unitsnet_py/units/molarity.py @@ -67,9 +67,30 @@ class MolarityUnits(Enum): class MolarityDto: + """ + A DTO representation of a Molarity + + Attributes: + value (float): The value of the Molarity. + unit (MolarityUnits): The specific unit that the Molarity value is representing. + """ + def __init__(self, value: float, unit: MolarityUnits): + """ + Create a new DTO representation of a Molarity + + Parameters: + value (float): The value of the Molarity. + unit (MolarityUnits): The specific unit that the Molarity value is representing. + """ self.value: float = value + """ + The value of the Molarity + """ self.unit: MolarityUnits = unit + """ + The specific unit that the Molarity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -121,10 +142,26 @@ def convert(self, unit: MolarityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: MolarityUnits = MolarityUnits.MolePerCubicMeter) -> MolarityDto: + """ + Get a new instance of Molarity DTO representing the current unit. + + :param hold_in_unit: The specific Molarity unit to store the Molarity value in the DTO representation. + :type hold_in_unit: MolarityUnits + :return: A new instance of MolarityDto. + :rtype: MolarityDto + """ return MolarityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(molarity_dto: MolarityDto): + """ + Obtain a new instance of Molarity from a DTO unit object. + + :param molarity_dto: The Molarity DTO representation. + :type molarity_dto: MolarityDto + :return: A new instance of Molarity. + :rtype: Molarity + """ return Molarity(molarity_dto.value, molarity_dto.unit) def __convert_from_base(self, from_unit: MolarityUnits) -> float: diff --git a/unitsnet_py/units/permeability.py b/unitsnet_py/units/permeability.py index 18c8c9b..0318b8e 100644 --- a/unitsnet_py/units/permeability.py +++ b/unitsnet_py/units/permeability.py @@ -17,9 +17,30 @@ class PermeabilityUnits(Enum): class PermeabilityDto: + """ + A DTO representation of a Permeability + + Attributes: + value (float): The value of the Permeability. + unit (PermeabilityUnits): The specific unit that the Permeability value is representing. + """ + def __init__(self, value: float, unit: PermeabilityUnits): + """ + Create a new DTO representation of a Permeability + + Parameters: + value (float): The value of the Permeability. + unit (PermeabilityUnits): The specific unit that the Permeability value is representing. + """ self.value: float = value + """ + The value of the Permeability + """ self.unit: PermeabilityUnits = unit + """ + The specific unit that the Permeability value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: PermeabilityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PermeabilityUnits = PermeabilityUnits.HenryPerMeter) -> PermeabilityDto: + """ + Get a new instance of Permeability DTO representing the current unit. + + :param hold_in_unit: The specific Permeability unit to store the Permeability value in the DTO representation. + :type hold_in_unit: PermeabilityUnits + :return: A new instance of PermeabilityDto. + :rtype: PermeabilityDto + """ return PermeabilityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(permeability_dto: PermeabilityDto): + """ + Obtain a new instance of Permeability from a DTO unit object. + + :param permeability_dto: The Permeability DTO representation. + :type permeability_dto: PermeabilityDto + :return: A new instance of Permeability. + :rtype: Permeability + """ return Permeability(permeability_dto.value, permeability_dto.unit) def __convert_from_base(self, from_unit: PermeabilityUnits) -> float: diff --git a/unitsnet_py/units/permittivity.py b/unitsnet_py/units/permittivity.py index 0f28f22..56a76fa 100644 --- a/unitsnet_py/units/permittivity.py +++ b/unitsnet_py/units/permittivity.py @@ -17,9 +17,30 @@ class PermittivityUnits(Enum): class PermittivityDto: + """ + A DTO representation of a Permittivity + + Attributes: + value (float): The value of the Permittivity. + unit (PermittivityUnits): The specific unit that the Permittivity value is representing. + """ + def __init__(self, value: float, unit: PermittivityUnits): + """ + Create a new DTO representation of a Permittivity + + Parameters: + value (float): The value of the Permittivity. + unit (PermittivityUnits): The specific unit that the Permittivity value is representing. + """ self.value: float = value + """ + The value of the Permittivity + """ self.unit: PermittivityUnits = unit + """ + The specific unit that the Permittivity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: PermittivityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PermittivityUnits = PermittivityUnits.FaradPerMeter) -> PermittivityDto: + """ + Get a new instance of Permittivity DTO representing the current unit. + + :param hold_in_unit: The specific Permittivity unit to store the Permittivity value in the DTO representation. + :type hold_in_unit: PermittivityUnits + :return: A new instance of PermittivityDto. + :rtype: PermittivityDto + """ return PermittivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(permittivity_dto: PermittivityDto): + """ + Obtain a new instance of Permittivity from a DTO unit object. + + :param permittivity_dto: The Permittivity DTO representation. + :type permittivity_dto: PermittivityDto + :return: A new instance of Permittivity. + :rtype: Permittivity + """ return Permittivity(permittivity_dto.value, permittivity_dto.unit) def __convert_from_base(self, from_unit: PermittivityUnits) -> float: diff --git a/unitsnet_py/units/porous_medium_permeability.py b/unitsnet_py/units/porous_medium_permeability.py index 9c9b416..bca0001 100644 --- a/unitsnet_py/units/porous_medium_permeability.py +++ b/unitsnet_py/units/porous_medium_permeability.py @@ -37,9 +37,30 @@ class PorousMediumPermeabilityUnits(Enum): class PorousMediumPermeabilityDto: + """ + A DTO representation of a PorousMediumPermeability + + Attributes: + value (float): The value of the PorousMediumPermeability. + unit (PorousMediumPermeabilityUnits): The specific unit that the PorousMediumPermeability value is representing. + """ + def __init__(self, value: float, unit: PorousMediumPermeabilityUnits): + """ + Create a new DTO representation of a PorousMediumPermeability + + Parameters: + value (float): The value of the PorousMediumPermeability. + unit (PorousMediumPermeabilityUnits): The specific unit that the PorousMediumPermeability value is representing. + """ self.value: float = value + """ + The value of the PorousMediumPermeability + """ self.unit: PorousMediumPermeabilityUnits = unit + """ + The specific unit that the PorousMediumPermeability value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: PorousMediumPermeabilityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PorousMediumPermeabilityUnits = PorousMediumPermeabilityUnits.SquareMeter) -> PorousMediumPermeabilityDto: + """ + Get a new instance of PorousMediumPermeability DTO representing the current unit. + + :param hold_in_unit: The specific PorousMediumPermeability unit to store the PorousMediumPermeability value in the DTO representation. + :type hold_in_unit: PorousMediumPermeabilityUnits + :return: A new instance of PorousMediumPermeabilityDto. + :rtype: PorousMediumPermeabilityDto + """ return PorousMediumPermeabilityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(porous_medium_permeability_dto: PorousMediumPermeabilityDto): + """ + Obtain a new instance of PorousMediumPermeability from a DTO unit object. + + :param porous_medium_permeability_dto: The PorousMediumPermeability DTO representation. + :type porous_medium_permeability_dto: PorousMediumPermeabilityDto + :return: A new instance of PorousMediumPermeability. + :rtype: PorousMediumPermeability + """ return PorousMediumPermeability(porous_medium_permeability_dto.value, porous_medium_permeability_dto.unit) def __convert_from_base(self, from_unit: PorousMediumPermeabilityUnits) -> float: diff --git a/unitsnet_py/units/power.py b/unitsnet_py/units/power.py index bcefc18..51af642 100644 --- a/unitsnet_py/units/power.py +++ b/unitsnet_py/units/power.py @@ -142,9 +142,30 @@ class PowerUnits(Enum): class PowerDto: + """ + A DTO representation of a Power + + Attributes: + value (float): The value of the Power. + unit (PowerUnits): The specific unit that the Power value is representing. + """ + def __init__(self, value: float, unit: PowerUnits): + """ + Create a new DTO representation of a Power + + Parameters: + value (float): The value of the Power. + unit (PowerUnits): The specific unit that the Power value is representing. + """ self.value: float = value + """ + The value of the Power + """ self.unit: PowerUnits = unit + """ + The specific unit that the Power value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -226,10 +247,26 @@ def convert(self, unit: PowerUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PowerUnits = PowerUnits.Watt) -> PowerDto: + """ + Get a new instance of Power DTO representing the current unit. + + :param hold_in_unit: The specific Power unit to store the Power value in the DTO representation. + :type hold_in_unit: PowerUnits + :return: A new instance of PowerDto. + :rtype: PowerDto + """ return PowerDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(power_dto: PowerDto): + """ + Obtain a new instance of Power from a DTO unit object. + + :param power_dto: The Power DTO representation. + :type power_dto: PowerDto + :return: A new instance of Power. + :rtype: Power + """ return Power(power_dto.value, power_dto.unit) def __convert_from_base(self, from_unit: PowerUnits) -> float: diff --git a/unitsnet_py/units/power_density.py b/unitsnet_py/units/power_density.py index 098abbe..5823f3b 100644 --- a/unitsnet_py/units/power_density.py +++ b/unitsnet_py/units/power_density.py @@ -232,9 +232,30 @@ class PowerDensityUnits(Enum): class PowerDensityDto: + """ + A DTO representation of a PowerDensity + + Attributes: + value (float): The value of the PowerDensity. + unit (PowerDensityUnits): The specific unit that the PowerDensity value is representing. + """ + def __init__(self, value: float, unit: PowerDensityUnits): + """ + Create a new DTO representation of a PowerDensity + + Parameters: + value (float): The value of the PowerDensity. + unit (PowerDensityUnits): The specific unit that the PowerDensity value is representing. + """ self.value: float = value + """ + The value of the PowerDensity + """ self.unit: PowerDensityUnits = unit + """ + The specific unit that the PowerDensity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -352,10 +373,26 @@ def convert(self, unit: PowerDensityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PowerDensityUnits = PowerDensityUnits.WattPerCubicMeter) -> PowerDensityDto: + """ + Get a new instance of PowerDensity DTO representing the current unit. + + :param hold_in_unit: The specific PowerDensity unit to store the PowerDensity value in the DTO representation. + :type hold_in_unit: PowerDensityUnits + :return: A new instance of PowerDensityDto. + :rtype: PowerDensityDto + """ return PowerDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(power_density_dto: PowerDensityDto): + """ + Obtain a new instance of PowerDensity from a DTO unit object. + + :param power_density_dto: The PowerDensity DTO representation. + :type power_density_dto: PowerDensityDto + :return: A new instance of PowerDensity. + :rtype: PowerDensity + """ return PowerDensity(power_density_dto.value, power_density_dto.unit) def __convert_from_base(self, from_unit: PowerDensityUnits) -> float: diff --git a/unitsnet_py/units/power_ratio.py b/unitsnet_py/units/power_ratio.py index d14e4e2..fe3c4d8 100644 --- a/unitsnet_py/units/power_ratio.py +++ b/unitsnet_py/units/power_ratio.py @@ -22,9 +22,30 @@ class PowerRatioUnits(Enum): class PowerRatioDto: + """ + A DTO representation of a PowerRatio + + Attributes: + value (float): The value of the PowerRatio. + unit (PowerRatioUnits): The specific unit that the PowerRatio value is representing. + """ + def __init__(self, value: float, unit: PowerRatioUnits): + """ + Create a new DTO representation of a PowerRatio + + Parameters: + value (float): The value of the PowerRatio. + unit (PowerRatioUnits): The specific unit that the PowerRatio value is representing. + """ self.value: float = value + """ + The value of the PowerRatio + """ self.unit: PowerRatioUnits = unit + """ + The specific unit that the PowerRatio value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -58,10 +79,26 @@ def convert(self, unit: PowerRatioUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PowerRatioUnits = PowerRatioUnits.DecibelWatt) -> PowerRatioDto: + """ + Get a new instance of PowerRatio DTO representing the current unit. + + :param hold_in_unit: The specific PowerRatio unit to store the PowerRatio value in the DTO representation. + :type hold_in_unit: PowerRatioUnits + :return: A new instance of PowerRatioDto. + :rtype: PowerRatioDto + """ return PowerRatioDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(power_ratio_dto: PowerRatioDto): + """ + Obtain a new instance of PowerRatio from a DTO unit object. + + :param power_ratio_dto: The PowerRatio DTO representation. + :type power_ratio_dto: PowerRatioDto + :return: A new instance of PowerRatio. + :rtype: PowerRatio + """ return PowerRatio(power_ratio_dto.value, power_ratio_dto.unit) def __convert_from_base(self, from_unit: PowerRatioUnits) -> float: diff --git a/unitsnet_py/units/pressure.py b/unitsnet_py/units/pressure.py index 97379e2..da8df0f 100644 --- a/unitsnet_py/units/pressure.py +++ b/unitsnet_py/units/pressure.py @@ -257,9 +257,30 @@ class PressureUnits(Enum): class PressureDto: + """ + A DTO representation of a Pressure + + Attributes: + value (float): The value of the Pressure. + unit (PressureUnits): The specific unit that the Pressure value is representing. + """ + def __init__(self, value: float, unit: PressureUnits): + """ + Create a new DTO representation of a Pressure + + Parameters: + value (float): The value of the Pressure. + unit (PressureUnits): The specific unit that the Pressure value is representing. + """ self.value: float = value + """ + The value of the Pressure + """ self.unit: PressureUnits = unit + """ + The specific unit that the Pressure value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -387,10 +408,26 @@ def convert(self, unit: PressureUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PressureUnits = PressureUnits.Pascal) -> PressureDto: + """ + Get a new instance of Pressure DTO representing the current unit. + + :param hold_in_unit: The specific Pressure unit to store the Pressure value in the DTO representation. + :type hold_in_unit: PressureUnits + :return: A new instance of PressureDto. + :rtype: PressureDto + """ return PressureDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(pressure_dto: PressureDto): + """ + Obtain a new instance of Pressure from a DTO unit object. + + :param pressure_dto: The Pressure DTO representation. + :type pressure_dto: PressureDto + :return: A new instance of Pressure. + :rtype: Pressure + """ return Pressure(pressure_dto.value, pressure_dto.unit) def __convert_from_base(self, from_unit: PressureUnits) -> float: diff --git a/unitsnet_py/units/pressure_change_rate.py b/unitsnet_py/units/pressure_change_rate.py index 3e044de..7b137b9 100644 --- a/unitsnet_py/units/pressure_change_rate.py +++ b/unitsnet_py/units/pressure_change_rate.py @@ -102,9 +102,30 @@ class PressureChangeRateUnits(Enum): class PressureChangeRateDto: + """ + A DTO representation of a PressureChangeRate + + Attributes: + value (float): The value of the PressureChangeRate. + unit (PressureChangeRateUnits): The specific unit that the PressureChangeRate value is representing. + """ + def __init__(self, value: float, unit: PressureChangeRateUnits): + """ + Create a new DTO representation of a PressureChangeRate + + Parameters: + value (float): The value of the PressureChangeRate. + unit (PressureChangeRateUnits): The specific unit that the PressureChangeRate value is representing. + """ self.value: float = value + """ + The value of the PressureChangeRate + """ self.unit: PressureChangeRateUnits = unit + """ + The specific unit that the PressureChangeRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -170,10 +191,26 @@ def convert(self, unit: PressureChangeRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: PressureChangeRateUnits = PressureChangeRateUnits.PascalPerSecond) -> PressureChangeRateDto: + """ + Get a new instance of PressureChangeRate DTO representing the current unit. + + :param hold_in_unit: The specific PressureChangeRate unit to store the PressureChangeRate value in the DTO representation. + :type hold_in_unit: PressureChangeRateUnits + :return: A new instance of PressureChangeRateDto. + :rtype: PressureChangeRateDto + """ return PressureChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(pressure_change_rate_dto: PressureChangeRateDto): + """ + Obtain a new instance of PressureChangeRate from a DTO unit object. + + :param pressure_change_rate_dto: The PressureChangeRate DTO representation. + :type pressure_change_rate_dto: PressureChangeRateDto + :return: A new instance of PressureChangeRate. + :rtype: PressureChangeRate + """ return PressureChangeRate(pressure_change_rate_dto.value, pressure_change_rate_dto.unit) def __convert_from_base(self, from_unit: PressureChangeRateUnits) -> float: diff --git a/unitsnet_py/units/radiation_equivalent_dose.py b/unitsnet_py/units/radiation_equivalent_dose.py index 6749583..ecb39ef 100644 --- a/unitsnet_py/units/radiation_equivalent_dose.py +++ b/unitsnet_py/units/radiation_equivalent_dose.py @@ -42,9 +42,30 @@ class RadiationEquivalentDoseUnits(Enum): class RadiationEquivalentDoseDto: + """ + A DTO representation of a RadiationEquivalentDose + + Attributes: + value (float): The value of the RadiationEquivalentDose. + unit (RadiationEquivalentDoseUnits): The specific unit that the RadiationEquivalentDose value is representing. + """ + def __init__(self, value: float, unit: RadiationEquivalentDoseUnits): + """ + Create a new DTO representation of a RadiationEquivalentDose + + Parameters: + value (float): The value of the RadiationEquivalentDose. + unit (RadiationEquivalentDoseUnits): The specific unit that the RadiationEquivalentDose value is representing. + """ self.value: float = value + """ + The value of the RadiationEquivalentDose + """ self.unit: RadiationEquivalentDoseUnits = unit + """ + The specific unit that the RadiationEquivalentDose value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: RadiationEquivalentDoseUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RadiationEquivalentDoseUnits = RadiationEquivalentDoseUnits.Sievert) -> RadiationEquivalentDoseDto: + """ + Get a new instance of RadiationEquivalentDose DTO representing the current unit. + + :param hold_in_unit: The specific RadiationEquivalentDose unit to store the RadiationEquivalentDose value in the DTO representation. + :type hold_in_unit: RadiationEquivalentDoseUnits + :return: A new instance of RadiationEquivalentDoseDto. + :rtype: RadiationEquivalentDoseDto + """ return RadiationEquivalentDoseDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(radiation_equivalent_dose_dto: RadiationEquivalentDoseDto): + """ + Obtain a new instance of RadiationEquivalentDose from a DTO unit object. + + :param radiation_equivalent_dose_dto: The RadiationEquivalentDose DTO representation. + :type radiation_equivalent_dose_dto: RadiationEquivalentDoseDto + :return: A new instance of RadiationEquivalentDose. + :rtype: RadiationEquivalentDose + """ return RadiationEquivalentDose(radiation_equivalent_dose_dto.value, radiation_equivalent_dose_dto.unit) def __convert_from_base(self, from_unit: RadiationEquivalentDoseUnits) -> float: diff --git a/unitsnet_py/units/radiation_exposure.py b/unitsnet_py/units/radiation_exposure.py index c5d56f1..987ff05 100644 --- a/unitsnet_py/units/radiation_exposure.py +++ b/unitsnet_py/units/radiation_exposure.py @@ -52,9 +52,30 @@ class RadiationExposureUnits(Enum): class RadiationExposureDto: + """ + A DTO representation of a RadiationExposure + + Attributes: + value (float): The value of the RadiationExposure. + unit (RadiationExposureUnits): The specific unit that the RadiationExposure value is representing. + """ + def __init__(self, value: float, unit: RadiationExposureUnits): + """ + Create a new DTO representation of a RadiationExposure + + Parameters: + value (float): The value of the RadiationExposure. + unit (RadiationExposureUnits): The specific unit that the RadiationExposure value is representing. + """ self.value: float = value + """ + The value of the RadiationExposure + """ self.unit: RadiationExposureUnits = unit + """ + The specific unit that the RadiationExposure value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -100,10 +121,26 @@ def convert(self, unit: RadiationExposureUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RadiationExposureUnits = RadiationExposureUnits.CoulombPerKilogram) -> RadiationExposureDto: + """ + Get a new instance of RadiationExposure DTO representing the current unit. + + :param hold_in_unit: The specific RadiationExposure unit to store the RadiationExposure value in the DTO representation. + :type hold_in_unit: RadiationExposureUnits + :return: A new instance of RadiationExposureDto. + :rtype: RadiationExposureDto + """ return RadiationExposureDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(radiation_exposure_dto: RadiationExposureDto): + """ + Obtain a new instance of RadiationExposure from a DTO unit object. + + :param radiation_exposure_dto: The RadiationExposure DTO representation. + :type radiation_exposure_dto: RadiationExposureDto + :return: A new instance of RadiationExposure. + :rtype: RadiationExposure + """ return RadiationExposure(radiation_exposure_dto.value, radiation_exposure_dto.unit) def __convert_from_base(self, from_unit: RadiationExposureUnits) -> float: diff --git a/unitsnet_py/units/radioactivity.py b/unitsnet_py/units/radioactivity.py index 8ddd4df..145d850 100644 --- a/unitsnet_py/units/radioactivity.py +++ b/unitsnet_py/units/radioactivity.py @@ -157,9 +157,30 @@ class RadioactivityUnits(Enum): class RadioactivityDto: + """ + A DTO representation of a Radioactivity + + Attributes: + value (float): The value of the Radioactivity. + unit (RadioactivityUnits): The specific unit that the Radioactivity value is representing. + """ + def __init__(self, value: float, unit: RadioactivityUnits): + """ + Create a new DTO representation of a Radioactivity + + Parameters: + value (float): The value of the Radioactivity. + unit (RadioactivityUnits): The specific unit that the Radioactivity value is representing. + """ self.value: float = value + """ + The value of the Radioactivity + """ self.unit: RadioactivityUnits = unit + """ + The specific unit that the Radioactivity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -247,10 +268,26 @@ def convert(self, unit: RadioactivityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RadioactivityUnits = RadioactivityUnits.Becquerel) -> RadioactivityDto: + """ + Get a new instance of Radioactivity DTO representing the current unit. + + :param hold_in_unit: The specific Radioactivity unit to store the Radioactivity value in the DTO representation. + :type hold_in_unit: RadioactivityUnits + :return: A new instance of RadioactivityDto. + :rtype: RadioactivityDto + """ return RadioactivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(radioactivity_dto: RadioactivityDto): + """ + Obtain a new instance of Radioactivity from a DTO unit object. + + :param radioactivity_dto: The Radioactivity DTO representation. + :type radioactivity_dto: RadioactivityDto + :return: A new instance of Radioactivity. + :rtype: Radioactivity + """ return Radioactivity(radioactivity_dto.value, radioactivity_dto.unit) def __convert_from_base(self, from_unit: RadioactivityUnits) -> float: diff --git a/unitsnet_py/units/ratio.py b/unitsnet_py/units/ratio.py index 949fb46..ecbb3ab 100644 --- a/unitsnet_py/units/ratio.py +++ b/unitsnet_py/units/ratio.py @@ -42,9 +42,30 @@ class RatioUnits(Enum): class RatioDto: + """ + A DTO representation of a Ratio + + Attributes: + value (float): The value of the Ratio. + unit (RatioUnits): The specific unit that the Ratio value is representing. + """ + def __init__(self, value: float, unit: RatioUnits): + """ + Create a new DTO representation of a Ratio + + Parameters: + value (float): The value of the Ratio. + unit (RatioUnits): The specific unit that the Ratio value is representing. + """ self.value: float = value + """ + The value of the Ratio + """ self.unit: RatioUnits = unit + """ + The specific unit that the Ratio value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: RatioUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RatioUnits = RatioUnits.DecimalFraction) -> RatioDto: + """ + Get a new instance of Ratio DTO representing the current unit. + + :param hold_in_unit: The specific Ratio unit to store the Ratio value in the DTO representation. + :type hold_in_unit: RatioUnits + :return: A new instance of RatioDto. + :rtype: RatioDto + """ return RatioDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(ratio_dto: RatioDto): + """ + Obtain a new instance of Ratio from a DTO unit object. + + :param ratio_dto: The Ratio DTO representation. + :type ratio_dto: RatioDto + :return: A new instance of Ratio. + :rtype: Ratio + """ return Ratio(ratio_dto.value, ratio_dto.unit) def __convert_from_base(self, from_unit: RatioUnits) -> float: diff --git a/unitsnet_py/units/ratio_change_rate.py b/unitsnet_py/units/ratio_change_rate.py index 5fd19b1..a98dfbf 100644 --- a/unitsnet_py/units/ratio_change_rate.py +++ b/unitsnet_py/units/ratio_change_rate.py @@ -22,9 +22,30 @@ class RatioChangeRateUnits(Enum): class RatioChangeRateDto: + """ + A DTO representation of a RatioChangeRate + + Attributes: + value (float): The value of the RatioChangeRate. + unit (RatioChangeRateUnits): The specific unit that the RatioChangeRate value is representing. + """ + def __init__(self, value: float, unit: RatioChangeRateUnits): + """ + Create a new DTO representation of a RatioChangeRate + + Parameters: + value (float): The value of the RatioChangeRate. + unit (RatioChangeRateUnits): The specific unit that the RatioChangeRate value is representing. + """ self.value: float = value + """ + The value of the RatioChangeRate + """ self.unit: RatioChangeRateUnits = unit + """ + The specific unit that the RatioChangeRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -58,10 +79,26 @@ def convert(self, unit: RatioChangeRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RatioChangeRateUnits = RatioChangeRateUnits.DecimalFractionPerSecond) -> RatioChangeRateDto: + """ + Get a new instance of RatioChangeRate DTO representing the current unit. + + :param hold_in_unit: The specific RatioChangeRate unit to store the RatioChangeRate value in the DTO representation. + :type hold_in_unit: RatioChangeRateUnits + :return: A new instance of RatioChangeRateDto. + :rtype: RatioChangeRateDto + """ return RatioChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(ratio_change_rate_dto: RatioChangeRateDto): + """ + Obtain a new instance of RatioChangeRate from a DTO unit object. + + :param ratio_change_rate_dto: The RatioChangeRate DTO representation. + :type ratio_change_rate_dto: RatioChangeRateDto + :return: A new instance of RatioChangeRate. + :rtype: RatioChangeRate + """ return RatioChangeRate(ratio_change_rate_dto.value, ratio_change_rate_dto.unit) def __convert_from_base(self, from_unit: RatioChangeRateUnits) -> float: diff --git a/unitsnet_py/units/reactive_energy.py b/unitsnet_py/units/reactive_energy.py index 72ed2db..a212224 100644 --- a/unitsnet_py/units/reactive_energy.py +++ b/unitsnet_py/units/reactive_energy.py @@ -27,9 +27,30 @@ class ReactiveEnergyUnits(Enum): class ReactiveEnergyDto: + """ + A DTO representation of a ReactiveEnergy + + Attributes: + value (float): The value of the ReactiveEnergy. + unit (ReactiveEnergyUnits): The specific unit that the ReactiveEnergy value is representing. + """ + def __init__(self, value: float, unit: ReactiveEnergyUnits): + """ + Create a new DTO representation of a ReactiveEnergy + + Parameters: + value (float): The value of the ReactiveEnergy. + unit (ReactiveEnergyUnits): The specific unit that the ReactiveEnergy value is representing. + """ self.value: float = value + """ + The value of the ReactiveEnergy + """ self.unit: ReactiveEnergyUnits = unit + """ + The specific unit that the ReactiveEnergy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: ReactiveEnergyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ReactiveEnergyUnits = ReactiveEnergyUnits.VoltampereReactiveHour) -> ReactiveEnergyDto: + """ + Get a new instance of ReactiveEnergy DTO representing the current unit. + + :param hold_in_unit: The specific ReactiveEnergy unit to store the ReactiveEnergy value in the DTO representation. + :type hold_in_unit: ReactiveEnergyUnits + :return: A new instance of ReactiveEnergyDto. + :rtype: ReactiveEnergyDto + """ return ReactiveEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(reactive_energy_dto: ReactiveEnergyDto): + """ + Obtain a new instance of ReactiveEnergy from a DTO unit object. + + :param reactive_energy_dto: The ReactiveEnergy DTO representation. + :type reactive_energy_dto: ReactiveEnergyDto + :return: A new instance of ReactiveEnergy. + :rtype: ReactiveEnergy + """ return ReactiveEnergy(reactive_energy_dto.value, reactive_energy_dto.unit) def __convert_from_base(self, from_unit: ReactiveEnergyUnits) -> float: diff --git a/unitsnet_py/units/reactive_power.py b/unitsnet_py/units/reactive_power.py index 9270054..7f9d383 100644 --- a/unitsnet_py/units/reactive_power.py +++ b/unitsnet_py/units/reactive_power.py @@ -32,9 +32,30 @@ class ReactivePowerUnits(Enum): class ReactivePowerDto: + """ + A DTO representation of a ReactivePower + + Attributes: + value (float): The value of the ReactivePower. + unit (ReactivePowerUnits): The specific unit that the ReactivePower value is representing. + """ + def __init__(self, value: float, unit: ReactivePowerUnits): + """ + Create a new DTO representation of a ReactivePower + + Parameters: + value (float): The value of the ReactivePower. + unit (ReactivePowerUnits): The specific unit that the ReactivePower value is representing. + """ self.value: float = value + """ + The value of the ReactivePower + """ self.unit: ReactivePowerUnits = unit + """ + The specific unit that the ReactivePower value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: ReactivePowerUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ReactivePowerUnits = ReactivePowerUnits.VoltampereReactive) -> ReactivePowerDto: + """ + Get a new instance of ReactivePower DTO representing the current unit. + + :param hold_in_unit: The specific ReactivePower unit to store the ReactivePower value in the DTO representation. + :type hold_in_unit: ReactivePowerUnits + :return: A new instance of ReactivePowerDto. + :rtype: ReactivePowerDto + """ return ReactivePowerDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(reactive_power_dto: ReactivePowerDto): + """ + Obtain a new instance of ReactivePower from a DTO unit object. + + :param reactive_power_dto: The ReactivePower DTO representation. + :type reactive_power_dto: ReactivePowerDto + :return: A new instance of ReactivePower. + :rtype: ReactivePower + """ return ReactivePower(reactive_power_dto.value, reactive_power_dto.unit) def __convert_from_base(self, from_unit: ReactivePowerUnits) -> float: diff --git a/unitsnet_py/units/reciprocal_area.py b/unitsnet_py/units/reciprocal_area.py index fed3c35..cda5389 100644 --- a/unitsnet_py/units/reciprocal_area.py +++ b/unitsnet_py/units/reciprocal_area.py @@ -67,9 +67,30 @@ class ReciprocalAreaUnits(Enum): class ReciprocalAreaDto: + """ + A DTO representation of a ReciprocalArea + + Attributes: + value (float): The value of the ReciprocalArea. + unit (ReciprocalAreaUnits): The specific unit that the ReciprocalArea value is representing. + """ + def __init__(self, value: float, unit: ReciprocalAreaUnits): + """ + Create a new DTO representation of a ReciprocalArea + + Parameters: + value (float): The value of the ReciprocalArea. + unit (ReciprocalAreaUnits): The specific unit that the ReciprocalArea value is representing. + """ self.value: float = value + """ + The value of the ReciprocalArea + """ self.unit: ReciprocalAreaUnits = unit + """ + The specific unit that the ReciprocalArea value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -121,10 +142,26 @@ def convert(self, unit: ReciprocalAreaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ReciprocalAreaUnits = ReciprocalAreaUnits.InverseSquareMeter) -> ReciprocalAreaDto: + """ + Get a new instance of ReciprocalArea DTO representing the current unit. + + :param hold_in_unit: The specific ReciprocalArea unit to store the ReciprocalArea value in the DTO representation. + :type hold_in_unit: ReciprocalAreaUnits + :return: A new instance of ReciprocalAreaDto. + :rtype: ReciprocalAreaDto + """ return ReciprocalAreaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(reciprocal_area_dto: ReciprocalAreaDto): + """ + Obtain a new instance of ReciprocalArea from a DTO unit object. + + :param reciprocal_area_dto: The ReciprocalArea DTO representation. + :type reciprocal_area_dto: ReciprocalAreaDto + :return: A new instance of ReciprocalArea. + :rtype: ReciprocalArea + """ return ReciprocalArea(reciprocal_area_dto.value, reciprocal_area_dto.unit) def __convert_from_base(self, from_unit: ReciprocalAreaUnits) -> float: diff --git a/unitsnet_py/units/reciprocal_length.py b/unitsnet_py/units/reciprocal_length.py index d366e97..c922eb1 100644 --- a/unitsnet_py/units/reciprocal_length.py +++ b/unitsnet_py/units/reciprocal_length.py @@ -62,9 +62,30 @@ class ReciprocalLengthUnits(Enum): class ReciprocalLengthDto: + """ + A DTO representation of a ReciprocalLength + + Attributes: + value (float): The value of the ReciprocalLength. + unit (ReciprocalLengthUnits): The specific unit that the ReciprocalLength value is representing. + """ + def __init__(self, value: float, unit: ReciprocalLengthUnits): + """ + Create a new DTO representation of a ReciprocalLength + + Parameters: + value (float): The value of the ReciprocalLength. + unit (ReciprocalLengthUnits): The specific unit that the ReciprocalLength value is representing. + """ self.value: float = value + """ + The value of the ReciprocalLength + """ self.unit: ReciprocalLengthUnits = unit + """ + The specific unit that the ReciprocalLength value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -114,10 +135,26 @@ def convert(self, unit: ReciprocalLengthUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ReciprocalLengthUnits = ReciprocalLengthUnits.InverseMeter) -> ReciprocalLengthDto: + """ + Get a new instance of ReciprocalLength DTO representing the current unit. + + :param hold_in_unit: The specific ReciprocalLength unit to store the ReciprocalLength value in the DTO representation. + :type hold_in_unit: ReciprocalLengthUnits + :return: A new instance of ReciprocalLengthDto. + :rtype: ReciprocalLengthDto + """ return ReciprocalLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(reciprocal_length_dto: ReciprocalLengthDto): + """ + Obtain a new instance of ReciprocalLength from a DTO unit object. + + :param reciprocal_length_dto: The ReciprocalLength DTO representation. + :type reciprocal_length_dto: ReciprocalLengthDto + :return: A new instance of ReciprocalLength. + :rtype: ReciprocalLength + """ return ReciprocalLength(reciprocal_length_dto.value, reciprocal_length_dto.unit) def __convert_from_base(self, from_unit: ReciprocalLengthUnits) -> float: diff --git a/unitsnet_py/units/relative_humidity.py b/unitsnet_py/units/relative_humidity.py index 994a5ba..55d47bb 100644 --- a/unitsnet_py/units/relative_humidity.py +++ b/unitsnet_py/units/relative_humidity.py @@ -17,9 +17,30 @@ class RelativeHumidityUnits(Enum): class RelativeHumidityDto: + """ + A DTO representation of a RelativeHumidity + + Attributes: + value (float): The value of the RelativeHumidity. + unit (RelativeHumidityUnits): The specific unit that the RelativeHumidity value is representing. + """ + def __init__(self, value: float, unit: RelativeHumidityUnits): + """ + Create a new DTO representation of a RelativeHumidity + + Parameters: + value (float): The value of the RelativeHumidity. + unit (RelativeHumidityUnits): The specific unit that the RelativeHumidity value is representing. + """ self.value: float = value + """ + The value of the RelativeHumidity + """ self.unit: RelativeHumidityUnits = unit + """ + The specific unit that the RelativeHumidity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: RelativeHumidityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RelativeHumidityUnits = RelativeHumidityUnits.Percent) -> RelativeHumidityDto: + """ + Get a new instance of RelativeHumidity DTO representing the current unit. + + :param hold_in_unit: The specific RelativeHumidity unit to store the RelativeHumidity value in the DTO representation. + :type hold_in_unit: RelativeHumidityUnits + :return: A new instance of RelativeHumidityDto. + :rtype: RelativeHumidityDto + """ return RelativeHumidityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(relative_humidity_dto: RelativeHumidityDto): + """ + Obtain a new instance of RelativeHumidity from a DTO unit object. + + :param relative_humidity_dto: The RelativeHumidity DTO representation. + :type relative_humidity_dto: RelativeHumidityDto + :return: A new instance of RelativeHumidity. + :rtype: RelativeHumidity + """ return RelativeHumidity(relative_humidity_dto.value, relative_humidity_dto.unit) def __convert_from_base(self, from_unit: RelativeHumidityUnits) -> float: diff --git a/unitsnet_py/units/rotational_acceleration.py b/unitsnet_py/units/rotational_acceleration.py index c52e7ff..c8be582 100644 --- a/unitsnet_py/units/rotational_acceleration.py +++ b/unitsnet_py/units/rotational_acceleration.py @@ -32,9 +32,30 @@ class RotationalAccelerationUnits(Enum): class RotationalAccelerationDto: + """ + A DTO representation of a RotationalAcceleration + + Attributes: + value (float): The value of the RotationalAcceleration. + unit (RotationalAccelerationUnits): The specific unit that the RotationalAcceleration value is representing. + """ + def __init__(self, value: float, unit: RotationalAccelerationUnits): + """ + Create a new DTO representation of a RotationalAcceleration + + Parameters: + value (float): The value of the RotationalAcceleration. + unit (RotationalAccelerationUnits): The specific unit that the RotationalAcceleration value is representing. + """ self.value: float = value + """ + The value of the RotationalAcceleration + """ self.unit: RotationalAccelerationUnits = unit + """ + The specific unit that the RotationalAcceleration value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: RotationalAccelerationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RotationalAccelerationUnits = RotationalAccelerationUnits.RadianPerSecondSquared) -> RotationalAccelerationDto: + """ + Get a new instance of RotationalAcceleration DTO representing the current unit. + + :param hold_in_unit: The specific RotationalAcceleration unit to store the RotationalAcceleration value in the DTO representation. + :type hold_in_unit: RotationalAccelerationUnits + :return: A new instance of RotationalAccelerationDto. + :rtype: RotationalAccelerationDto + """ return RotationalAccelerationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(rotational_acceleration_dto: RotationalAccelerationDto): + """ + Obtain a new instance of RotationalAcceleration from a DTO unit object. + + :param rotational_acceleration_dto: The RotationalAcceleration DTO representation. + :type rotational_acceleration_dto: RotationalAccelerationDto + :return: A new instance of RotationalAcceleration. + :rtype: RotationalAcceleration + """ return RotationalAcceleration(rotational_acceleration_dto.value, rotational_acceleration_dto.unit) def __convert_from_base(self, from_unit: RotationalAccelerationUnits) -> float: diff --git a/unitsnet_py/units/rotational_speed.py b/unitsnet_py/units/rotational_speed.py index 8323d4e..e7ff23f 100644 --- a/unitsnet_py/units/rotational_speed.py +++ b/unitsnet_py/units/rotational_speed.py @@ -77,9 +77,30 @@ class RotationalSpeedUnits(Enum): class RotationalSpeedDto: + """ + A DTO representation of a RotationalSpeed + + Attributes: + value (float): The value of the RotationalSpeed. + unit (RotationalSpeedUnits): The specific unit that the RotationalSpeed value is representing. + """ + def __init__(self, value: float, unit: RotationalSpeedUnits): + """ + Create a new DTO representation of a RotationalSpeed + + Parameters: + value (float): The value of the RotationalSpeed. + unit (RotationalSpeedUnits): The specific unit that the RotationalSpeed value is representing. + """ self.value: float = value + """ + The value of the RotationalSpeed + """ self.unit: RotationalSpeedUnits = unit + """ + The specific unit that the RotationalSpeed value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -135,10 +156,26 @@ def convert(self, unit: RotationalSpeedUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RotationalSpeedUnits = RotationalSpeedUnits.RadianPerSecond) -> RotationalSpeedDto: + """ + Get a new instance of RotationalSpeed DTO representing the current unit. + + :param hold_in_unit: The specific RotationalSpeed unit to store the RotationalSpeed value in the DTO representation. + :type hold_in_unit: RotationalSpeedUnits + :return: A new instance of RotationalSpeedDto. + :rtype: RotationalSpeedDto + """ return RotationalSpeedDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(rotational_speed_dto: RotationalSpeedDto): + """ + Obtain a new instance of RotationalSpeed from a DTO unit object. + + :param rotational_speed_dto: The RotationalSpeed DTO representation. + :type rotational_speed_dto: RotationalSpeedDto + :return: A new instance of RotationalSpeed. + :rtype: RotationalSpeed + """ return RotationalSpeed(rotational_speed_dto.value, rotational_speed_dto.unit) def __convert_from_base(self, from_unit: RotationalSpeedUnits) -> float: diff --git a/unitsnet_py/units/rotational_stiffness.py b/unitsnet_py/units/rotational_stiffness.py index e43a39a..3081eca 100644 --- a/unitsnet_py/units/rotational_stiffness.py +++ b/unitsnet_py/units/rotational_stiffness.py @@ -177,9 +177,30 @@ class RotationalStiffnessUnits(Enum): class RotationalStiffnessDto: + """ + A DTO representation of a RotationalStiffness + + Attributes: + value (float): The value of the RotationalStiffness. + unit (RotationalStiffnessUnits): The specific unit that the RotationalStiffness value is representing. + """ + def __init__(self, value: float, unit: RotationalStiffnessUnits): + """ + Create a new DTO representation of a RotationalStiffness + + Parameters: + value (float): The value of the RotationalStiffness. + unit (RotationalStiffnessUnits): The specific unit that the RotationalStiffness value is representing. + """ self.value: float = value + """ + The value of the RotationalStiffness + """ self.unit: RotationalStiffnessUnits = unit + """ + The specific unit that the RotationalStiffness value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -275,10 +296,26 @@ def convert(self, unit: RotationalStiffnessUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RotationalStiffnessUnits = RotationalStiffnessUnits.NewtonMeterPerRadian) -> RotationalStiffnessDto: + """ + Get a new instance of RotationalStiffness DTO representing the current unit. + + :param hold_in_unit: The specific RotationalStiffness unit to store the RotationalStiffness value in the DTO representation. + :type hold_in_unit: RotationalStiffnessUnits + :return: A new instance of RotationalStiffnessDto. + :rtype: RotationalStiffnessDto + """ return RotationalStiffnessDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(rotational_stiffness_dto: RotationalStiffnessDto): + """ + Obtain a new instance of RotationalStiffness from a DTO unit object. + + :param rotational_stiffness_dto: The RotationalStiffness DTO representation. + :type rotational_stiffness_dto: RotationalStiffnessDto + :return: A new instance of RotationalStiffness. + :rtype: RotationalStiffness + """ return RotationalStiffness(rotational_stiffness_dto.value, rotational_stiffness_dto.unit) def __convert_from_base(self, from_unit: RotationalStiffnessUnits) -> float: diff --git a/unitsnet_py/units/rotational_stiffness_per_length.py b/unitsnet_py/units/rotational_stiffness_per_length.py index de6f748..a00070d 100644 --- a/unitsnet_py/units/rotational_stiffness_per_length.py +++ b/unitsnet_py/units/rotational_stiffness_per_length.py @@ -37,9 +37,30 @@ class RotationalStiffnessPerLengthUnits(Enum): class RotationalStiffnessPerLengthDto: + """ + A DTO representation of a RotationalStiffnessPerLength + + Attributes: + value (float): The value of the RotationalStiffnessPerLength. + unit (RotationalStiffnessPerLengthUnits): The specific unit that the RotationalStiffnessPerLength value is representing. + """ + def __init__(self, value: float, unit: RotationalStiffnessPerLengthUnits): + """ + Create a new DTO representation of a RotationalStiffnessPerLength + + Parameters: + value (float): The value of the RotationalStiffnessPerLength. + unit (RotationalStiffnessPerLengthUnits): The specific unit that the RotationalStiffnessPerLength value is representing. + """ self.value: float = value + """ + The value of the RotationalStiffnessPerLength + """ self.unit: RotationalStiffnessPerLengthUnits = unit + """ + The specific unit that the RotationalStiffnessPerLength value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -79,10 +100,26 @@ def convert(self, unit: RotationalStiffnessPerLengthUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: RotationalStiffnessPerLengthUnits = RotationalStiffnessPerLengthUnits.NewtonMeterPerRadianPerMeter) -> RotationalStiffnessPerLengthDto: + """ + Get a new instance of RotationalStiffnessPerLength DTO representing the current unit. + + :param hold_in_unit: The specific RotationalStiffnessPerLength unit to store the RotationalStiffnessPerLength value in the DTO representation. + :type hold_in_unit: RotationalStiffnessPerLengthUnits + :return: A new instance of RotationalStiffnessPerLengthDto. + :rtype: RotationalStiffnessPerLengthDto + """ return RotationalStiffnessPerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(rotational_stiffness_per_length_dto: RotationalStiffnessPerLengthDto): + """ + Obtain a new instance of RotationalStiffnessPerLength from a DTO unit object. + + :param rotational_stiffness_per_length_dto: The RotationalStiffnessPerLength DTO representation. + :type rotational_stiffness_per_length_dto: RotationalStiffnessPerLengthDto + :return: A new instance of RotationalStiffnessPerLength. + :rtype: RotationalStiffnessPerLength + """ return RotationalStiffnessPerLength(rotational_stiffness_per_length_dto.value, rotational_stiffness_per_length_dto.unit) def __convert_from_base(self, from_unit: RotationalStiffnessPerLengthUnits) -> float: diff --git a/unitsnet_py/units/scalar.py b/unitsnet_py/units/scalar.py index 0649659..31bb232 100644 --- a/unitsnet_py/units/scalar.py +++ b/unitsnet_py/units/scalar.py @@ -17,9 +17,30 @@ class ScalarUnits(Enum): class ScalarDto: + """ + A DTO representation of a Scalar + + Attributes: + value (float): The value of the Scalar. + unit (ScalarUnits): The specific unit that the Scalar value is representing. + """ + def __init__(self, value: float, unit: ScalarUnits): + """ + Create a new DTO representation of a Scalar + + Parameters: + value (float): The value of the Scalar. + unit (ScalarUnits): The specific unit that the Scalar value is representing. + """ self.value: float = value + """ + The value of the Scalar + """ self.unit: ScalarUnits = unit + """ + The specific unit that the Scalar value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: ScalarUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ScalarUnits = ScalarUnits.Amount) -> ScalarDto: + """ + Get a new instance of Scalar DTO representing the current unit. + + :param hold_in_unit: The specific Scalar unit to store the Scalar value in the DTO representation. + :type hold_in_unit: ScalarUnits + :return: A new instance of ScalarDto. + :rtype: ScalarDto + """ return ScalarDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(scalar_dto: ScalarDto): + """ + Obtain a new instance of Scalar from a DTO unit object. + + :param scalar_dto: The Scalar DTO representation. + :type scalar_dto: ScalarDto + :return: A new instance of Scalar. + :rtype: Scalar + """ return Scalar(scalar_dto.value, scalar_dto.unit) def __convert_from_base(self, from_unit: ScalarUnits) -> float: diff --git a/unitsnet_py/units/solid_angle.py b/unitsnet_py/units/solid_angle.py index 3d2b074..dd89376 100644 --- a/unitsnet_py/units/solid_angle.py +++ b/unitsnet_py/units/solid_angle.py @@ -17,9 +17,30 @@ class SolidAngleUnits(Enum): class SolidAngleDto: + """ + A DTO representation of a SolidAngle + + Attributes: + value (float): The value of the SolidAngle. + unit (SolidAngleUnits): The specific unit that the SolidAngle value is representing. + """ + def __init__(self, value: float, unit: SolidAngleUnits): + """ + Create a new DTO representation of a SolidAngle + + Parameters: + value (float): The value of the SolidAngle. + unit (SolidAngleUnits): The specific unit that the SolidAngle value is representing. + """ self.value: float = value + """ + The value of the SolidAngle + """ self.unit: SolidAngleUnits = unit + """ + The specific unit that the SolidAngle value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: SolidAngleUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SolidAngleUnits = SolidAngleUnits.Steradian) -> SolidAngleDto: + """ + Get a new instance of SolidAngle DTO representing the current unit. + + :param hold_in_unit: The specific SolidAngle unit to store the SolidAngle value in the DTO representation. + :type hold_in_unit: SolidAngleUnits + :return: A new instance of SolidAngleDto. + :rtype: SolidAngleDto + """ return SolidAngleDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(solid_angle_dto: SolidAngleDto): + """ + Obtain a new instance of SolidAngle from a DTO unit object. + + :param solid_angle_dto: The SolidAngle DTO representation. + :type solid_angle_dto: SolidAngleDto + :return: A new instance of SolidAngle. + :rtype: SolidAngle + """ return SolidAngle(solid_angle_dto.value, solid_angle_dto.unit) def __convert_from_base(self, from_unit: SolidAngleUnits) -> float: diff --git a/unitsnet_py/units/specific_energy.py b/unitsnet_py/units/specific_energy.py index 758678b..bb2abe2 100644 --- a/unitsnet_py/units/specific_energy.py +++ b/unitsnet_py/units/specific_energy.py @@ -162,9 +162,30 @@ class SpecificEnergyUnits(Enum): class SpecificEnergyDto: + """ + A DTO representation of a SpecificEnergy + + Attributes: + value (float): The value of the SpecificEnergy. + unit (SpecificEnergyUnits): The specific unit that the SpecificEnergy value is representing. + """ + def __init__(self, value: float, unit: SpecificEnergyUnits): + """ + Create a new DTO representation of a SpecificEnergy + + Parameters: + value (float): The value of the SpecificEnergy. + unit (SpecificEnergyUnits): The specific unit that the SpecificEnergy value is representing. + """ self.value: float = value + """ + The value of the SpecificEnergy + """ self.unit: SpecificEnergyUnits = unit + """ + The specific unit that the SpecificEnergy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -254,10 +275,26 @@ def convert(self, unit: SpecificEnergyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SpecificEnergyUnits = SpecificEnergyUnits.JoulePerKilogram) -> SpecificEnergyDto: + """ + Get a new instance of SpecificEnergy DTO representing the current unit. + + :param hold_in_unit: The specific SpecificEnergy unit to store the SpecificEnergy value in the DTO representation. + :type hold_in_unit: SpecificEnergyUnits + :return: A new instance of SpecificEnergyDto. + :rtype: SpecificEnergyDto + """ return SpecificEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(specific_energy_dto: SpecificEnergyDto): + """ + Obtain a new instance of SpecificEnergy from a DTO unit object. + + :param specific_energy_dto: The SpecificEnergy DTO representation. + :type specific_energy_dto: SpecificEnergyDto + :return: A new instance of SpecificEnergy. + :rtype: SpecificEnergy + """ return SpecificEnergy(specific_energy_dto.value, specific_energy_dto.unit) def __convert_from_base(self, from_unit: SpecificEnergyUnits) -> float: diff --git a/unitsnet_py/units/specific_entropy.py b/unitsnet_py/units/specific_entropy.py index 47c0a3c..349dc2a 100644 --- a/unitsnet_py/units/specific_entropy.py +++ b/unitsnet_py/units/specific_entropy.py @@ -57,9 +57,30 @@ class SpecificEntropyUnits(Enum): class SpecificEntropyDto: + """ + A DTO representation of a SpecificEntropy + + Attributes: + value (float): The value of the SpecificEntropy. + unit (SpecificEntropyUnits): The specific unit that the SpecificEntropy value is representing. + """ + def __init__(self, value: float, unit: SpecificEntropyUnits): + """ + Create a new DTO representation of a SpecificEntropy + + Parameters: + value (float): The value of the SpecificEntropy. + unit (SpecificEntropyUnits): The specific unit that the SpecificEntropy value is representing. + """ self.value: float = value + """ + The value of the SpecificEntropy + """ self.unit: SpecificEntropyUnits = unit + """ + The specific unit that the SpecificEntropy value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: SpecificEntropyUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SpecificEntropyUnits = SpecificEntropyUnits.JoulePerKilogramKelvin) -> SpecificEntropyDto: + """ + Get a new instance of SpecificEntropy DTO representing the current unit. + + :param hold_in_unit: The specific SpecificEntropy unit to store the SpecificEntropy value in the DTO representation. + :type hold_in_unit: SpecificEntropyUnits + :return: A new instance of SpecificEntropyDto. + :rtype: SpecificEntropyDto + """ return SpecificEntropyDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(specific_entropy_dto: SpecificEntropyDto): + """ + Obtain a new instance of SpecificEntropy from a DTO unit object. + + :param specific_entropy_dto: The SpecificEntropy DTO representation. + :type specific_entropy_dto: SpecificEntropyDto + :return: A new instance of SpecificEntropy. + :rtype: SpecificEntropy + """ return SpecificEntropy(specific_entropy_dto.value, specific_entropy_dto.unit) def __convert_from_base(self, from_unit: SpecificEntropyUnits) -> float: diff --git a/unitsnet_py/units/specific_fuel_consumption.py b/unitsnet_py/units/specific_fuel_consumption.py index e938c4d..258ab2a 100644 --- a/unitsnet_py/units/specific_fuel_consumption.py +++ b/unitsnet_py/units/specific_fuel_consumption.py @@ -32,9 +32,30 @@ class SpecificFuelConsumptionUnits(Enum): class SpecificFuelConsumptionDto: + """ + A DTO representation of a SpecificFuelConsumption + + Attributes: + value (float): The value of the SpecificFuelConsumption. + unit (SpecificFuelConsumptionUnits): The specific unit that the SpecificFuelConsumption value is representing. + """ + def __init__(self, value: float, unit: SpecificFuelConsumptionUnits): + """ + Create a new DTO representation of a SpecificFuelConsumption + + Parameters: + value (float): The value of the SpecificFuelConsumption. + unit (SpecificFuelConsumptionUnits): The specific unit that the SpecificFuelConsumption value is representing. + """ self.value: float = value + """ + The value of the SpecificFuelConsumption + """ self.unit: SpecificFuelConsumptionUnits = unit + """ + The specific unit that the SpecificFuelConsumption value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: SpecificFuelConsumptionUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SpecificFuelConsumptionUnits = SpecificFuelConsumptionUnits.GramPerKiloNewtonSecond) -> SpecificFuelConsumptionDto: + """ + Get a new instance of SpecificFuelConsumption DTO representing the current unit. + + :param hold_in_unit: The specific SpecificFuelConsumption unit to store the SpecificFuelConsumption value in the DTO representation. + :type hold_in_unit: SpecificFuelConsumptionUnits + :return: A new instance of SpecificFuelConsumptionDto. + :rtype: SpecificFuelConsumptionDto + """ return SpecificFuelConsumptionDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(specific_fuel_consumption_dto: SpecificFuelConsumptionDto): + """ + Obtain a new instance of SpecificFuelConsumption from a DTO unit object. + + :param specific_fuel_consumption_dto: The SpecificFuelConsumption DTO representation. + :type specific_fuel_consumption_dto: SpecificFuelConsumptionDto + :return: A new instance of SpecificFuelConsumption. + :rtype: SpecificFuelConsumption + """ return SpecificFuelConsumption(specific_fuel_consumption_dto.value, specific_fuel_consumption_dto.unit) def __convert_from_base(self, from_unit: SpecificFuelConsumptionUnits) -> float: diff --git a/unitsnet_py/units/specific_volume.py b/unitsnet_py/units/specific_volume.py index 8590196..ad872fc 100644 --- a/unitsnet_py/units/specific_volume.py +++ b/unitsnet_py/units/specific_volume.py @@ -27,9 +27,30 @@ class SpecificVolumeUnits(Enum): class SpecificVolumeDto: + """ + A DTO representation of a SpecificVolume + + Attributes: + value (float): The value of the SpecificVolume. + unit (SpecificVolumeUnits): The specific unit that the SpecificVolume value is representing. + """ + def __init__(self, value: float, unit: SpecificVolumeUnits): + """ + Create a new DTO representation of a SpecificVolume + + Parameters: + value (float): The value of the SpecificVolume. + unit (SpecificVolumeUnits): The specific unit that the SpecificVolume value is representing. + """ self.value: float = value + """ + The value of the SpecificVolume + """ self.unit: SpecificVolumeUnits = unit + """ + The specific unit that the SpecificVolume value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -65,10 +86,26 @@ def convert(self, unit: SpecificVolumeUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SpecificVolumeUnits = SpecificVolumeUnits.CubicMeterPerKilogram) -> SpecificVolumeDto: + """ + Get a new instance of SpecificVolume DTO representing the current unit. + + :param hold_in_unit: The specific SpecificVolume unit to store the SpecificVolume value in the DTO representation. + :type hold_in_unit: SpecificVolumeUnits + :return: A new instance of SpecificVolumeDto. + :rtype: SpecificVolumeDto + """ return SpecificVolumeDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(specific_volume_dto: SpecificVolumeDto): + """ + Obtain a new instance of SpecificVolume from a DTO unit object. + + :param specific_volume_dto: The SpecificVolume DTO representation. + :type specific_volume_dto: SpecificVolumeDto + :return: A new instance of SpecificVolume. + :rtype: SpecificVolume + """ return SpecificVolume(specific_volume_dto.value, specific_volume_dto.unit) def __convert_from_base(self, from_unit: SpecificVolumeUnits) -> float: diff --git a/unitsnet_py/units/specific_weight.py b/unitsnet_py/units/specific_weight.py index b39a652..d38798b 100644 --- a/unitsnet_py/units/specific_weight.py +++ b/unitsnet_py/units/specific_weight.py @@ -97,9 +97,30 @@ class SpecificWeightUnits(Enum): class SpecificWeightDto: + """ + A DTO representation of a SpecificWeight + + Attributes: + value (float): The value of the SpecificWeight. + unit (SpecificWeightUnits): The specific unit that the SpecificWeight value is representing. + """ + def __init__(self, value: float, unit: SpecificWeightUnits): + """ + Create a new DTO representation of a SpecificWeight + + Parameters: + value (float): The value of the SpecificWeight. + unit (SpecificWeightUnits): The specific unit that the SpecificWeight value is representing. + """ self.value: float = value + """ + The value of the SpecificWeight + """ self.unit: SpecificWeightUnits = unit + """ + The specific unit that the SpecificWeight value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -163,10 +184,26 @@ def convert(self, unit: SpecificWeightUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SpecificWeightUnits = SpecificWeightUnits.NewtonPerCubicMeter) -> SpecificWeightDto: + """ + Get a new instance of SpecificWeight DTO representing the current unit. + + :param hold_in_unit: The specific SpecificWeight unit to store the SpecificWeight value in the DTO representation. + :type hold_in_unit: SpecificWeightUnits + :return: A new instance of SpecificWeightDto. + :rtype: SpecificWeightDto + """ return SpecificWeightDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(specific_weight_dto: SpecificWeightDto): + """ + Obtain a new instance of SpecificWeight from a DTO unit object. + + :param specific_weight_dto: The SpecificWeight DTO representation. + :type specific_weight_dto: SpecificWeightDto + :return: A new instance of SpecificWeight. + :rtype: SpecificWeight + """ return SpecificWeight(specific_weight_dto.value, specific_weight_dto.unit) def __convert_from_base(self, from_unit: SpecificWeightUnits) -> float: diff --git a/unitsnet_py/units/speed.py b/unitsnet_py/units/speed.py index fb900df..a81b665 100644 --- a/unitsnet_py/units/speed.py +++ b/unitsnet_py/units/speed.py @@ -177,9 +177,30 @@ class SpeedUnits(Enum): class SpeedDto: + """ + A DTO representation of a Speed + + Attributes: + value (float): The value of the Speed. + unit (SpeedUnits): The specific unit that the Speed value is representing. + """ + def __init__(self, value: float, unit: SpeedUnits): + """ + Create a new DTO representation of a Speed + + Parameters: + value (float): The value of the Speed. + unit (SpeedUnits): The specific unit that the Speed value is representing. + """ self.value: float = value + """ + The value of the Speed + """ self.unit: SpeedUnits = unit + """ + The specific unit that the Speed value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -275,10 +296,26 @@ def convert(self, unit: SpeedUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: SpeedUnits = SpeedUnits.MeterPerSecond) -> SpeedDto: + """ + Get a new instance of Speed DTO representing the current unit. + + :param hold_in_unit: The specific Speed unit to store the Speed value in the DTO representation. + :type hold_in_unit: SpeedUnits + :return: A new instance of SpeedDto. + :rtype: SpeedDto + """ return SpeedDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(speed_dto: SpeedDto): + """ + Obtain a new instance of Speed from a DTO unit object. + + :param speed_dto: The Speed DTO representation. + :type speed_dto: SpeedDto + :return: A new instance of Speed. + :rtype: Speed + """ return Speed(speed_dto.value, speed_dto.unit) def __convert_from_base(self, from_unit: SpeedUnits) -> float: diff --git a/unitsnet_py/units/standard_volume_flow.py b/unitsnet_py/units/standard_volume_flow.py index aefb97d..2937a44 100644 --- a/unitsnet_py/units/standard_volume_flow.py +++ b/unitsnet_py/units/standard_volume_flow.py @@ -57,9 +57,30 @@ class StandardVolumeFlowUnits(Enum): class StandardVolumeFlowDto: + """ + A DTO representation of a StandardVolumeFlow + + Attributes: + value (float): The value of the StandardVolumeFlow. + unit (StandardVolumeFlowUnits): The specific unit that the StandardVolumeFlow value is representing. + """ + def __init__(self, value: float, unit: StandardVolumeFlowUnits): + """ + Create a new DTO representation of a StandardVolumeFlow + + Parameters: + value (float): The value of the StandardVolumeFlow. + unit (StandardVolumeFlowUnits): The specific unit that the StandardVolumeFlow value is representing. + """ self.value: float = value + """ + The value of the StandardVolumeFlow + """ self.unit: StandardVolumeFlowUnits = unit + """ + The specific unit that the StandardVolumeFlow value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: StandardVolumeFlowUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: StandardVolumeFlowUnits = StandardVolumeFlowUnits.StandardCubicMeterPerSecond) -> StandardVolumeFlowDto: + """ + Get a new instance of StandardVolumeFlow DTO representing the current unit. + + :param hold_in_unit: The specific StandardVolumeFlow unit to store the StandardVolumeFlow value in the DTO representation. + :type hold_in_unit: StandardVolumeFlowUnits + :return: A new instance of StandardVolumeFlowDto. + :rtype: StandardVolumeFlowDto + """ return StandardVolumeFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(standard_volume_flow_dto: StandardVolumeFlowDto): + """ + Obtain a new instance of StandardVolumeFlow from a DTO unit object. + + :param standard_volume_flow_dto: The StandardVolumeFlow DTO representation. + :type standard_volume_flow_dto: StandardVolumeFlowDto + :return: A new instance of StandardVolumeFlow. + :rtype: StandardVolumeFlow + """ return StandardVolumeFlow(standard_volume_flow_dto.value, standard_volume_flow_dto.unit) def __convert_from_base(self, from_unit: StandardVolumeFlowUnits) -> float: diff --git a/unitsnet_py/units/temperature.py b/unitsnet_py/units/temperature.py index 3377cdd..753e0d7 100644 --- a/unitsnet_py/units/temperature.py +++ b/unitsnet_py/units/temperature.py @@ -62,9 +62,30 @@ class TemperatureUnits(Enum): class TemperatureDto: + """ + A DTO representation of a Temperature + + Attributes: + value (float): The value of the Temperature. + unit (TemperatureUnits): The specific unit that the Temperature value is representing. + """ + def __init__(self, value: float, unit: TemperatureUnits): + """ + Create a new DTO representation of a Temperature + + Parameters: + value (float): The value of the Temperature. + unit (TemperatureUnits): The specific unit that the Temperature value is representing. + """ self.value: float = value + """ + The value of the Temperature + """ self.unit: TemperatureUnits = unit + """ + The specific unit that the Temperature value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -114,10 +135,26 @@ def convert(self, unit: TemperatureUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TemperatureUnits = TemperatureUnits.Kelvin) -> TemperatureDto: + """ + Get a new instance of Temperature DTO representing the current unit. + + :param hold_in_unit: The specific Temperature unit to store the Temperature value in the DTO representation. + :type hold_in_unit: TemperatureUnits + :return: A new instance of TemperatureDto. + :rtype: TemperatureDto + """ return TemperatureDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(temperature_dto: TemperatureDto): + """ + Obtain a new instance of Temperature from a DTO unit object. + + :param temperature_dto: The Temperature DTO representation. + :type temperature_dto: TemperatureDto + :return: A new instance of Temperature. + :rtype: Temperature + """ return Temperature(temperature_dto.value, temperature_dto.unit) def __convert_from_base(self, from_unit: TemperatureUnits) -> float: diff --git a/unitsnet_py/units/temperature_change_rate.py b/unitsnet_py/units/temperature_change_rate.py index dba01a5..53d033d 100644 --- a/unitsnet_py/units/temperature_change_rate.py +++ b/unitsnet_py/units/temperature_change_rate.py @@ -62,9 +62,30 @@ class TemperatureChangeRateUnits(Enum): class TemperatureChangeRateDto: + """ + A DTO representation of a TemperatureChangeRate + + Attributes: + value (float): The value of the TemperatureChangeRate. + unit (TemperatureChangeRateUnits): The specific unit that the TemperatureChangeRate value is representing. + """ + def __init__(self, value: float, unit: TemperatureChangeRateUnits): + """ + Create a new DTO representation of a TemperatureChangeRate + + Parameters: + value (float): The value of the TemperatureChangeRate. + unit (TemperatureChangeRateUnits): The specific unit that the TemperatureChangeRate value is representing. + """ self.value: float = value + """ + The value of the TemperatureChangeRate + """ self.unit: TemperatureChangeRateUnits = unit + """ + The specific unit that the TemperatureChangeRate value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -114,10 +135,26 @@ def convert(self, unit: TemperatureChangeRateUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TemperatureChangeRateUnits = TemperatureChangeRateUnits.DegreeCelsiusPerSecond) -> TemperatureChangeRateDto: + """ + Get a new instance of TemperatureChangeRate DTO representing the current unit. + + :param hold_in_unit: The specific TemperatureChangeRate unit to store the TemperatureChangeRate value in the DTO representation. + :type hold_in_unit: TemperatureChangeRateUnits + :return: A new instance of TemperatureChangeRateDto. + :rtype: TemperatureChangeRateDto + """ return TemperatureChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(temperature_change_rate_dto: TemperatureChangeRateDto): + """ + Obtain a new instance of TemperatureChangeRate from a DTO unit object. + + :param temperature_change_rate_dto: The TemperatureChangeRate DTO representation. + :type temperature_change_rate_dto: TemperatureChangeRateDto + :return: A new instance of TemperatureChangeRate. + :rtype: TemperatureChangeRate + """ return TemperatureChangeRate(temperature_change_rate_dto.value, temperature_change_rate_dto.unit) def __convert_from_base(self, from_unit: TemperatureChangeRateUnits) -> float: diff --git a/unitsnet_py/units/temperature_delta.py b/unitsnet_py/units/temperature_delta.py index 74deabe..e4cf696 100644 --- a/unitsnet_py/units/temperature_delta.py +++ b/unitsnet_py/units/temperature_delta.py @@ -57,9 +57,30 @@ class TemperatureDeltaUnits(Enum): class TemperatureDeltaDto: + """ + A DTO representation of a TemperatureDelta + + Attributes: + value (float): The value of the TemperatureDelta. + unit (TemperatureDeltaUnits): The specific unit that the TemperatureDelta value is representing. + """ + def __init__(self, value: float, unit: TemperatureDeltaUnits): + """ + Create a new DTO representation of a TemperatureDelta + + Parameters: + value (float): The value of the TemperatureDelta. + unit (TemperatureDeltaUnits): The specific unit that the TemperatureDelta value is representing. + """ self.value: float = value + """ + The value of the TemperatureDelta + """ self.unit: TemperatureDeltaUnits = unit + """ + The specific unit that the TemperatureDelta value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: TemperatureDeltaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TemperatureDeltaUnits = TemperatureDeltaUnits.Kelvin) -> TemperatureDeltaDto: + """ + Get a new instance of TemperatureDelta DTO representing the current unit. + + :param hold_in_unit: The specific TemperatureDelta unit to store the TemperatureDelta value in the DTO representation. + :type hold_in_unit: TemperatureDeltaUnits + :return: A new instance of TemperatureDeltaDto. + :rtype: TemperatureDeltaDto + """ return TemperatureDeltaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(temperature_delta_dto: TemperatureDeltaDto): + """ + Obtain a new instance of TemperatureDelta from a DTO unit object. + + :param temperature_delta_dto: The TemperatureDelta DTO representation. + :type temperature_delta_dto: TemperatureDeltaDto + :return: A new instance of TemperatureDelta. + :rtype: TemperatureDelta + """ return TemperatureDelta(temperature_delta_dto.value, temperature_delta_dto.unit) def __convert_from_base(self, from_unit: TemperatureDeltaUnits) -> float: diff --git a/unitsnet_py/units/temperature_gradient.py b/unitsnet_py/units/temperature_gradient.py index ae96d99..596bcf4 100644 --- a/unitsnet_py/units/temperature_gradient.py +++ b/unitsnet_py/units/temperature_gradient.py @@ -32,9 +32,30 @@ class TemperatureGradientUnits(Enum): class TemperatureGradientDto: + """ + A DTO representation of a TemperatureGradient + + Attributes: + value (float): The value of the TemperatureGradient. + unit (TemperatureGradientUnits): The specific unit that the TemperatureGradient value is representing. + """ + def __init__(self, value: float, unit: TemperatureGradientUnits): + """ + Create a new DTO representation of a TemperatureGradient + + Parameters: + value (float): The value of the TemperatureGradient. + unit (TemperatureGradientUnits): The specific unit that the TemperatureGradient value is representing. + """ self.value: float = value + """ + The value of the TemperatureGradient + """ self.unit: TemperatureGradientUnits = unit + """ + The specific unit that the TemperatureGradient value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -72,10 +93,26 @@ def convert(self, unit: TemperatureGradientUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TemperatureGradientUnits = TemperatureGradientUnits.KelvinPerMeter) -> TemperatureGradientDto: + """ + Get a new instance of TemperatureGradient DTO representing the current unit. + + :param hold_in_unit: The specific TemperatureGradient unit to store the TemperatureGradient value in the DTO representation. + :type hold_in_unit: TemperatureGradientUnits + :return: A new instance of TemperatureGradientDto. + :rtype: TemperatureGradientDto + """ return TemperatureGradientDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(temperature_gradient_dto: TemperatureGradientDto): + """ + Obtain a new instance of TemperatureGradient from a DTO unit object. + + :param temperature_gradient_dto: The TemperatureGradient DTO representation. + :type temperature_gradient_dto: TemperatureGradientDto + :return: A new instance of TemperatureGradient. + :rtype: TemperatureGradient + """ return TemperatureGradient(temperature_gradient_dto.value, temperature_gradient_dto.unit) def __convert_from_base(self, from_unit: TemperatureGradientUnits) -> float: diff --git a/unitsnet_py/units/thermal_conductivity.py b/unitsnet_py/units/thermal_conductivity.py index 31f30a0..2a69afb 100644 --- a/unitsnet_py/units/thermal_conductivity.py +++ b/unitsnet_py/units/thermal_conductivity.py @@ -22,9 +22,30 @@ class ThermalConductivityUnits(Enum): class ThermalConductivityDto: + """ + A DTO representation of a ThermalConductivity + + Attributes: + value (float): The value of the ThermalConductivity. + unit (ThermalConductivityUnits): The specific unit that the ThermalConductivity value is representing. + """ + def __init__(self, value: float, unit: ThermalConductivityUnits): + """ + Create a new DTO representation of a ThermalConductivity + + Parameters: + value (float): The value of the ThermalConductivity. + unit (ThermalConductivityUnits): The specific unit that the ThermalConductivity value is representing. + """ self.value: float = value + """ + The value of the ThermalConductivity + """ self.unit: ThermalConductivityUnits = unit + """ + The specific unit that the ThermalConductivity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -58,10 +79,26 @@ def convert(self, unit: ThermalConductivityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ThermalConductivityUnits = ThermalConductivityUnits.WattPerMeterKelvin) -> ThermalConductivityDto: + """ + Get a new instance of ThermalConductivity DTO representing the current unit. + + :param hold_in_unit: The specific ThermalConductivity unit to store the ThermalConductivity value in the DTO representation. + :type hold_in_unit: ThermalConductivityUnits + :return: A new instance of ThermalConductivityDto. + :rtype: ThermalConductivityDto + """ return ThermalConductivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(thermal_conductivity_dto: ThermalConductivityDto): + """ + Obtain a new instance of ThermalConductivity from a DTO unit object. + + :param thermal_conductivity_dto: The ThermalConductivity DTO representation. + :type thermal_conductivity_dto: ThermalConductivityDto + :return: A new instance of ThermalConductivity. + :rtype: ThermalConductivity + """ return ThermalConductivity(thermal_conductivity_dto.value, thermal_conductivity_dto.unit) def __convert_from_base(self, from_unit: ThermalConductivityUnits) -> float: diff --git a/unitsnet_py/units/thermal_resistance.py b/unitsnet_py/units/thermal_resistance.py index fe22977..7777bdd 100644 --- a/unitsnet_py/units/thermal_resistance.py +++ b/unitsnet_py/units/thermal_resistance.py @@ -42,9 +42,30 @@ class ThermalResistanceUnits(Enum): class ThermalResistanceDto: + """ + A DTO representation of a ThermalResistance + + Attributes: + value (float): The value of the ThermalResistance. + unit (ThermalResistanceUnits): The specific unit that the ThermalResistance value is representing. + """ + def __init__(self, value: float, unit: ThermalResistanceUnits): + """ + Create a new DTO representation of a ThermalResistance + + Parameters: + value (float): The value of the ThermalResistance. + unit (ThermalResistanceUnits): The specific unit that the ThermalResistance value is representing. + """ self.value: float = value + """ + The value of the ThermalResistance + """ self.unit: ThermalResistanceUnits = unit + """ + The specific unit that the ThermalResistance value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: ThermalResistanceUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: ThermalResistanceUnits = ThermalResistanceUnits.SquareMeterKelvinPerKilowatt) -> ThermalResistanceDto: + """ + Get a new instance of ThermalResistance DTO representing the current unit. + + :param hold_in_unit: The specific ThermalResistance unit to store the ThermalResistance value in the DTO representation. + :type hold_in_unit: ThermalResistanceUnits + :return: A new instance of ThermalResistanceDto. + :rtype: ThermalResistanceDto + """ return ThermalResistanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(thermal_resistance_dto: ThermalResistanceDto): + """ + Obtain a new instance of ThermalResistance from a DTO unit object. + + :param thermal_resistance_dto: The ThermalResistance DTO representation. + :type thermal_resistance_dto: ThermalResistanceDto + :return: A new instance of ThermalResistance. + :rtype: ThermalResistance + """ return ThermalResistance(thermal_resistance_dto.value, thermal_resistance_dto.unit) def __convert_from_base(self, from_unit: ThermalResistanceUnits) -> float: diff --git a/unitsnet_py/units/torque.py b/unitsnet_py/units/torque.py index 774c513..f03bdc7 100644 --- a/unitsnet_py/units/torque.py +++ b/unitsnet_py/units/torque.py @@ -137,9 +137,30 @@ class TorqueUnits(Enum): class TorqueDto: + """ + A DTO representation of a Torque + + Attributes: + value (float): The value of the Torque. + unit (TorqueUnits): The specific unit that the Torque value is representing. + """ + def __init__(self, value: float, unit: TorqueUnits): + """ + Create a new DTO representation of a Torque + + Parameters: + value (float): The value of the Torque. + unit (TorqueUnits): The specific unit that the Torque value is representing. + """ self.value: float = value + """ + The value of the Torque + """ self.unit: TorqueUnits = unit + """ + The specific unit that the Torque value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -219,10 +240,26 @@ def convert(self, unit: TorqueUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TorqueUnits = TorqueUnits.NewtonMeter) -> TorqueDto: + """ + Get a new instance of Torque DTO representing the current unit. + + :param hold_in_unit: The specific Torque unit to store the Torque value in the DTO representation. + :type hold_in_unit: TorqueUnits + :return: A new instance of TorqueDto. + :rtype: TorqueDto + """ return TorqueDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(torque_dto: TorqueDto): + """ + Obtain a new instance of Torque from a DTO unit object. + + :param torque_dto: The Torque DTO representation. + :type torque_dto: TorqueDto + :return: A new instance of Torque. + :rtype: Torque + """ return Torque(torque_dto.value, torque_dto.unit) def __convert_from_base(self, from_unit: TorqueUnits) -> float: diff --git a/unitsnet_py/units/torque_per_length.py b/unitsnet_py/units/torque_per_length.py index 3797142..d00d14d 100644 --- a/unitsnet_py/units/torque_per_length.py +++ b/unitsnet_py/units/torque_per_length.py @@ -117,9 +117,30 @@ class TorquePerLengthUnits(Enum): class TorquePerLengthDto: + """ + A DTO representation of a TorquePerLength + + Attributes: + value (float): The value of the TorquePerLength. + unit (TorquePerLengthUnits): The specific unit that the TorquePerLength value is representing. + """ + def __init__(self, value: float, unit: TorquePerLengthUnits): + """ + Create a new DTO representation of a TorquePerLength + + Parameters: + value (float): The value of the TorquePerLength. + unit (TorquePerLengthUnits): The specific unit that the TorquePerLength value is representing. + """ self.value: float = value + """ + The value of the TorquePerLength + """ self.unit: TorquePerLengthUnits = unit + """ + The specific unit that the TorquePerLength value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -191,10 +212,26 @@ def convert(self, unit: TorquePerLengthUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TorquePerLengthUnits = TorquePerLengthUnits.NewtonMeterPerMeter) -> TorquePerLengthDto: + """ + Get a new instance of TorquePerLength DTO representing the current unit. + + :param hold_in_unit: The specific TorquePerLength unit to store the TorquePerLength value in the DTO representation. + :type hold_in_unit: TorquePerLengthUnits + :return: A new instance of TorquePerLengthDto. + :rtype: TorquePerLengthDto + """ return TorquePerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(torque_per_length_dto: TorquePerLengthDto): + """ + Obtain a new instance of TorquePerLength from a DTO unit object. + + :param torque_per_length_dto: The TorquePerLength DTO representation. + :type torque_per_length_dto: TorquePerLengthDto + :return: A new instance of TorquePerLength. + :rtype: TorquePerLength + """ return TorquePerLength(torque_per_length_dto.value, torque_per_length_dto.unit) def __convert_from_base(self, from_unit: TorquePerLengthUnits) -> float: diff --git a/unitsnet_py/units/turbidity.py b/unitsnet_py/units/turbidity.py index dd11472..2b2f5b3 100644 --- a/unitsnet_py/units/turbidity.py +++ b/unitsnet_py/units/turbidity.py @@ -17,9 +17,30 @@ class TurbidityUnits(Enum): class TurbidityDto: + """ + A DTO representation of a Turbidity + + Attributes: + value (float): The value of the Turbidity. + unit (TurbidityUnits): The specific unit that the Turbidity value is representing. + """ + def __init__(self, value: float, unit: TurbidityUnits): + """ + Create a new DTO representation of a Turbidity + + Parameters: + value (float): The value of the Turbidity. + unit (TurbidityUnits): The specific unit that the Turbidity value is representing. + """ self.value: float = value + """ + The value of the Turbidity + """ self.unit: TurbidityUnits = unit + """ + The specific unit that the Turbidity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: TurbidityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: TurbidityUnits = TurbidityUnits.NTU) -> TurbidityDto: + """ + Get a new instance of Turbidity DTO representing the current unit. + + :param hold_in_unit: The specific Turbidity unit to store the Turbidity value in the DTO representation. + :type hold_in_unit: TurbidityUnits + :return: A new instance of TurbidityDto. + :rtype: TurbidityDto + """ return TurbidityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(turbidity_dto: TurbidityDto): + """ + Obtain a new instance of Turbidity from a DTO unit object. + + :param turbidity_dto: The Turbidity DTO representation. + :type turbidity_dto: TurbidityDto + :return: A new instance of Turbidity. + :rtype: Turbidity + """ return Turbidity(turbidity_dto.value, turbidity_dto.unit) def __convert_from_base(self, from_unit: TurbidityUnits) -> float: diff --git a/unitsnet_py/units/vitamin_a.py b/unitsnet_py/units/vitamin_a.py index f46f730..bc143a6 100644 --- a/unitsnet_py/units/vitamin_a.py +++ b/unitsnet_py/units/vitamin_a.py @@ -17,9 +17,30 @@ class VitaminAUnits(Enum): class VitaminADto: + """ + A DTO representation of a VitaminA + + Attributes: + value (float): The value of the VitaminA. + unit (VitaminAUnits): The specific unit that the VitaminA value is representing. + """ + def __init__(self, value: float, unit: VitaminAUnits): + """ + Create a new DTO representation of a VitaminA + + Parameters: + value (float): The value of the VitaminA. + unit (VitaminAUnits): The specific unit that the VitaminA value is representing. + """ self.value: float = value + """ + The value of the VitaminA + """ self.unit: VitaminAUnits = unit + """ + The specific unit that the VitaminA value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -51,10 +72,26 @@ def convert(self, unit: VitaminAUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VitaminAUnits = VitaminAUnits.InternationalUnit) -> VitaminADto: + """ + Get a new instance of VitaminA DTO representing the current unit. + + :param hold_in_unit: The specific VitaminA unit to store the VitaminA value in the DTO representation. + :type hold_in_unit: VitaminAUnits + :return: A new instance of VitaminADto. + :rtype: VitaminADto + """ return VitaminADto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(vitamin_a_dto: VitaminADto): + """ + Obtain a new instance of VitaminA from a DTO unit object. + + :param vitamin_a_dto: The VitaminA DTO representation. + :type vitamin_a_dto: VitaminADto + :return: A new instance of VitaminA. + :rtype: VitaminA + """ return VitaminA(vitamin_a_dto.value, vitamin_a_dto.unit) def __convert_from_base(self, from_unit: VitaminAUnits) -> float: diff --git a/unitsnet_py/units/volume.py b/unitsnet_py/units/volume.py index 31c7b0d..5aa79e8 100644 --- a/unitsnet_py/units/volume.py +++ b/unitsnet_py/units/volume.py @@ -282,9 +282,30 @@ class VolumeUnits(Enum): class VolumeDto: + """ + A DTO representation of a Volume + + Attributes: + value (float): The value of the Volume. + unit (VolumeUnits): The specific unit that the Volume value is representing. + """ + def __init__(self, value: float, unit: VolumeUnits): + """ + Create a new DTO representation of a Volume + + Parameters: + value (float): The value of the Volume. + unit (VolumeUnits): The specific unit that the Volume value is representing. + """ self.value: float = value + """ + The value of the Volume + """ self.unit: VolumeUnits = unit + """ + The specific unit that the Volume value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -422,10 +443,26 @@ def convert(self, unit: VolumeUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VolumeUnits = VolumeUnits.CubicMeter) -> VolumeDto: + """ + Get a new instance of Volume DTO representing the current unit. + + :param hold_in_unit: The specific Volume unit to store the Volume value in the DTO representation. + :type hold_in_unit: VolumeUnits + :return: A new instance of VolumeDto. + :rtype: VolumeDto + """ return VolumeDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(volume_dto: VolumeDto): + """ + Obtain a new instance of Volume from a DTO unit object. + + :param volume_dto: The Volume DTO representation. + :type volume_dto: VolumeDto + :return: A new instance of Volume. + :rtype: Volume + """ return Volume(volume_dto.value, volume_dto.unit) def __convert_from_base(self, from_unit: VolumeUnits) -> float: diff --git a/unitsnet_py/units/volume_concentration.py b/unitsnet_py/units/volume_concentration.py index 9a08b75..b5d7d7d 100644 --- a/unitsnet_py/units/volume_concentration.py +++ b/unitsnet_py/units/volume_concentration.py @@ -112,9 +112,30 @@ class VolumeConcentrationUnits(Enum): class VolumeConcentrationDto: + """ + A DTO representation of a VolumeConcentration + + Attributes: + value (float): The value of the VolumeConcentration. + unit (VolumeConcentrationUnits): The specific unit that the VolumeConcentration value is representing. + """ + def __init__(self, value: float, unit: VolumeConcentrationUnits): + """ + Create a new DTO representation of a VolumeConcentration + + Parameters: + value (float): The value of the VolumeConcentration. + unit (VolumeConcentrationUnits): The specific unit that the VolumeConcentration value is representing. + """ self.value: float = value + """ + The value of the VolumeConcentration + """ self.unit: VolumeConcentrationUnits = unit + """ + The specific unit that the VolumeConcentration value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -184,10 +205,26 @@ def convert(self, unit: VolumeConcentrationUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VolumeConcentrationUnits = VolumeConcentrationUnits.DecimalFraction) -> VolumeConcentrationDto: + """ + Get a new instance of VolumeConcentration DTO representing the current unit. + + :param hold_in_unit: The specific VolumeConcentration unit to store the VolumeConcentration value in the DTO representation. + :type hold_in_unit: VolumeConcentrationUnits + :return: A new instance of VolumeConcentrationDto. + :rtype: VolumeConcentrationDto + """ return VolumeConcentrationDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(volume_concentration_dto: VolumeConcentrationDto): + """ + Obtain a new instance of VolumeConcentration from a DTO unit object. + + :param volume_concentration_dto: The VolumeConcentration DTO representation. + :type volume_concentration_dto: VolumeConcentrationDto + :return: A new instance of VolumeConcentration. + :rtype: VolumeConcentration + """ return VolumeConcentration(volume_concentration_dto.value, volume_concentration_dto.unit) def __convert_from_base(self, from_unit: VolumeConcentrationUnits) -> float: diff --git a/unitsnet_py/units/volume_flow.py b/unitsnet_py/units/volume_flow.py index 9603259..96ab1c2 100644 --- a/unitsnet_py/units/volume_flow.py +++ b/unitsnet_py/units/volume_flow.py @@ -387,9 +387,30 @@ class VolumeFlowUnits(Enum): class VolumeFlowDto: + """ + A DTO representation of a VolumeFlow + + Attributes: + value (float): The value of the VolumeFlow. + unit (VolumeFlowUnits): The specific unit that the VolumeFlow value is representing. + """ + def __init__(self, value: float, unit: VolumeFlowUnits): + """ + Create a new DTO representation of a VolumeFlow + + Parameters: + value (float): The value of the VolumeFlow. + unit (VolumeFlowUnits): The specific unit that the VolumeFlow value is representing. + """ self.value: float = value + """ + The value of the VolumeFlow + """ self.unit: VolumeFlowUnits = unit + """ + The specific unit that the VolumeFlow value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -569,10 +590,26 @@ def convert(self, unit: VolumeFlowUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VolumeFlowUnits = VolumeFlowUnits.CubicMeterPerSecond) -> VolumeFlowDto: + """ + Get a new instance of VolumeFlow DTO representing the current unit. + + :param hold_in_unit: The specific VolumeFlow unit to store the VolumeFlow value in the DTO representation. + :type hold_in_unit: VolumeFlowUnits + :return: A new instance of VolumeFlowDto. + :rtype: VolumeFlowDto + """ return VolumeFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(volume_flow_dto: VolumeFlowDto): + """ + Obtain a new instance of VolumeFlow from a DTO unit object. + + :param volume_flow_dto: The VolumeFlow DTO representation. + :type volume_flow_dto: VolumeFlowDto + :return: A new instance of VolumeFlow. + :rtype: VolumeFlow + """ return VolumeFlow(volume_flow_dto.value, volume_flow_dto.unit) def __convert_from_base(self, from_unit: VolumeFlowUnits) -> float: diff --git a/unitsnet_py/units/volume_flow_per_area.py b/unitsnet_py/units/volume_flow_per_area.py index 1a7c11e..d5f6a8f 100644 --- a/unitsnet_py/units/volume_flow_per_area.py +++ b/unitsnet_py/units/volume_flow_per_area.py @@ -22,9 +22,30 @@ class VolumeFlowPerAreaUnits(Enum): class VolumeFlowPerAreaDto: + """ + A DTO representation of a VolumeFlowPerArea + + Attributes: + value (float): The value of the VolumeFlowPerArea. + unit (VolumeFlowPerAreaUnits): The specific unit that the VolumeFlowPerArea value is representing. + """ + def __init__(self, value: float, unit: VolumeFlowPerAreaUnits): + """ + Create a new DTO representation of a VolumeFlowPerArea + + Parameters: + value (float): The value of the VolumeFlowPerArea. + unit (VolumeFlowPerAreaUnits): The specific unit that the VolumeFlowPerArea value is representing. + """ self.value: float = value + """ + The value of the VolumeFlowPerArea + """ self.unit: VolumeFlowPerAreaUnits = unit + """ + The specific unit that the VolumeFlowPerArea value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -58,10 +79,26 @@ def convert(self, unit: VolumeFlowPerAreaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VolumeFlowPerAreaUnits = VolumeFlowPerAreaUnits.CubicMeterPerSecondPerSquareMeter) -> VolumeFlowPerAreaDto: + """ + Get a new instance of VolumeFlowPerArea DTO representing the current unit. + + :param hold_in_unit: The specific VolumeFlowPerArea unit to store the VolumeFlowPerArea value in the DTO representation. + :type hold_in_unit: VolumeFlowPerAreaUnits + :return: A new instance of VolumeFlowPerAreaDto. + :rtype: VolumeFlowPerAreaDto + """ return VolumeFlowPerAreaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(volume_flow_per_area_dto: VolumeFlowPerAreaDto): + """ + Obtain a new instance of VolumeFlowPerArea from a DTO unit object. + + :param volume_flow_per_area_dto: The VolumeFlowPerArea DTO representation. + :type volume_flow_per_area_dto: VolumeFlowPerAreaDto + :return: A new instance of VolumeFlowPerArea. + :rtype: VolumeFlowPerArea + """ return VolumeFlowPerArea(volume_flow_per_area_dto.value, volume_flow_per_area_dto.unit) def __convert_from_base(self, from_unit: VolumeFlowPerAreaUnits) -> float: diff --git a/unitsnet_py/units/volume_per_length.py b/unitsnet_py/units/volume_per_length.py index 273a9a2..47ea283 100644 --- a/unitsnet_py/units/volume_per_length.py +++ b/unitsnet_py/units/volume_per_length.py @@ -57,9 +57,30 @@ class VolumePerLengthUnits(Enum): class VolumePerLengthDto: + """ + A DTO representation of a VolumePerLength + + Attributes: + value (float): The value of the VolumePerLength. + unit (VolumePerLengthUnits): The specific unit that the VolumePerLength value is representing. + """ + def __init__(self, value: float, unit: VolumePerLengthUnits): + """ + Create a new DTO representation of a VolumePerLength + + Parameters: + value (float): The value of the VolumePerLength. + unit (VolumePerLengthUnits): The specific unit that the VolumePerLength value is representing. + """ self.value: float = value + """ + The value of the VolumePerLength + """ self.unit: VolumePerLengthUnits = unit + """ + The specific unit that the VolumePerLength value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: VolumePerLengthUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VolumePerLengthUnits = VolumePerLengthUnits.CubicMeterPerMeter) -> VolumePerLengthDto: + """ + Get a new instance of VolumePerLength DTO representing the current unit. + + :param hold_in_unit: The specific VolumePerLength unit to store the VolumePerLength value in the DTO representation. + :type hold_in_unit: VolumePerLengthUnits + :return: A new instance of VolumePerLengthDto. + :rtype: VolumePerLengthDto + """ return VolumePerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(volume_per_length_dto: VolumePerLengthDto): + """ + Obtain a new instance of VolumePerLength from a DTO unit object. + + :param volume_per_length_dto: The VolumePerLength DTO representation. + :type volume_per_length_dto: VolumePerLengthDto + :return: A new instance of VolumePerLength. + :rtype: VolumePerLength + """ return VolumePerLength(volume_per_length_dto.value, volume_per_length_dto.unit) def __convert_from_base(self, from_unit: VolumePerLengthUnits) -> float: diff --git a/unitsnet_py/units/volumetric_heat_capacity.py b/unitsnet_py/units/volumetric_heat_capacity.py index 8500908..f789ade 100644 --- a/unitsnet_py/units/volumetric_heat_capacity.py +++ b/unitsnet_py/units/volumetric_heat_capacity.py @@ -57,9 +57,30 @@ class VolumetricHeatCapacityUnits(Enum): class VolumetricHeatCapacityDto: + """ + A DTO representation of a VolumetricHeatCapacity + + Attributes: + value (float): The value of the VolumetricHeatCapacity. + unit (VolumetricHeatCapacityUnits): The specific unit that the VolumetricHeatCapacity value is representing. + """ + def __init__(self, value: float, unit: VolumetricHeatCapacityUnits): + """ + Create a new DTO representation of a VolumetricHeatCapacity + + Parameters: + value (float): The value of the VolumetricHeatCapacity. + unit (VolumetricHeatCapacityUnits): The specific unit that the VolumetricHeatCapacity value is representing. + """ self.value: float = value + """ + The value of the VolumetricHeatCapacity + """ self.unit: VolumetricHeatCapacityUnits = unit + """ + The specific unit that the VolumetricHeatCapacity value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -107,10 +128,26 @@ def convert(self, unit: VolumetricHeatCapacityUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: VolumetricHeatCapacityUnits = VolumetricHeatCapacityUnits.JoulePerCubicMeterKelvin) -> VolumetricHeatCapacityDto: + """ + Get a new instance of VolumetricHeatCapacity DTO representing the current unit. + + :param hold_in_unit: The specific VolumetricHeatCapacity unit to store the VolumetricHeatCapacity value in the DTO representation. + :type hold_in_unit: VolumetricHeatCapacityUnits + :return: A new instance of VolumetricHeatCapacityDto. + :rtype: VolumetricHeatCapacityDto + """ return VolumetricHeatCapacityDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(volumetric_heat_capacity_dto: VolumetricHeatCapacityDto): + """ + Obtain a new instance of VolumetricHeatCapacity from a DTO unit object. + + :param volumetric_heat_capacity_dto: The VolumetricHeatCapacity DTO representation. + :type volumetric_heat_capacity_dto: VolumetricHeatCapacityDto + :return: A new instance of VolumetricHeatCapacity. + :rtype: VolumetricHeatCapacity + """ return VolumetricHeatCapacity(volumetric_heat_capacity_dto.value, volumetric_heat_capacity_dto.unit) def __convert_from_base(self, from_unit: VolumetricHeatCapacityUnits) -> float: diff --git a/unitsnet_py/units/warping_moment_of_inertia.py b/unitsnet_py/units/warping_moment_of_inertia.py index b807b4b..50c5f8a 100644 --- a/unitsnet_py/units/warping_moment_of_inertia.py +++ b/unitsnet_py/units/warping_moment_of_inertia.py @@ -42,9 +42,30 @@ class WarpingMomentOfInertiaUnits(Enum): class WarpingMomentOfInertiaDto: + """ + A DTO representation of a WarpingMomentOfInertia + + Attributes: + value (float): The value of the WarpingMomentOfInertia. + unit (WarpingMomentOfInertiaUnits): The specific unit that the WarpingMomentOfInertia value is representing. + """ + def __init__(self, value: float, unit: WarpingMomentOfInertiaUnits): + """ + Create a new DTO representation of a WarpingMomentOfInertia + + Parameters: + value (float): The value of the WarpingMomentOfInertia. + unit (WarpingMomentOfInertiaUnits): The specific unit that the WarpingMomentOfInertia value is representing. + """ self.value: float = value + """ + The value of the WarpingMomentOfInertia + """ self.unit: WarpingMomentOfInertiaUnits = unit + """ + The specific unit that the WarpingMomentOfInertia value is representing + """ def to_json(self): return {"value": self.value, "unit": self.unit.value} @@ -86,10 +107,26 @@ def convert(self, unit: WarpingMomentOfInertiaUnits) -> float: return self.__convert_from_base(unit) def to_dto(self, hold_in_unit: WarpingMomentOfInertiaUnits = WarpingMomentOfInertiaUnits.MeterToTheSixth) -> WarpingMomentOfInertiaDto: + """ + Get a new instance of WarpingMomentOfInertia DTO representing the current unit. + + :param hold_in_unit: The specific WarpingMomentOfInertia unit to store the WarpingMomentOfInertia value in the DTO representation. + :type hold_in_unit: WarpingMomentOfInertiaUnits + :return: A new instance of WarpingMomentOfInertiaDto. + :rtype: WarpingMomentOfInertiaDto + """ return WarpingMomentOfInertiaDto(value=self.convert(hold_in_unit), unit=hold_in_unit) @staticmethod def from_dto(warping_moment_of_inertia_dto: WarpingMomentOfInertiaDto): + """ + Obtain a new instance of WarpingMomentOfInertia from a DTO unit object. + + :param warping_moment_of_inertia_dto: The WarpingMomentOfInertia DTO representation. + :type warping_moment_of_inertia_dto: WarpingMomentOfInertiaDto + :return: A new instance of WarpingMomentOfInertia. + :rtype: WarpingMomentOfInertia + """ return WarpingMomentOfInertia(warping_moment_of_inertia_dto.value, warping_moment_of_inertia_dto.unit) def __convert_from_base(self, from_unit: WarpingMomentOfInertiaUnits) -> float: