Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ModelChain.run_model error with pvwatts_dc, sandia inverter model, and multiple arrays #1761

Copy link
Copy link
Open
@cwhanse

Description

@cwhanse
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.