8000 Fix clearsky Ineichen rounding by cedricleroy · Pull Request #808 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Fix clearsky Ineichen rounding #808

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
wants to merge 7 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
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
  • Loading branch information
CameronTStark authored and wholmgren committed Oct 31, 2019
commit 945c339c617d967159ca5f52dde535b2cb8a10ec
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
0