Skip to content

changed default types to float in solarposition.py #2280

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
Dec 3, 2024

Conversation

kurt-rhee
Copy link
Contributor

@kurt-rhee kurt-rhee commented Oct 29, 2024

  • Closes (NONE)
  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries in docs/sphinx/source/reference 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 (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

I have added type hints to get_solarposition() and I have also changed the default values of the function inputs to float instead of int to make my linter stop yelling at me.

@kurt-rhee
Copy link
Contributor Author

This pull request will fail on flake8 due to line lengths on some of the documentation. I am not sure how to fix it.

@cwhanse
Copy link
Member

cwhanse commented Oct 29, 2024

I have added type hints to get_solarposition()

There have been debates on adding type hints, and I don't think we're agreed that pvlib benefits by adding them.

Specifying float for those defaults is not controversial; thanks for doing that.

@kurt-rhee
Copy link
Contributor Author

Got it, happy to remove type hinting if that helps push this PR through.

@kandersolar kandersolar added this to the v0.11.2 milestone Oct 30, 2024
@kandersolar
Copy link
Member

Agreed, there is no consensus about adopting type hints in pvlib. Until then, no hints!

Nitpick: if the default values are changing from int to float (e.g. 12 to 12.0), then the docstrings should change as well (temperature : float, default 12. instead of temperature : float, default 12).

@kurt-rhee
Copy link
Contributor Author

@kandersolar good point! I'll give that a quick edit today

Co-authored-by: Kevin Anderson <[email protected]>
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 after the linter complaint is resolved

kurt-rhee and others added 2 commits November 18, 2024 14:10
Co-authored-by: Adam R. Jensen <[email protected]>
I hope that this fixes the flake8 errors.  I attempted to mimic the
multi-line links seen in other parts of this .py file
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.

Reverting a couple linter-related changes, as they seem to render poorly in the sphinx output and are not required for this PR

@kandersolar kandersolar merged commit 6d886dc into pvlib:main Dec 3, 2024
20 of 21 checks passed
@kandersolar
Copy link
Member

Thanks @kurt-rhee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants