Skip to content

Commit

Permalink
* summary: Ruff fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bje- committed Jun 29, 2024
1 parent 5e20373 commit 0ad1ed4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions summary
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ patterns = {
'diesel.*[kMG]W$': lambda f: addcap("diesel", f),
'(DR|demand, f).*[kMG]W$': lambda f: addcap("DR", f),
'HydrogenGT.*[kMG]W$': lambda f: addcap("HydrogenGT", f),
'[kMG]W$': warn
'[kMG]W$': warn,
}

for line in sys.stdin: # noqa: C901
for line in sys.stdin:
fields = awklite.Fields(line.strip().split())
nf = len(fields)

Expand Down Expand Up @@ -156,9 +156,8 @@ for line in sys.stdin: # noqa: C901
av.penalty = float(fields[2])

if search('Constraints violated', line):
line = line.replace('Constraints violated: ', '').strip('\n')
line = line.replace(' ', ',')
av.constraints = line
newline = line.replace('Constraints violated: ', '').strip('\n')
av.constraints = newline.replace(' ', ',')

if search('Timesteps:', line):
av.timesteps = int(fields[2])
Expand All @@ -181,7 +180,7 @@ for line in sys.stdin: # noqa: C901
if av.CO2 > 0:
print(f"# emissions {av.CO2:.2f} Mt")
if av.unserved:
print(f"# unserved {str(av.unserved)}")
print(f"# unserved {av.unserved}")
print(f"# score {av.cost} $/MWh")
if av.penalty > 0:
print(f"# penalty {av.penalty} $/MWh")
Expand Down

0 comments on commit 0ad1ed4

Please sign in to comment.