I have 2 Python files and in the first one I am calling a function from the second one. However, I always get the error "ValueError: too many values to unpack (expected 2)" and I don't know why I get it. The function in the second files takes 16 arguments and returns 16 arguments. These 16 returned arguments are assigned to 16 variables in the first file. Still I get this error everytime. Does anyone of you have a clue what the problem might be?
Here you can see the call from the funtion call from the first file:
self.action_heatCoefficientSpaceHeating, self.action_heatCoefficientDHW, self.action_chargingPowerEV, self.state_temperatureBufferStorage,
self.state_usableVolumeDHWTank, self.state_SOCOfTheEV, self.help_countNumberOfStartHeatPump_HeatingBufferStorage_Indiviual, self.help_countNumberOfStartHeatPump_HeatingDHW_Indiviual,
self.help_countNumberOfStartHeatPump_Heating_Combined , self.helpCounterNumberOfRunningSlots_SpaceHeating , self.helpCounterNumberOfRunningSlots_DHW ,
self.helpCounterNumberOfRunningSlots_Combined , self.helpCounterNumberOfStandBySlots_SpaceHeating , self.helpCounterNumberOfStandBySlots_DHW ,
self.helpCounterNumberOfStandBySlots_Combined, self.helpCurrentPeakLoad = ICSimulation.simulateTimeSlot_WithAddtionalControler_BT1 (self.action_heatCoefficientSpaceHeating, self.action_heatCoefficientDHW, self.action_chargingPowerEV, self.help_statePreviousTimeSlot_temperatureBufferStorage,
self.help_statePreviousTimeSlot_usableVolumeDHWTank, self.help_statePreviousTimeSlot_SOCOfTheEV, self.help_countNumberOfStartHeatPump_HeatingBufferStorage_Indiviual,
self.help_countNumberOfStartHeatPump_HeatingDHW_Indiviual, self.help_countNumberOfStartHeatPump_Heating_Combined , self.helpCounterNumberOfRunningSlots_SpaceHeating , self.helpCounterNumberOfRunningSlots_DHW ,
self.helpCounterNumberOfRunningSlots_Combined , self.helpCounterNumberOfStandBySlots_SpaceHeating , self.helpCounterNumberOfStandBySlots_DHW , self.helpCounterNumberOfStandBySlots_Combined, self.helpCurrentPeakLoad)
Here you see the function "simulateTimeSlot_WithAddtionalControler_BT1 "from the second file "ICSimulation":
def simulateTimeSlot_WithAddtionalControler_BT1 (action_SpaceHeating, action_DHWHeating, action_EVCharging, state_BufferStorageTemperatureLastTimeSlot,
state_usableVolumeDHWLastTimeSlot, state_SOCofEVLastTimeSlot, helpCountNumberOfStartsIndividual_SpaceHeating,
helpCountNumberOfStartsIndividual_DHW, helpCountNumberOfStarts_Combined , helpCounterNumberOfRunningSlots_SpaceHeating , helpCounterNumberOfRunningSlots_DHW ,
helpCounterNumberOfRunningSlots_Combined , helpCounterNumberOfStandBySlots_SpaceHeating , helpCounterNumberOfStandBySlots_DHW ,
helpCounterNumberOfStandBySlots_Combined, helpCurrentPeakLoad ):
state_BufferStorageTemperatureCurrent =-1
state_usableVolumeDHWCurrent = -1
state_SOCofEVCurrent = -1
action_SpaceHeating_corrected = -1
action_DHWHeating_corrected = -1
action_EVCharging_corrected = -1
return action_SpaceHeating_corrected, action_DHWHeating_corrected, action_EVCharging_corrected, state_BufferStorageTemperatureCurrent,
state_usableVolumeDHWCurrent, state_SOCofEVCurrent, helpCountNumberOfStartsIndividual_SpaceHeating, helpCountNumberOfStartsIndividual_DHW,
helpCountNumberOfStarts_Combined , helpCounterNumberOfRunningSlots_SpaceHeating , helpCounterNumberOfRunningSlots_DHW ,
helpCounterNumberOfRunningSlots_Combined , helpCounterNumberOfStandBySlots_SpaceHeating , helpCounterNumberOfStandBySlots_DHW ,
helpCounterNumberOfStandBySlots_Combined, helpCurrentPeakLoad
What is really confusing to me is why it says that "2" are expected? The function takes 16 arguments and returns 16 arguments. I do not know at all why only 2 are expected?