Skip to content

Commit 796f013

Browse files
Merge pull request NREL#150 from malcolm-dsider/main
Update to allow HTML output for HIP-RA-X
2 parents 05d15c2 + 9b5f2e8 commit 796f013

File tree

5 files changed

+194
-97
lines changed

5 files changed

+194
-97
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg|src/geophires_x)(/|$)'
66
# Note the order is intentional to avoid multiple passes of the hooks
77
repos:
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.1.3
9+
rev: v0.3.1
1010
hooks:
1111
- id: ruff
1212
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
1313
- repo: https://github.com/psf/black
14-
rev: 23.10.1
14+
rev: 24.2.0
1515
hooks:
1616
- id: black
1717
- repo: https://github.com/pre-commit/pre-commit-hooks

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def read(*names, **kwargs):
7777
'scipy',
7878
'iapws',
7979
'coolprop',
80+
'rich',
8081
],
8182
extras_require={
8283
# eg:

src/geophires_x_client/geophires_x_result.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ def __init__(self, output_file_path, logger_name=None):
310310

311311
try:
312312
self.result['POWER GENERATION PROFILE'] = self._get_power_generation_profile()
313-
self.result[
314-
'HEAT AND/OR ELECTRICITY EXTRACTION AND GENERATION PROFILE'
315-
] = self._get_heat_electricity_extraction_generation_profile()
313+
self.result['HEAT AND/OR ELECTRICITY EXTRACTION AND GENERATION PROFILE'] = (
314+
self._get_heat_electricity_extraction_generation_profile()
315+
)
316316
except Exception as e:
317317
# FIXME
318318
self._logger.error(f'Failed to parse power and/or extraction profiles: {e}')

src/hip_ra/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def _parse_fields(self):
3737
matches = re.findall(pattern, text)
3838

3939
result = {
40-
key.strip(): {'value': float(value), 'unit': unit.strip()}
41-
if unit
42-
else {'value': float(value), 'unit': None}
40+
key.strip(): (
41+
{'value': float(value), 'unit': unit.strip()} if unit else {'value': float(value), 'unit': None}
42+
)
4343
for key, value, unit in matches
4444
}
4545

0 commit comments

Comments
 (0)