[Python-modules-commits] [python-pysolar] 10/10: Fixed bug found by Jon Little; GetDayOfYear() now works with timezone-aware datetimes

Wolfgang Borgert debacle at moszumanska.debian.org
Fri Oct 3 23:36:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to annotated tag 0.4.2
in repository python-pysolar.

commit f382f2872d0168721204146476280126d13c2009
Author: Brandon Stafford <brandon at loess.(none)>
Date:   Tue Mar 9 12:48:41 2010 -0500

    Fixed bug found by Jon Little; GetDayOfYear() now works with timezone-aware datetimes
---
 CONTRIBUTORS.markdown | 2 +-
 solar.py              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CONTRIBUTORS.markdown b/CONTRIBUTORS.markdown
index 1b596d4..be8999b 100644
--- a/CONTRIBUTORS.markdown
+++ b/CONTRIBUTORS.markdown
@@ -4,5 +4,5 @@ Contributions
 Many people have contributed to Pysolar since its inception.
 
 Thanks to Brent Pedersen, Holger Zebner, Pietro Zambelli, Sean Taylor, Simeon Obinna 
-Nwaogaidu, Tim Michelsen, and Lahmeyer International for their 
+Nwaogaidu, Tim Michelsen, Jon Little, and Lahmeyer International for their 
 contributions of code, bugfixes, documentation, and general encouragement.
diff --git a/solar.py b/solar.py
index ed348be..6632ebc 100644
--- a/solar.py
+++ b/solar.py
@@ -151,7 +151,7 @@ def GetCoefficient(jme, constant_array):
 	return sum([constant_array[i-1][0] * math.cos(constant_array[i-1][1] + (constant_array[i-1][2] * jme)) for i in range(len(constant_array))])
 
 def GetDayOfYear(utc_datetime):
-	year_start = datetime.datetime(utc_datetime.year, 1, 1,)
+	year_start = datetime.datetime(utc_datetime.year, 1, 1, tzinfo=utc_datetime.tzinfo)
 	delta = (utc_datetime - year_start)
 	return delta.days
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pysolar.git



More information about the Python-modules-commits mailing list