Skip to content

change tools._scalar_out/_array_out arg name to avoid collision with builtin input function #800

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

Merged
merged 6 commits into from
Oct 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pvlib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,22 @@ def _datetimelike_scalar_to_datetimeindex(time):
return pd.DatetimeIndex([pd.Timestamp(time)])


def _scalar_out(input):
if np.isscalar(input):
output = input
def _scalar_out(arg):
if np.isscalar(arg):
output = arg
else: #
# works if it's a 1 length array and
# will throw a ValueError otherwise
output = np.asarray(input).item()
output = np.asarray(arg).item()

return output


def _array_out(input):
if isinstance(input, pd.Series):
output = input.values
def _array_out(arg):
if isinstance(arg, pd.Series):
output = arg.values
else:
output = input
output = arg

return output

Expand Down