<commit_before>import logging
import os

from zipfile import ZipFile

import pandas as pd

from sklearn import preprocessing

from edisgo.network.components import PotentialChargingParks

if "READTHEDOCS" not in os.environ:
    import geopandas as gpd

logger = logging.getLogger("edisgo")

COLUMNS = {
    "charging_processes_df": [
        "ags",
        "car_id",
        "destination",
        "use_case",
        "nominal_charging_capacity_kW",
        "chargingdemand_kWh",
        "park_start_timesteps",
        "park_end_timesteps",
    ],
    "grid_connections_gdf": ["id", "use_case", "user_centric_weight", "geometry"],
    "potential_charging_parks_df": [
        "lv_grid_id",
        "distance_to_nearest_substation",
        "distance_weight",
        "charging_point_capacity",
        "charging_point_weight",
    ],
    "designated_charging_points_df": [
        "park_end_timesteps",
        "nominal_charging_capacity_kW",
        "charging_park_id",
        "use_case",
    ],
    "integrated_charging_parks_df": ["edisgo_id"],
}


class Electromobility:
    """
    Electromobility base class

    """

    def __init__(self, **kwargs):
        self._edisgo_obj = kwargs.get("edisgo_obj", None)

    @property
    def charging_processes_df(self):
        """
        DataFrame with all
        `SimBEV <https://github.com/rl-institut/simbev>`_
        charging processes.

        Returns
        -------
        :pandas:`pandas.DataFrame<DataFrame>`
            DataFrame with AGS, car ID, trip destination, charging use case
            (private or public), netto charging capacity, charging demand,
            charge start, charge end, grid connection point and charging point
            ID.

        """
        try:
            return self._charging_processes_df
        except Exception:
            return pd.DataFrame(columns=COLUMNS["charging_processes_df"])

    @charging_processes_df.setter
    def charging_processes_df(self, df):
        self._charging_processes_df = df

    @property
    def grid_connections_gdf(self):
        """
        GeoDataFrame with all
        `SimBEV <https://github.com/rl-institut/simbev>`_
        grid connections.

        Returns
        -------
        :geopandas:`GeoDataFrame`
            GeoDataFrame with AGS, charging use case (home, work, public or<commit_msg>Added doc string for charging_processes_df<commit_after>import logging
import os

from zipfile import ZipFile

import pandas as pd

from sklearn import preprocessing

from edisgo.network.components import PotentialChargingParks

if "READTHEDOCS" not in os.environ:
    import geopandas as gpd

logger = logging.getLogger("edisgo")

COLUMNS = {
    "charging_processes_df": [
        "ags",
        "car_id",
        "destination",
        "use_case",
        "nominal_charging_capacity_kW",
        "grid_charging_capacity_kW" "chargingdemand_kWh",
        "park_time_timesteps",
        "park_start_timesteps",
        "park_end_timesteps",
        "charging_park_id",
        "charging_point_id",
    ],
    "grid_connections_gdf": ["id", "use_case", "user_centric_weight", "geometry"],
    "potential_charging_parks_df": [
        "lv_grid_id",
        "distance_to_nearest_substation",
        "distance_weight",
        "charging_point_capacity",
        "charging_point_weight",
    ],
    "designated_charging_points_df": [
        "park_end_timesteps",
        "nominal_charging_capacity_kW",
        "charging_park_id",
        "use_case",
    ],
    "integrated_charging_parks_df": ["edisgo_id"],
}


class Electromobility:
    """
    Electromobility base class

    """

    def __init__(self, **kwargs):
        self._edisgo_obj = kwargs.get("edisgo_obj", None)

    @property
    def charging_processes_df(self):
        """
        DataFrame with all
        `SimBEV <https://github.com/rl-institut/simbev>`_
        charging processes.

        Returns
        -------
        :pandas:`pandas.DataFrame<DataFrame>`
            DataFrame with AGS, car ID, trip destination, charging use case,
            netto charging capacity, charging demand, charge start, charge end, grid
            connection point and charging point ID. The columns are:

                ags : int
                    8-digit AGS (Amtlicher Gemeindeschlüssel, eng. Community
                    Identification Number). Leading zeros are missing.

                car_id : int
                    Car ID to differntiate charging processes from different cars.

                destination : str
                    SimBEV driving destination.

                use_case : str
                    SimBEV use case. Can be "hpc", "home", "public" or "work".

                nominal_charging_capacity_kW : float
                    Vehicle charging capacity in kW.

                grid_charging_capacity_kW : float
                    Grid-sided charging capacity including charging infrastructure
                    losses in kW.

                chargingdemand_kWh : float
                    Charging demand in kWh.

                park_time_timesteps : int
                    Number of parking time steps.

                park_start_timesteps : int
                    Time step the parking event starts.

                park_end_timesteps : int
                    Time step the parking event ends.

                charging_park_id : int
                    Designated charging park ID from grid_connections_gdf. Is NaN if
                    the charging demand is not yet distributed.

                charging_point_id : int
                    Designated charging point ID. Is used to differentiate between
                    multiple charging points at one charging park.

        """
        try:
            return self._charging_processes_df
        except Exception:
            return pd.DataFrame(columns=COLUMNS["charging_processes_df"])

    @charging_processes_df.setter
    def charging_processes_df(self, df):
        self._charging_processes_df = df

    @property
    def grid_connections_gdf(self):
        """
        GeoDataFrame with all
        `SimBEV <https://github.com/rl-institut/simbev>`_
        grid connections.

        Returns
        -------
        :geopandas:`GeoDataFrame`
            GeoDataFrame with AGS, charging use case (home, work, public or
{'fraction_non_alphanumeric': 0.08220044261776795, 'fraction_numerical': 0.00015807777426493836, 'mean_word_length': 2.102991662579696, 'pattern_counts': {'":': 10, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1862565', 'n_tokens_mistral': 1880, 'n_tokens_neox': 1808, 'n_words': 424}