Skip to content

Commit

Permalink
Fix check errors (pre-commit) try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolm-dsider committed Mar 8, 2024
1 parent 20dc73c commit afd4f21
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 83 deletions.
6 changes: 3 additions & 3 deletions src/geophires_x_client/geophires_x_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ def __init__(self, output_file_path, logger_name='root'):

try:
self.result['POWER GENERATION PROFILE'] = self._get_power_generation_profile()
self.result[
'HEAT AND/OR ELECTRICITY EXTRACTION AND GENERATION PROFILE'
] = self._get_heat_electricity_extraction_generation_profile()
self.result['HEAT AND/OR ELECTRICITY EXTRACTION AND GENERATION PROFILE'] = (
self._get_heat_electricity_extraction_generation_profile()
)
except Exception as e:
# FIXME
self._logger.error(f'Failed to parse power and/or extraction profiles: {e}')
Expand Down
6 changes: 3 additions & 3 deletions src/hip_ra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def _parse_fields(self):
matches = re.findall(pattern, text)

result = {
key.strip(): {'value': float(value), 'unit': unit.strip()}
if unit
else {'value': float(value), 'unit': None}
key.strip(): (
{'value': float(value), 'unit': unit.strip()} if unit else {'value': float(value), 'unit': None}
)
for key, value, unit in matches
}

Expand Down
154 changes: 77 additions & 77 deletions src/hip_ra_x/hip_ra_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,29 +419,29 @@ def parameter_dict_entry(param: Parameter) -> Parameter:
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
)
self.wellhead_heat_recovery_rock = self.OutputParameterDict[
self.wellhead_heat_recovery_rock.Name
] = OutputParameter(
Name='Wellhead Heat (rock)',
UnitType=Units.HEAT,
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
self.wellhead_heat_recovery_rock = self.OutputParameterDict[self.wellhead_heat_recovery_rock.Name] = (
OutputParameter(
Name='Wellhead Heat (rock)',
UnitType=Units.HEAT,
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
)
)
self.wellhead_heat_recovery_fluid = self.OutputParameterDict[
self.wellhead_heat_recovery_fluid.Name
] = OutputParameter(
Name='Wellhead Heat (fluid)',
UnitType=Units.HEAT,
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
self.wellhead_heat_recovery_fluid = self.OutputParameterDict[self.wellhead_heat_recovery_fluid.Name] = (
OutputParameter(
Name='Wellhead Heat (fluid)',
UnitType=Units.HEAT,
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
)
)
self.reservoir_recovery_factor = self.OutputParameterDict[
self.reservoir_recovery_factor.Name
] = OutputParameter(
Name='Recovery Factor (reservoir)',
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.PERCENT,
CurrentUnits=PercentUnit.PERCENT,
self.reservoir_recovery_factor = self.OutputParameterDict[self.reservoir_recovery_factor.Name] = (
OutputParameter(
Name='Recovery Factor (reservoir)',
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.PERCENT,
CurrentUnits=PercentUnit.PERCENT,
)
)
self.recovery_factor_rock = self.OutputParameterDict[self.recovery_factor_rock.Name] = OutputParameter(
Name='Recovery Factor (rock)',
Expand Down Expand Up @@ -473,13 +473,13 @@ def parameter_dict_entry(param: Parameter) -> Parameter:
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
)
self.reservoir_producible_heat = self.OutputParameterDict[
self.reservoir_producible_heat.Name
] = OutputParameter(
Name='Producible Heat (reservoir)',
UnitType=Units.HEAT,
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
self.reservoir_producible_heat = self.OutputParameterDict[self.reservoir_producible_heat.Name] = (
OutputParameter(
Name='Producible Heat (reservoir)',
UnitType=Units.HEAT,
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
)
)
self.producible_heat_rock = self.OutputParameterDict[self.producible_heat_rock.Name] = OutputParameter(
Name='Producible Heat (rock)',
Expand All @@ -493,37 +493,37 @@ def parameter_dict_entry(param: Parameter) -> Parameter:
PreferredUnits=HeatUnit.KJ,
CurrentUnits=HeatUnit.KJ,
)
self.reservoir_producible_electricity = self.OutputParameterDict[
self.reservoir_producible_electricity.Name
] = OutputParameter(
Name='Producible Electricity (reservoir)',
UnitType=Units.POWER,
PreferredUnits=PowerUnit.MW,
CurrentUnits=PowerUnit.MW,
self.reservoir_producible_electricity = self.OutputParameterDict[self.reservoir_producible_electricity.Name] = (
OutputParameter(
Name='Producible Electricity (reservoir)',
UnitType=Units.POWER,
PreferredUnits=PowerUnit.MW,
CurrentUnits=PowerUnit.MW,
)
)
self.producible_electricity_rock = self.OutputParameterDict[
self.producible_electricity_rock.Name
] = OutputParameter(
Name='Producible Electricity (rock)',
UnitType=Units.POWER,
PreferredUnits=PowerUnit.MW,
CurrentUnits=PowerUnit.MW,
self.producible_electricity_rock = self.OutputParameterDict[self.producible_electricity_rock.Name] = (
OutputParameter(
Name='Producible Electricity (rock)',
UnitType=Units.POWER,
PreferredUnits=PowerUnit.MW,
CurrentUnits=PowerUnit.MW,
)
)
self.producible_electricity_fluid = self.OutputParameterDict[
self.producible_electricity_fluid.Name
] = OutputParameter(
Name='Producible Electricity (fluid)',
UnitType=Units.POWER,
PreferredUnits=PowerUnit.MW,
CurrentUnits=PowerUnit.MW,
self.producible_electricity_fluid = self.OutputParameterDict[self.producible_electricity_fluid.Name] = (
OutputParameter(
Name='Producible Electricity (fluid)',
UnitType=Units.POWER,
PreferredUnits=PowerUnit.MW,
CurrentUnits=PowerUnit.MW,
)
)
self.producible_heat_per_unit_area = self.OutputParameterDict[
self.producible_heat_per_unit_area.Name
] = OutputParameter(
Name='Producible Heat/Unit Area (reservoir)',
UnitType=Units.HEATPERUNITAREA,
PreferredUnits=HeatPerUnitAreaUnit.KJPERSQKM,
CurrentUnits=HeatPerUnitAreaUnit.KJPERSQKM,
self.producible_heat_per_unit_area = self.OutputParameterDict[self.producible_heat_per_unit_area.Name] = (
OutputParameter(
Name='Producible Heat/Unit Area (reservoir)',
UnitType=Units.HEATPERUNITAREA,
PreferredUnits=HeatPerUnitAreaUnit.KJPERSQKM,
CurrentUnits=HeatPerUnitAreaUnit.KJPERSQKM,
)
)
self.heat_per_unit_area_rock = self.OutputParameterDict[self.heat_per_unit_area_rock.Name] = OutputParameter(
Name='Producible Heat/Unit Area (rock)',
Expand All @@ -537,13 +537,13 @@ def parameter_dict_entry(param: Parameter) -> Parameter:
PreferredUnits=HeatPerUnitAreaUnit.KJPERSQKM,
CurrentUnits=HeatPerUnitAreaUnit.KJPERSQKM,
)
self.heat_per_unit_volume_reservoir = self.OutputParameterDict[
self.heat_per_unit_volume_reservoir.Name
] = OutputParameter(
Name='Producible Heat/Unit Volume (reservoir)',
UnitType=Units.HEATPERUNITVOLUME,
PreferredUnits=HeatPerUnitVolumeUnit.KJPERCUBICKM,
CurrentUnits=HeatPerUnitVolumeUnit.KJPERCUBICKM,
self.heat_per_unit_volume_reservoir = self.OutputParameterDict[self.heat_per_unit_volume_reservoir.Name] = (
OutputParameter(
Name='Producible Heat/Unit Volume (reservoir)',
UnitType=Units.HEATPERUNITVOLUME,
PreferredUnits=HeatPerUnitVolumeUnit.KJPERCUBICKM,
CurrentUnits=HeatPerUnitVolumeUnit.KJPERCUBICKM,
)
)
self.producible_electricity_per_unit_area = self.OutputParameterDict[
self.producible_electricity_per_unit_area.Name
Expand All @@ -553,21 +553,21 @@ def parameter_dict_entry(param: Parameter) -> Parameter:
PreferredUnits=PowerPerUnitAreaUnit.MWPERSQKM,
CurrentUnits=PowerPerUnitAreaUnit.MWPERSQKM,
)
self.electricity_per_unit_area_rock = self.OutputParameterDict[
self.electricity_per_unit_area_rock.Name
] = OutputParameter(
Name='Producible Electricity/Unit Area (rock)',
UnitType=Units.POWERPERUNITAREA,
PreferredUnits=PowerPerUnitAreaUnit.MWPERSQKM,
CurrentUnits=PowerPerUnitAreaUnit.MWPERSQKM,
self.electricity_per_unit_area_rock = self.OutputParameterDict[self.electricity_per_unit_area_rock.Name] = (
OutputParameter(
Name='Producible Electricity/Unit Area (rock)',
UnitType=Units.POWERPERUNITAREA,
PreferredUnits=PowerPerUnitAreaUnit.MWPERSQKM,
CurrentUnits=PowerPerUnitAreaUnit.MWPERSQKM,
)
)
self.electricity_per_unit_area_fluid = self.OutputParameterDict[
self.electricity_per_unit_area_fluid.Name
] = OutputParameter(
Name='Producible Electricity/Unit Area (fluid)',
UnitType=Units.POWERPERUNITAREA,
PreferredUnits=PowerPerUnitAreaUnit.MWPERSQKM,
CurrentUnits=PowerPerUnitAreaUnit.MWPERSQKM,
self.electricity_per_unit_area_fluid = self.OutputParameterDict[self.electricity_per_unit_area_fluid.Name] = (
OutputParameter(
Name='Producible Electricity/Unit Area (fluid)',
UnitType=Units.POWERPERUNITAREA,
PreferredUnits=PowerPerUnitAreaUnit.MWPERSQKM,
CurrentUnits=PowerPerUnitAreaUnit.MWPERSQKM,
)
)
self.electricity_per_unit_volume_reservoir = self.OutputParameterDict[
self.electricity_per_unit_volume_reservoir.Name
Expand Down

0 comments on commit afd4f21

Please sign in to comment.