# Path: edisgo/tools/geo.py
# def proj2equidistant(srid):
#     """
#     Transforms to equidistant projection (epsg:3035).
# 
#     Parameters
#     ----------
#     srid : int
#         Spatial reference identifier of geometry to transform.
# 
#     Returns
#     -------
#     :py:func:`functools.partial`
# 
#     """
# 
#     return Transformer.from_crs("EPSG:{}".format(srid), "EPSG:3035", always_xy=True).transform


import pandas as pd
import os
import numpy as np
    from shapely.ops import transform
from edisgo.tools.geo import proj2equidistant
    return costs


def line_expansion_costs(edisgo_obj, lines_names):
    """
    Returns costs for earthworks and per added cable as well as voltage level
    for chosen lines in edisgo_obj.

    Parameters
    -----------
    edisgo_obj : :class:`~.edisgo.EDisGo`
        eDisGo object of which lines of lines_df are part
    lines_names: list of str
        List of names of evaluated lines

    Returns
    -------
    costs: :pandas:`pandas.DataFrame<DataFrame>`
        Dataframe with names of lines as index and entries for
        'costs_earthworks', 'costs_cable', 'voltage_level' for each line

    """
    lines_df = edisgo_obj.topology.lines_df.loc[lines_names, ["length"]]
    mv_lines = lines_df[
        lines_df.index.isin(edisgo_obj.topology.mv_grid.lines_df.index)
    ].index
    lv_lines = lines_df[~lines_df.index.isin(mv_lines)].index

    # get population density in people/km^2
    # transform area to calculate area in km^2

# Path: edisgo/tools/geo.py
# def proj2equidistant(srid):
#     """
#     Transforms to equidistant projection (epsg:3035).
# 
#     Parameters
#     ----------
#     srid : int
#         Spatial reference identifier of geometry to transform.
# 
#     Returns
#     -------
#     :py:func:`functools.partial`
# 
#     """
# 
#     return Transformer.from_crs("EPSG:{}".format(srid), "EPSG:3035", always_xy=True).transform


# Path: edisgo/flex_opt/costs.py
import pandas as pd
import os
import numpy as np
    from shapely.ops import transform
from edisgo.tools.geo import proj2equidistant

    return costs


def line_expansion_costs(edisgo_obj, lines_names):
    """
    Returns costs for earthworks and per added cable as well as voltage level
    for chosen lines in edisgo_obj.

    Parameters
    -----------
    edisgo_obj : :class:`~.edisgo.EDisGo`
        eDisGo object of which lines of lines_df are part
    lines_names: list of str
        List of names of evaluated lines

    Returns
    -------
    costs: :pandas:`pandas.DataFrame<DataFrame>`
        Dataframe with names of lines as index and entries for
        'costs_earthworks', 'costs_cable', 'voltage_level' for each line

    """
    lines_df = edisgo_obj.topology.lines_df.loc[lines_names, ["length"]]
    mv_lines = lines_df[
        lines_df.index.isin(edisgo_obj.topology.mv_grid.lines_df.index)
    ].index
    lv_lines = lines_df[~lines_df.index.isin(mv_lines)].index

    # get population density in people/km^2
    # transform area to calculate area in km^2

    projection = proj2equidistant(int(edisgo_obj.config["geo"]["srid"]))