Skip to content

ModelChain.prepare_inputs press_temp can be unbound #1135

Closed

Description

@wholmgren

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)

Activity

  1. added this to the 0.9.0 milestone on Jan 19, 2021
  2. wholmgren commented on Jan 22, 2021

    @wholmgren
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions