Skip to content

Commit 945c339

Browse files
CameronTStarkwholmgren
authored andcommitted
change tools._scalar_out/_array_out arg name to avoid collision with builtin input function (#800)
* replace Pandas item() implementation with numpy's using .values * force value to np.ndarray to enable universal use of .item() * rename function parameters to arg instead of input * convert last input to arg * remove extra lines
1 parent 10d54de commit 945c339

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pvlib/tools.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,22 @@ def _datetimelike_scalar_to_datetimeindex(time):
206206
return pd.DatetimeIndex([pd.Timestamp(time)])
207207

208208

209-
def _scalar_out(input):
210-
if np.isscalar(input):
211-
output = input
209+
def _scalar_out(arg):
210+
if np.isscalar(arg):
211+
output = arg
212212
else: #
213213
# works if it's a 1 length array and
214214
# will throw a ValueError otherwise
215-
output = np.asarray(input).item()
215+
output = np.asarray(arg).item()
216216

217217
return output
218218

219219

220-
def _array_out(input):
221-
if isinstance(input, pd.Series):
222-
output = input.values
220+
def _array_out(arg):
221+
if isinstance(arg, pd.Series):
222+
output = arg.values
223223
else:
224-
output = input
224+
output = arg
225225

226226
return output
227227

0 commit comments

Comments
 (0)