Skip to content

convert indexing arrays to int to avoid future deprecation #164

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 1 commit into from
Jun 14, 2016

Conversation

alorenzo175
Copy link
Contributor

This PR just gets rid of some deprecation warnings using numpy 1.11 from non-integer indices. The default for the bins in irradiance.py is now 0 (versus the old NaN), which may or may not be a problem. Maybe the default should be something else?

@wholmgren
Copy link
Member

The 0 will turn into a -1, which will be a valid indexer and as you said may be a problem. Alternatively, we could use an int that is two larger than the number of elements in each array, so that invalid values ultimately result in an IndexError. The problem here is that I think this means that nans in the input data will result in IndexErrors, which is also unfortunate. I suppose we can add nan filters, but that's one more complication to test.

I think that we can use defaults of pd.Series(np.nan, index=times, dtype=np.object), but I'm not sure what the performance hit would be. It's probably minor for most applications.

Annoying that numpy doesn't support integer nans.

@wholmgren wholmgren added the bug label May 26, 2016
@wholmgren wholmgren added this to the 0.3.3 milestone May 26, 2016
@wholmgren
Copy link
Member

I'd like to resolve this one way or another, but I don't care what we do. Thoughts?

@wholmgren wholmgren merged commit ab63c91 into pvlib:master Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants