pingswept / pysolar

Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.
http://pysolar.org
GNU General Public License v3.0
372 stars 125 forks source link

Automated testing with GitHub actions #127

Closed w00kie closed 4 years ago

w00kie commented 4 years ago

Hello,

I noticed the issue with the recent pull request to remove pytz failing test. Enabling automated tests with GitHub Actions would flag these issues easily. Here I've just used the standard template recommended by GitHub to test Python packages.

Note: the linting found a bunch of issues in the rest.py file with undefined variable names which I did not know how to fix, so I commented out the linter from the test definitions. You should look into it before re-enabling linting.

Thanks for your work on Pysolar! Francois

nhoening commented 4 years ago

Great PR!!

I propose to comment the lint command back in and resolve the issue within this PR. If we see the error in this PR's GitHub action log, we can maybe help with the resolution.

For instance, this thread suggests to use pylint version 1.4.5 or newer: https://stackoverflow.com/questions/33226442/pylint-rules-how-to-solve-undefined-variable#35986139

But it could be something else. Let's see it!

pingswept commented 4 years ago

One informational note about rest.py: it is unfinished code. It's my attempt to implement the REST2 radiation model by reading various papers about the model. I hope to get it working some day, but the code has literally never been executed, nor is it ever called from any other part of Pysolar.

w00kie commented 4 years ago

I've re-enabled linting but added a flag to the rest.py file to exclude it. I'm really not confident enough with the concepts to muck around that code to redefine function definitions and add missing functions...

Removing the # flake8: noqa line will re-enable linting on the file.

pingswept commented 4 years ago

Thanks for the patch, Francois, and thanks to Nicolas for the suggestion to add (most) of the linting back in.