Open
Description
Describe the bug
When a ModelChain is instantiated with the PVWatts DC model, the Sandia inverter model, and multiple arrays, this line converts each DataFrame (output from pvwatts_dc) to a Series. As a consequence, looking for 'p_mp' will raise a KeyError.
The combination of pvwatts_dc and sandia inverter should warn the user in a more informative way. pvwatts_dc does not produce v_mp, which is required by the sandia inverter model.
The error that is produced is seen in this snippet of code:
import pandas as pd
from pvlib.modelchain import _tuple_from_dfs
df = pd.DataFrame(data=[1., 2.], columns=['p_mp'])
dfs = (df, df)
out = _tuple_from_dfs(dfs, 'p_mp')
print(type(dfs[0]))
print(type(out[0]))
out[0]['p_mp']
Expected behavior
ModelChain. run_model could warn the user about an invalid combination of DC and AC models. The error above is rather mysterious.
Versions:
pvlib.__version__
: 0.9.5
Additional context
Reported here.