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
373 stars 125 forks source link

Example code throws exception #100

Closed nickponline closed 5 years ago

nickponline commented 5 years ago

The example code from the documentation:

from pysolar.solar import *
import datetime

date = datetime.datetime.now()
print(get_altitude(42.206, -71.382, date))
date = datetime.datetime(2007, 2, 18, 15, 13, 1, 130320, tzinfo=datetime.timezone.utc)
print(get_altitude(42.206, -71.382, date))

Throws the following exception:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    print(get_altitude(42.206, -71.382, date))
  File "/usr/local/lib/python2.7/site-packages/pysolar/tzinfo_check.py", line 77, in func_with_check
    full = inspect.getfullargspec(func)
AttributeError: 'module' object has no attribute 'getfullargspec'

Python 2.7.15

nickponline commented 5 years ago

I see look like I should use Python 3.