Skip to content

Change deprecated use of .astype() to .view() #1262

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 2 commits into from
Jul 27, 2021
Merged

Change deprecated use of .astype() to .view() #1262

merged 2 commits into from
Jul 27, 2021

Conversation

hashstat
Copy link
Contributor

@hashstat hashstat commented Jul 15, 2021

This change is made as suggested by the pandas FutureWarning to prevent
those warnings.

See #1261

  • Closes pandas FutureWarning when casting type in DatetimeIndex #1261
  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

This change is made as suggested by the pandas FutureWarning to prevent
those warnings.

See #1261
Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @hashstat!

FYI to the other maintainers, looks like there's a handful of places in the tests that need this update as well: https://dev.azure.com/solararbiter/pvlib%20python/_build/results?buildId=5277&view=logs&j=80999419-997d-54cc-7d9e-fafbf8111e17&t=fe7e5fe7-75d4-55e3-99ba-184521a271ef&l=232

@@ -180,6 +180,8 @@ Bug fixes
when data time step is not one minute. Error was introduced in v0.8.1.
(:issue:`1241`, :pull:`1242`)
* Corrected :py:func:`~pvlib.solarposition.spa_python` to avoid a future warning. (:pull:`1256`)
* Changed deprecated use of ``.astype()`` to ``.view()`` in :py:mod:`~pvlib.solarposition`.
(:issue:`1261`, :pull:`1262`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could merge this with the entry above it, nbd though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged as suggested.

@wholmgren wholmgren added this to the 0.9.0 milestone Jul 27, 2021
@wholmgren
Copy link
Member

Thanks @hashstat!

@wholmgren wholmgren merged commit 4ba9871 into pvlib:master Jul 27, 2021
@hashstat hashstat deleted the 1261-pandas-futurewarning-fix branch August 2, 2021 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pandas FutureWarning when casting type in DatetimeIndex
3 participants