Skip to content

ModelChain.prepare_inputs press_temp can be unbound #1135

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

Closed
wholmgren opened this issue Jan 19, 2021 · 1 comment
Closed

ModelChain.prepare_inputs press_temp can be unbound #1135

wholmgren opened this issue Jan 19, 2021 · 1 comment
Labels
Milestone

Comments

@wholmgren
Copy link
Member

The except block should set press_temp = {}. The kwarg should also be called as a kwarg.

try:
press_temp = _build_kwargs(['pressure', 'temp_air'],
weather[0] if isinstance(weather, tuple)
else weather)
press_temp['temperature'] = press_temp.pop('temp_air')
except KeyError:
pass
self._prep_inputs_solar_pos(press_temp)

@wholmgren wholmgren added the bug label Jan 19, 2021
@wholmgren wholmgren added this to the 0.9.0 milestone Jan 19, 2021
@wholmgren
Copy link
Member Author

This is not actually possible because the first line of the block always assigns at least press_temp = {}. Better style would be to move the first line out of the try block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant