Oct-06-2016, 08:34 PM
(Oct-06-2016, 06:15 PM)j.crater Wrote: Nicely done sparkz_alot! Have you tested the functions against some already calculated transforms to make checks?
darn you, j.crater :naughty: , thought I covered it all. Then after reading your post, thought maybe I'd better check some more. Sure enough ran into a problem with negative years. It appears Pythons calendar.monthrange only covers the positive years 1-9999, causing:
Error:Please enter the 4 digit year (-4712 to 2100): -1000
Please enter the digit month (1 - 12): 7
Traceback (most recent call last):
File "C:/Python/Astronomy/meeus/scratch.py", line 60, in <module>
days_in_month = monthrange(my_year, my_month)
File "C:\Python 3.5\lib\calendar.py", line 121, in monthrange
day1 = weekday(year, month, 1)
File "C:\Python 3.5\lib\calendar.py", line 113, in weekday
return datetime.date(year, month, day).weekday()
ValueError: year is out of range
Process finished with exit code 1
Looks like I'll have to replace the calendar library with some other way to test the "day". Thanks for the catch :D
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition