Skip to content

Repair solar_azimuth_analytical #431

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
Feb 27, 2018
Merged

Repair solar_azimuth_analytical #431

merged 6 commits into from
Feb 27, 2018

Conversation

adriesse
Copy link
Member

@adriesse adriesse commented Feb 16, 2018

pvlib python pull request guidelines

Thank you for your contribution to pvlib python!

You may submit a pull request with your code at any stage of completion, however, before the code can be merged the following items must be addressed:

  • Closes issue solarposition.solar_azimuth_analytical returns nan #420
  • Fully tested. Added and/or modified tests to ensure correct behavior for all reasonable inputs. Tests must pass on the TravisCI and Appveyor testing services.
  • Code quality and style is sufficient. Passes git diff upstream/master -u -- "*.py" | flake8 --diff and/or landscape.io linting service.
  • New code is fully documented. Includes sphinx/numpydoc compliant docstrings and comments in the code where necessary.
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate docs/sphinx/source/whatsnew file for all changes.

Please don't hesitate to ask for help if you're unsure of how to accomplish any of the above. You may delete all of these instructions except for the list above.

Brief description of the problem and proposed solution (if not already fully described in the issue linked to above):

@wholmgren
Copy link
Member

Thanks! I like the conservative approach of only modifying values that are known to be problematic.

It may be worthwhile to explicitly define the atol parameter, even if it's equal to the default.

Can you add a simple test function to pvlib/test/test_solarposition.py that would have failed without these changes? The code in your comment could work if you replace the print statements with assert not bad_azi.any(). The new test should include a comment along the lines of # GitHub issue 420 (I often forget to do this, but it does help future readers).

Finally, please add your name and a comment to the docs/sphinx/source/whatsnew/0.5.2.rst file.

@wholmgren wholmgren added this to the 0.5.2 milestone Feb 16, 2018
@wholmgren wholmgren added the bug label Feb 16, 2018
@adriesse
Copy link
Member Author

Hi Will, could you give some additional hints on the flake8 action item?

@wholmgren
Copy link
Member

The command checks the changes that you've made for PEP8 style issues. landscape.io is supposed to do this for us, but it's been unreliable for awhile now. I haven't gotten around to setting up a new service. Stickler-CI is showing up in a few other projects that I follow, so maybe we'll try that.

In any case, for this pull request, flake8 will complain about how you've used whitespace to make the lines more similar. However, I don't have a problem with the formatting you're using, so no need to worry about it.

If you're still interested in pursuing it, you can read the forking and the pep8 sections in the pandas contributing guide:

http://pandas.pydata.org/pandas-docs/stable/contributing.html

The forking section shows how to add the "upstream remote" (the main pvlib repository). The pep8 section talks a little more about the flake8 command. Note that you'll need to run the diff against "upstream/master" rather than your local master.

@adriesse
Copy link
Member Author

Ok, I'll learn about flake8 another time.
The latest whatsnew file I see is for 0.4.5. Which one of us starts a new one?

@wholmgren
Copy link
Member

Your fork shows that you have the 0.5.2 whatsnew file https://github.com/adriesse/pvlib-python/blob/master/docs/sphinx/source/whatsnew/v0.5.2.rst

Maybe you're looking at a different local copy of the code?

@adriesse
Copy link
Member Author

No, I see now that the file extension changed from txt to rst.

@wholmgren
Copy link
Member

Looks good, thanks Anton!!

@@ -17,11 +17,15 @@ Bug fixes
* physicaliam now returns a Series if called with a Series as an
argument. (:issue:`397`)
* corrected docstring for irradiance.total_irrad (:issue: '423')
* modified solar_azimuth_analytical to handle some borderline cases, thereby
avoiding the NaN values and/or warnings that were previously produced
(:issue: '420')
Copy link
Member

Choose a reason for hiding this comment

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

pls change single quotes around #420 to backticks

@mikofski
Copy link
Member

mikofski commented Aug 3, 2018

so cool, thanks Anton!

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.

3 participants