-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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?