# Path: edisgo/io/pypsa_io.py
# def to_pypsa(grid_object, timesteps, **kwargs):
#     def _set_slack(grid):
# def set_seed(edisgo_obj, pypsa_network):
# def _get_grid_component_dict(grid_object):
# def _append_lv_components(
#     comp,
#     comps,
#     lv_components,
#     lv_grid_name,
#     aggregate_loads=None,
#     aggregate_generators=None,
#     aggregate_storages=None,
# ):
# def _get_timeseries_with_aggregated_elements(
#     edisgo_obj, timesteps, element_types, elements, aggr_dict
# ):
# def _buses_voltage_set_point(edisgo_obj, buses, slack_bus, timesteps):
# def _check_integrity_of_pypsa(pypsa_network):
# def process_pfa_results(edisgo, pypsa, timesteps):


import pandas as pd
import logging
from pyomo.environ import (
    ConcreteModel,
    Set,
    Param,
    Objective,
    Constraint,
    minimize,
    Var,
)
from pyomo.opt import SolverFactory
from edisgo.io import pypsa_io




def voltage_based(
    feedin,
    generators,
    curtailment_timeseries,

# Path: edisgo/io/pypsa_io.py
# def to_pypsa(grid_object, timesteps, **kwargs):
#     def _set_slack(grid):
# def set_seed(edisgo_obj, pypsa_network):
# def _get_grid_component_dict(grid_object):
# def _append_lv_components(
#     comp,
#     comps,
#     lv_components,
#     lv_grid_name,
#     aggregate_loads=None,
#     aggregate_generators=None,
#     aggregate_storages=None,
# ):
# def _get_timeseries_with_aggregated_elements(
#     edisgo_obj, timesteps, element_types, elements, aggr_dict
# ):
# def _buses_voltage_set_point(edisgo_obj, buses, slack_bus, timesteps):
# def _check_integrity_of_pypsa(pypsa_network):
# def process_pfa_results(edisgo, pypsa, timesteps):


# Path: edisgo/flex_opt/curtailment.py
import pandas as pd
import logging
from pyomo.environ import (
    ConcreteModel,
    Set,
    Param,
    Objective,
    Constraint,
    minimize,
    Var,
)
from pyomo.opt import SolverFactory
from edisgo.io import pypsa_io





def voltage_based(
    feedin,
    generators,
    curtailment_timeseries,

    edisgo,