Skip to content

Commit

Permalink
docs: fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jenhagg committed Dec 6, 2022
1 parent 882cefc commit a33e3b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 8 additions & 8 deletions powersimdata/input/converter/pypsa_to_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,15 @@ def _get_storage_gen(df, storage_type):


class FromPyPSA(AbstractGrid):
"""Grid builder for PyPSA network object."""
"""Grid builder for PyPSA network object.
:param pypsa.Network network: PyPSA network to read in.
:param bool add_pypsa_cols: PyPSA data frames with renamed columns appended to
Grid object data frames.
"""

def __init__(self, network, add_pypsa_cols=True):
"""Constructor."""
"""Constructor"""
super().__init__()
self.network = network
self.add_pypsa_cols = add_pypsa_cols
Expand Down Expand Up @@ -160,12 +165,7 @@ def _set_zone_mapping(self):
self.id2zone = _invert_dict(self.zone2id)

def build(self):
"""PyPSA Network reader.
:param pypsa.Network n: PyPSA network to read in.
:param bool add_pypsa_cols: PyPSA data frames with renamed columns appended to
Grid object data frames
"""
"""PyPSA Network reader."""
n = self.network
add_pypsa_cols = self.add_pypsa_cols

Expand Down
3 changes: 3 additions & 0 deletions powersimdata/network/europe_tub/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class PyPSABase(FromPyPSA):
:param str/iterable interconnect: interconnect name(s).
:param str grid_model: the grid model
:param pypsa.Network network: a PyPSA network object
:param bool add_pypsa_cols: PyPSA data frames with renamed columns appended to
Grid object data frames.
"""

def __init__(self, interconnect, grid_model, network, add_pypsa_cols=True):
Expand Down Expand Up @@ -121,6 +123,7 @@ def _get_network(self, reduction):
def _check_reduction(self, reduction):
"""Validate reduction parameter
:param int reduction: reduction parameter (number of nodes in network).
:raises ValueError: if ``reduction`` is not available.
"""
if reduction is None:
Expand Down

0 comments on commit a33e3b1

Please sign in to comment.