Skip to content

Commit

Permalink
allow retrieval of vector values on sweeps
Browse files Browse the repository at this point in the history
  • Loading branch information
bqpd committed Feb 17, 2022
1 parent 4301db7 commit dd0ce90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gpkit/keydict.py
Expand Up @@ -93,8 +93,8 @@ def __contains__(self, key): # pylint:disable=too-many-return-statements
if super().__contains__(key): # pylint: disable=no-member
if idx:
try:
value = super().__getitem__(key)[idx] # pylint: disable=no-member
return True if is_sweepvar(value) else not isnan(value)
val = super().__getitem__(key)[idx] # pylint: disable=no-member
return True if is_sweepvar(val) else not isnan(val).any()
except TypeError:
raise TypeError("%s has an idx, but its value in this"
" KeyDict is the scalar %s."
Expand Down

0 comments on commit dd0ce90

Please sign in to comment.