@@ -112,7 +112,6 @@ class Parameter(HasQuantity):
112
112
# set to PreferredUnits assuming that the current units are the preferred units
113
113
# - they will only change if the read function reads a different unit associated with a parameter
114
114
CurrentUnits : Enum = PreferredUnits
115
- #UnitsMatch: bool = True
116
115
117
116
@property
118
117
def UnitsMatch (self ) -> bool :
@@ -281,7 +280,6 @@ def ReadParameter(ParameterReadIn: ParameterEntry, ParamToModify, model):
281
280
else :
282
281
# The value came in without any units, so it must be using the default PreferredUnits
283
282
ParamToModify .CurrentUnits = ParamToModify .PreferredUnits
284
- # ParamToModify.UnitsMatch = True
285
283
286
284
def default_parameter_value_message (new_val : Any , param_to_modify_name : str , default_value : Any ) -> str :
287
285
return (
@@ -424,7 +422,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:
424
422
# user has provided a currency that is the currency expected, so just strip off the currency
425
423
if prefType == currType :
426
424
strUnit = str (val )
427
- # ParamToModify.UnitsMatch = True
428
425
ParamToModify .CurrentUnits = currType
429
426
return strUnit
430
427
@@ -480,7 +477,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:
480
477
481
478
val = float (val ) * Factor
482
479
strUnit = str (val )
483
- # ParamToModify.UnitsMatch = True
484
480
ParamToModify .CurrentUnits = currType
485
481
return strUnit
486
482
@@ -504,7 +500,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:
504
500
505
501
New_val = (conv_rate * float (val )) * Factor
506
502
strUnit = str (New_val )
507
- # ParamToModify.UnitsMatch = False
508
503
ParamToModify .CurrentUnits = parts [1 ]
509
504
510
505
if len (prefSuff ) > 0 :
@@ -572,7 +567,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:
572
567
if new_val_units_lookup is not None and new_val_units_lookup [0 ] is not None :
573
568
ParamToModify .CurrentUnits = new_val_units_lookup [0 ]
574
569
575
- # ParamToModify.UnitsMatch = False
576
570
else :
577
571
# if we come here, we must have a unit declared, but the unit must be the same as the preferred unit,
578
572
# so we need to just get rid of the extra text after the space
@@ -673,7 +667,6 @@ def parameter_with_units_converted_back_to_preferred_units(param: Parameter, mod
673
667
# this is true, then we just have a conversion between KUSD and USD, MUSD to KUSD, MUER to EUR, etc.,
674
668
# so just do the simple factor conversion
675
669
param_with_units_converted_back .value = param .value * Factor
676
- # param_with_units_converted_back.UnitsMatch = True
677
670
param_with_units_converted_back .CurrentUnits = currType
678
671
return param_with_units_converted_back
679
672
@@ -699,7 +692,6 @@ def parameter_with_units_converted_back_to_preferred_units(param: Parameter, mod
699
692
raise RuntimeError (msg , ex )
700
693
701
694
param_with_units_converted_back .value = (conv_rate * float (param .value )) / prefFactor
702
- # param_with_units_converted_back.UnitsMatch = False
703
695
return param_with_units_converted_back
704
696
705
697
else :
@@ -1029,7 +1021,6 @@ def ConvertOutputUnits(oparam: OutputParameter, newUnit: Units, model):
1029
1021
# so just do the simple factor conversion and exit
1030
1022
oparam .value = oparam .value * Factor
1031
1023
oparam .CurrentUnits = DefUnit
1032
- # oparam.UnitsMatch = False
1033
1024
return
1034
1025
1035
1026
# start the currency conversion process
@@ -1086,5 +1077,4 @@ def ConvertOutputUnits(oparam: OutputParameter, newUnit: Units, model):
1086
1077
1087
1078
oparam .value = Factor * conv_rate * float (oparam .value )
1088
1079
oparam .CurrentUnits = DefUnit
1089
- # oparam.UnitsMatch = False
1090
1080
model .logger .info (f'Complete { str (__name__ )} : { sys ._getframe ().f_code .co_name } ' )
0 commit comments