File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 13
13
from property_utils .units .descriptors import UnitDescriptor
14
14
from property_utils .exceptions .units .converter_types import UnitConversionError
15
15
from property_utils .units .units import (
16
+ NonDimensionalUnit ,
16
17
RelativeTemperatureUnit ,
17
18
AbsoluteTemperatureUnit ,
18
19
LengthUnit ,
@@ -153,6 +154,12 @@ def convert(
153
154
return value * cls .get_factor (from_descriptor , to_descriptor )
154
155
155
156
157
+ @register_converter (NonDimensionalUnit )
158
+ class NonDimensionalUnitConverter (AbsoluteUnitConverter ):
159
+ reference_unit = NonDimensionalUnit .NON_DIMENSIONAL
160
+ conversion_map = {NonDimensionalUnit .NON_DIMENSIONAL : 1 }
161
+
162
+
156
163
@register_converter (LengthUnit )
157
164
class LengthUnitConverter (AbsoluteUnitConverter ):
158
165
"""
You can’t perform that action at this time.
0 commit comments