Skip to content

Commit

Permalink
Reformat etrago/tools/calc_results
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Mar 27, 2023
1 parent 37849b3 commit 36f2735
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions etrago/tools/calc_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@

if "READTHEDOCS" not in os.environ:
import logging
import time

import numpy as np
import pandas as pd

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -386,7 +384,7 @@ def system_costs_germany(self):
.sum()
.sum()
)
if not c.name in [
if c.name not in [
"Bus",
"Load",
"LineType",
Expand Down Expand Up @@ -629,6 +627,7 @@ def dc_export_per_country(self):

return result


def calc_etrago_results(self):
"""Function that calculates main results of grid optimization
and adds them to Etrago object.
Expand Down Expand Up @@ -716,7 +715,6 @@ def calc_etrago_results(self):
network = self.network

if not network.storage_units[network.storage_units.p_nom_extendable].empty:

self.results.value[
"battery storage expansion"
] = _calc_storage_expansion(self).sum()
Expand All @@ -741,7 +739,6 @@ def calc_etrago_results(self):
# links expansion

if not network.links[network.links.p_nom_extendable].empty:

links = _calc_sectorcoupling_link_expansion(self)
self.results.value["fuel cell links expansion"] = links[0]
self.results.value["electrolyzer links expansion"] = links[1]
Expand All @@ -753,7 +750,6 @@ def calc_etrago_results(self):
# grid expansion

if not network.lines[network.lines.s_nom_extendable].empty:

self.results.value[
"abs. electrical ac grid expansion"
] = _calc_network_expansion(self)[0].sum()
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

cleaned = [
"etrago/cluster/disaggregation.py",
"etrago/tools/calc_results.py",
"etrago/tools/network.py",
"etrago/tools/utilities.py",
"noxfile.py",
Expand Down

0 comments on commit 36f2735

Please sign in to comment.