Skip to content

Commit

Permalink
Add docstring for q_sign
Browse files Browse the repository at this point in the history
  • Loading branch information
boltbeard committed Jul 13, 2018
1 parent 504963d commit 6c86c02
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ding0/tools/pypsa_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ def export_to_dir(network, export_dir):


def q_sign(power_factor_mode_string, sign_convention):
"""
Gets the correct sign for Q time series given 'inductive' and 'capacitive' and the 'generator'
or 'load' convention.
Parameters
----------
power_factor_mode_string: :obj:`str`
Either 'inductive' or 'capacitive'
sign_convention: :obj:`str`
Either 'load' or 'generator'
Return
------
:obj: `int` : +1 or -1
A sign to mulitply to Q time sereis
"""

comparestr = power_factor_mode_string.lower()

if re.fullmatch('inductive', comparestr):
Expand Down

0 comments on commit 6c86c02

Please sign in to comment.