Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareengineerprogrammer committed Jun 19, 2024
1 parent a6de4c1 commit 28df988
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 17 deletions.
10 changes: 0 additions & 10 deletions src/geophires_x/Parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class Parameter(HasQuantity):
# set to PreferredUnits assuming that the current units are the preferred units
# - they will only change if the read function reads a different unit associated with a parameter
CurrentUnits: Enum = PreferredUnits
#UnitsMatch: bool = True

@property
def UnitsMatch(self) -> bool:
Expand Down Expand Up @@ -281,7 +280,6 @@ def ReadParameter(ParameterReadIn: ParameterEntry, ParamToModify, model):
else:
# The value came in without any units, so it must be using the default PreferredUnits
ParamToModify.CurrentUnits = ParamToModify.PreferredUnits
# ParamToModify.UnitsMatch = True

def default_parameter_value_message(new_val: Any, param_to_modify_name: str, default_value: Any) -> str:
return (
Expand Down Expand Up @@ -424,7 +422,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:
# user has provided a currency that is the currency expected, so just strip off the currency
if prefType == currType:
strUnit = str(val)
# ParamToModify.UnitsMatch = True
ParamToModify.CurrentUnits = currType
return strUnit

Expand Down Expand Up @@ -480,7 +477,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:

val = float(val) * Factor
strUnit = str(val)
# ParamToModify.UnitsMatch = True
ParamToModify.CurrentUnits = currType
return strUnit

Expand All @@ -504,7 +500,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:

New_val = (conv_rate * float(val)) * Factor
strUnit = str(New_val)
# ParamToModify.UnitsMatch = False
ParamToModify.CurrentUnits = parts[1]

if len(prefSuff) > 0:
Expand Down Expand Up @@ -572,7 +567,6 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str:
if new_val_units_lookup is not None and new_val_units_lookup[0] is not None:
ParamToModify.CurrentUnits = new_val_units_lookup[0]

# ParamToModify.UnitsMatch = False
else:
# if we come here, we must have a unit declared, but the unit must be the same as the preferred unit,
# so we need to just get rid of the extra text after the space
Expand Down Expand Up @@ -673,7 +667,6 @@ def parameter_with_units_converted_back_to_preferred_units(param: Parameter, mod
# this is true, then we just have a conversion between KUSD and USD, MUSD to KUSD, MUER to EUR, etc.,
# so just do the simple factor conversion
param_with_units_converted_back.value = param.value * Factor
# param_with_units_converted_back.UnitsMatch = True
param_with_units_converted_back.CurrentUnits = currType
return param_with_units_converted_back

Expand All @@ -699,7 +692,6 @@ def parameter_with_units_converted_back_to_preferred_units(param: Parameter, mod
raise RuntimeError(msg, ex)

param_with_units_converted_back.value = (conv_rate * float(param.value)) / prefFactor
# param_with_units_converted_back.UnitsMatch = False
return param_with_units_converted_back

else:
Expand Down Expand Up @@ -1029,7 +1021,6 @@ def ConvertOutputUnits(oparam: OutputParameter, newUnit: Units, model):
# so just do the simple factor conversion and exit
oparam.value = oparam.value * Factor
oparam.CurrentUnits = DefUnit
# oparam.UnitsMatch = False
return

# start the currency conversion process
Expand Down Expand Up @@ -1086,5 +1077,4 @@ def ConvertOutputUnits(oparam: OutputParameter, newUnit: Units, model):

oparam.value = Factor * conv_rate * float(oparam.value)
oparam.CurrentUnits = DefUnit
# oparam.UnitsMatch = False
model.logger.info(f'Complete {str(__name__)}: {sys._getframe().f_code.co_name}')
1 change: 0 additions & 1 deletion src/geophires_x/Reservoir.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ def read_parameters(self, model: Model) -> None:
# FIXME TODO only convert if current units are km
ParameterToModify.value = ParameterToModify.value * 1000
ParameterToModify.CurrentUnits = LengthUnit.METERS
# ParameterToModify.UnitsMatch = False

elif ParameterToModify.Name == "Reservoir Volume Option":
if ParameterReadIn.sValue == '1':
Expand Down
2 changes: 0 additions & 2 deletions src/geophires_x/SUTRAWellBores.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,9 @@ def Calculate(self, model: Model) -> None:
if self.injwelldiam.value > 2.0:
self.injwelldiam.value = self.injwelldiam.value * 0.0254
self.injwelldiam.CurrentUnits = LengthUnit.METERS
# self.injwelldiam.UnitsMatch = False
if self.prodwelldiam.value > 2.0:
self.prodwelldiam.value = self.prodwelldiam.value * 0.0254
self.prodwelldiam.CurrentUnits = LengthUnit.METERS
# self.prodwelldiam.UnitsMatch = False

# get wellbore flow rates from SUTRA data
prodwellflowrates = np.append(
Expand Down
2 changes: 0 additions & 2 deletions src/geophires_x/WellBores.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,11 +1264,9 @@ def Calculate(self, model: Model) -> None:
if self.injwelldiam.value > 2.0:
self.injwelldiam.value = self.injwelldiam.value * 0.0254
self.injwelldiam.CurrentUnits = LengthUnit.METERS
# self.injwelldiam.UnitsMatch = False
if self.prodwelldiam.value > 2.0:
self.prodwelldiam.value = self.prodwelldiam.value * 0.0254
self.prodwelldiam.CurrentUnits = LengthUnit.METERS
# self.prodwelldiam.UnitsMatch = False

# calculate wellbore temperature drop
self.ProdTempDrop.value = self.tempdropprod.value # if not Ramey, hard code a user-supplied temperature drop.
Expand Down
1 change: 0 additions & 1 deletion src/hip_ra/HIP_RA.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ def read_parameters(self) -> None:
self.OutputParameterDict[key.replace('Units:', '')].CurrentUnits = LookupUnits(
self.InputParameters[key].sValue
)[0]
# self.OutputParameterDict[key.replace('Units:', '')].UnitsMatch = False

self.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}')

Expand Down
1 change: 0 additions & 1 deletion src/hip_ra_x/hip_ra_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ def read_parameters(self) -> None:
self.OutputParameterDict[key.replace('Units:', '')].CurrentUnits = LookupUnits(
self.InputParameters[key].sValue
)[0]
# self.OutputParameterDict[key.replace('Units:', '')].UnitsMatch = False

self.logger.info(f'complete {__class__.__name__!s}: {__name__}')

Expand Down

0 comments on commit 28df988

Please sign in to comment.