-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add timezone for package overview #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks! This seems like a good place to demonstrate the use of the I'd definitely like to get some kind documentation testing working, but it's pretty low on my priority list. I think that doctests is probably the way to go, but I also haven't used it. In the spirit of small changes and getting something done sooner than later, I suggest removing the |
I'm okay with the Not sure why
I'll remove the test anyway tho since it doesn't really add much, and it's a bit fragile (so not DRY) since it copies the example from the docs source. IE: if the doc source changes, then this test is worthless. I'll make the change and push it up to the PR. I might not have time to make the changes today, but definitely by Friday. I've never used doctest and not sure how to. The ipython directive you're using was totally new to me too. I agree postpone doctest, but I'll add an issue that addresses it so we don't forget. |
@mikofski do you think you can switch to |
When building docs, I get this warning, I think it's unrelated:
Otherwise I the documents look good to me and I think this is ready to merge. 😄 |
# latitude, longitude, name, altitude, timezone | ||
coordinates = [(30, -110, 'Tucson', 700, 'Etc/GMT+7'), | ||
(35, -105, 'Albuquerque', 1500, 'Etc/GMT+7'), | ||
(40, -120, 'San Francisco', 10, 'Etc/GMT+7'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+8 in San Fran
I agree that it's good to go, except for changing San Francisco from +7 to +8. Oh, and please add a note and your name or username to the whats new. |
Thanks @mikofski! |
fixes #156 update "package overview" to use UTC or localized time only (v0.3.0)
I'm done for now.
adds timezone to coordinates dictionary
coordinates = [(30, -110, 'Tucson', 700, 'US/Mountain'),
(35, -105, 'Albuquerque', 1500, 'US/Mountain'),
(40, -120, 'San Francisco', 10, 'US/Pacific'),
(50, 10, 'Berlin', 34, 'Europe/Berlin')]
also moves times creation inside the loop, because
tz_localize(pytz.timezone('US/Mountain'))
always raisesNonExistentTimeError
which is pandas issue 8917NOTE: I tried to use
tz_localize
with'Etc/GMT+7'
which is equivalent to UTC-0700 (ie: US/Mountain), etc, but that raisesTypeError: Already tz-aware, use tz_convert to convert.
after first loop sotimes
actually has to go inside the loop anyway, and it's just cleaner to make a new datetime index series each loop and localize it to the actual timezones which are clearer than the GMT timezones.add new test module called
test_docs.py
- this can probably be removed if doctest sphinx extension is used? but I've never used it so not sure?add
test_package_overview
totest_docs
for this issue, checks if energies are all close to previously calculated, except, that now Tuscon and SF don't agree 😦also for expedience I just copied the doc source over to the test, but I put a todo to use docutils to grab this code, unfortunately, tho, docutils doesn't like the ipython directive so I couldn't figure this out right away, also if using doctest extension, maybe this goes away?