Skip to content

pre-configured ModelChains #1013

@wholmgren

Description

@wholmgren

Is your feature request related to a problem? Please describe.
ModelChain has a lot of options and can be challenging to configure. This also makes it difficult to implement reference implementations of workflows.

Describe the solution you'd like
Create wrappers for pre-configured ModelChains. For example, a PVWatts version of ModelChain might look like:

# modelchain.py
PVWatts = functools.partial(
    ModelChain, 
    dc_model='pvwatts', ac_model='pvwatts', losses_model='pvwatts', 
    transposition_model='perez', aoi_model='physical'
)

# user code
my_model_chain = PVWatts(my_location, my_system)

This SO post discusses some subtleties with using partial with classes, so the actual implementation might require the helper function in that post.

Describe alternatives you've considered
We could subclass ModelChain but that seems like overkill for this. Inheritance leads to brittle code, in my experience, so I prefer to avoid it if possible.

We could supply dicts of parameters e.g.

# modelchain.py
pvwatts_config = dict(
    dc_model='pvwatts', ac_model='pvwatts', losses_model='pvwatts', 
    transposition_model='perez', aoi_model='physical'
)

# user code
my_model_chain = ModelChain(my_location, my_system, **pvwatts_config)

Any other ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    SPIDOE SETO Solar Performance Insight projectenhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions