@@ -2166,24 +2166,27 @@ def read_parameters(self, model: Model) -> None:
2166
2166
model .logger .info (f'complete { __class__ !s} : { sys ._getframe ().f_code .co_name } ' )
2167
2167
2168
2168
def sync_interest_rate (self , model ):
2169
+ def discount_rate_display () -> str :
2170
+ return str (self .discountrate .quantity ()).replace (' dimensionless' , '' )
2171
+
2169
2172
if self .discountrate .Provided ^ self .FixedInternalRate .Provided :
2170
2173
if self .discountrate .Provided :
2171
2174
self .FixedInternalRate .value = self .discountrate .quantity ().to (
2172
2175
convertible_unit (self .FixedInternalRate .CurrentUnits )).magnitude
2173
2176
model .logger .info (f'Set { self .FixedInternalRate .Name } to { self .FixedInternalRate .quantity ()} '
2174
- f'because { self .discountrate .Name } was provided ({ self . discountrate . value } )' )
2177
+ f'because { self .discountrate .Name } was provided ({ discount_rate_display () } )' )
2175
2178
else :
2176
2179
self .discountrate .value = self .FixedInternalRate .quantity ().to (
2177
2180
convertible_unit (self .discountrate .CurrentUnits )).magnitude
2178
2181
model .logger .info (
2179
- f'Set { self .discountrate .Name } to { self . discountrate . value } because '
2182
+ f'Set { self .discountrate .Name } to { discount_rate_display () } because '
2180
2183
f'{ self .FixedInternalRate .Name } was provided ({ self .FixedInternalRate .quantity ()} )' )
2181
2184
2182
2185
if self .discountrate .Provided and self .FixedInternalRate .Provided \
2183
2186
and self .discountrate .quantity ().to (convertible_unit (self .FixedInternalRate .CurrentUnits )).magnitude \
2184
2187
!= self .FixedInternalRate .value :
2185
2188
model .logger .warning (f'{ self .discountrate .Name } and { self .FixedInternalRate .Name } provided with different '
2186
- f'values ({ self . discountrate . value } ; { self .FixedInternalRate .quantity ()} ). '
2189
+ f'values ({ discount_rate_display () } ; { self .FixedInternalRate .quantity ()} ). '
2187
2190
f'It is recommended to only provide one of these values.' )
2188
2191
2189
2192
self .interest_rate .value = self .discountrate .quantity ().to (convertible_unit (self .interest_rate .CurrentUnits )).magnitude
0 commit comments