[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
a3a7e19b07
commit
d75b0ae8ab
@ -36,6 +36,7 @@ def get_opt(opts, expr, flags=None):
|
|||||||
return match.group(0)
|
return match.group(0)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def find_opt(opts, expr):
|
def find_opt(opts, expr):
|
||||||
"""
|
"""
|
||||||
Return if available the float after the expression.
|
Return if available the float after the expression.
|
||||||
@ -49,6 +50,7 @@ def find_opt(opts, expr):
|
|||||||
return True, None
|
return True, None
|
||||||
return False, None
|
return False, None
|
||||||
|
|
||||||
|
|
||||||
# Define a context manager to temporarily mute print statements
|
# Define a context manager to temporarily mute print statements
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def mute_print():
|
def mute_print():
|
||||||
|
@ -63,7 +63,7 @@ import re
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pypsa
|
import pypsa
|
||||||
from _helpers import configure_logging, get_opt, find_opt
|
from _helpers import configure_logging, find_opt, get_opt
|
||||||
from add_electricity import load_costs, update_transmission_costs
|
from add_electricity import load_costs, update_transmission_costs
|
||||||
from pypsa.descriptors import expand_series
|
from pypsa.descriptors import expand_series
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ def extra_functionality(n, snapshots):
|
|||||||
if reserve.get("activate"):
|
if reserve.get("activate"):
|
||||||
add_operational_reserve_margin(n, snapshots, config)
|
add_operational_reserve_margin(n, snapshots, config)
|
||||||
|
|
||||||
EQ_config = constraints.get("EQ",False)
|
EQ_config = constraints.get("EQ", False)
|
||||||
EQ_wildcard = get_opt(opts, r"^EQ+[0-9]*\.?[0-9]+(c|)")[2:]
|
EQ_wildcard = get_opt(opts, r"^EQ+[0-9]*\.?[0-9]+(c|)")[2:]
|
||||||
EQ_o = EQ_wildcard or EQ_config
|
EQ_o = EQ_wildcard or EQ_config
|
||||||
if EQ_o:
|
if EQ_o:
|
||||||
|
Loading…
Reference in New Issue
Block a user