Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data should not be optional in ModelChain.run_model_from_effective_irradiance #1713

Closed
kandersolar opened this issue Apr 18, 2023 · 1 comment · Fixed by #1720
Closed

data should not be optional in ModelChain.run_model_from_effective_irradiance #1713

kandersolar opened this issue Apr 18, 2023 · 1 comment · Fixed by #1720

Comments

@kandersolar
Copy link
Member

I don't understand why the data parameter has a default value of None here:

def run_model_from_effective_irradiance(self, data=None):

The weather input DataFrame is required for run_model and run_model_from_poa. I'm not sure what the point of calling a run_model_* method with no inputs might be. Using the default value of None results in an error:

import pvlib

location = pvlib.location.Location(40, -80)
system = pvlib.pvsystem.PVSystem(module_parameters=dict(pdc0=1, gamma_pdc=-0.004),
                                 inverter_parameters=dict(pdc0=1))

mc = pvlib.modelchain.ModelChain(system, location,
                                 aoi_model='no_loss', spectral_model='no_loss')
mc.run_model_from_effective_irradiance()
  File ~\software\miniconda3\envs\dev\lib\site-packages\pvlib\modelchain.py:1410 in _verify
    if not set(required) <= set(data.columns):

AttributeError: 'NoneType' object has no attribute 'columns'

Seems like the default None value should be removed, along with the same for the helper methods (_run_from_effective_irrad, etc).

@k10blogger
Copy link
Contributor

This seemed like an easy issue made a PR for the same. The following function have the data argument made as required
modelchain.run_model_from_effective_irradiance
modelchain._prepare_temperature
modelchain._run_from_effective_irradiance

@kandersolar kandersolar added the bug label May 1, 2023
@kandersolar kandersolar added this to the 0.9.6 milestone May 1, 2023
@kandersolar kandersolar modified the milestones: 0.9.6, 0.10.0 May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants