import pandas as pd
from .parameters import ComponentParameters


def csvtoparameters(file_path):
    df = pd.read_csv(file_path)
    parameters_list = list()
    for name, voltage, power, sunlight in zip(df['name'], df['voltage'], df
        ['power'], df['sunlight']):
        param = ComponentParameters()
        param.name = name
        if voltage != 'Vbat':
            param.voltage = float(voltage)
        else:
            param.voltage = voltage
        param.power = float(power)
        param.sunlight = sunlight
        parameters_list.append(param)
    return parameters_list

fc5a34ca4471bfb2bedc8f49ed8cc76d390c111f
<mask token>

<mask token>


def csvtoparameters(file_path):
    df = pd.read_csv(file_path)
    parameters_list = list()
    for name, voltage, power, sunlight in zip(df['name'], df['voltage'], df
        ['power'], df['sunlight']):
        param = ComponentParameters()
        param.name = name
        if voltage != 'Vbat':
            param.voltage = float(voltage)
        else:
            param.voltage = voltage
        param.power = float(power)
        param.sunlight = sunlight
        parameters_list.append(param)
    return parameters_list

import pandas as pd
from .parameters import ComponentParameters


def csvtoparameters(file_path):
    df = pd.read_csv(file_path)
    parameters_list = list()
    for name, voltage, power, sunlight in zip(df['name'], df['voltage'], df
        ['power'], df['sunlight']):
        param = ComponentParameters()
        param.name = name
        if voltage != 'Vbat':
            param.voltage = float(voltage)
        else:
            param.voltage = voltage
        param.power = float(power)
        param.sunlight = sunlight
        parameters_list.append(param)
    return parameters_list
