{"action":"closed","issue":{"url":"https://api.github.com/repos/pingswept/pysolar/issues/42","repository_url":"https://api.github.com/repos/pingswept/pysolar","labels_url":"https://api.github.com/repos/pingswept/pysolar/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/pingswept/pysolar/issues/42/comments","events_url":"https://api.github.com/repos/pingswept/pysolar/issues/42/events","html_url":"https://github.com/pingswept/pysolar/issues/42","id":195877358,"number":42,"title":"discrepancy in how timezone unaware datetimes are used","user":{"login":"jezemine","id":5974062,"avatar_url":"https://avatars1.githubusercontent.com/u/5974062?v=4","gravatar_id":"","url":"https://api.github.com/users/jezemine","html_url":"https://github.com/jezemine","followers_url":"https://api.github.com/users/jezemine/followers","following_url":"https://api.github.com/users/jezemine/following{/other_user}","gists_url":"https://api.github.com/users/jezemine/gists{/gist_id}","starred_url":"https://api.github.com/users/jezemine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jezemine/subscriptions","organizations_url":"https://api.github.com/users/jezemine/orgs","repos_url":"https://api.github.com/users/jezemine/repos","events_url":"https://api.github.com/users/jezemine/events{/privacy}","received_events_url":"https://api.github.com/users/jezemine/received_events","type":"User","site_admin":false},"labels":[{"id":774291626,"url":"https://api.github.com/repos/pingswept/pysolar/labels/help%20wanted","name":"help wanted","color":"5ced42","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-15T18:18:01Z","updated_at":"2018-03-30T15:52:23Z","closed_at":"2018-03-30T15:52:23Z","author_association":"NONE","body":"Was playing with this library today and found an inconsistency.  If you call get_altitude_fast with no timezone, it assumes UTC.  If you call get_altitude with no timezone, it assumes something else and produces a different result by 80 degrees.\r\n\r\nIf I were the decider I would require timezone-awareness on all datetimes so there's nothing to assume, but that's me.  If tzinfo is not set, just raise and be done. That would be a breaking change though, so you might anger some folks :)\r\n\r\n```python\r\nfrom pysolar.solar import get_altitude, get_altitude_fast\r\nfrom datetime import datetime\r\n\r\n# first be a good citizen and make a timezone aware datetime\r\nd = datetime(2000, 1, 1, tzinfo=pytz.utc)\r\ny = get_altitude(33, 44, d)\r\nprint(y) # -50.85138816460989\r\n\r\ny = get_altitude_fast(33, 44, d)\r\nprint(y) # -50.94686162937928\r\n\r\n\r\n# now be vague and try it with no timezone - big discrepancy!\r\n# to me not specifying the timezone is a sin already but still...\r\nd = datetime(2000, 1, 1)\r\ny = get_altitude(33, 44, d)\r\nprint(y) # 31.734391266371397\r\n\r\ny = get_altitude_fast(33, 44, d)\r\nprint(y) # -50.94686162937928\r\n```"}}
{"actor":{"display_login":"pingswept"}}