Skip to content
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

Implemented TimeZones Interface #3

Merged
merged 73 commits into from
Aug 13, 2015
Merged

Implemented TimeZones Interface #3

merged 73 commits into from
Aug 13, 2015

Conversation

omus
Copy link
Member

@omus omus commented Aug 13, 2015

Implemented the full TimeZones interface. There are allot of changes so I'll point form the important changes:

  • TimeZones now requires Base.Dates which requires Julia 0.4 pre-release and above
  • TZ data compiling reworked due to bugs
  • Added tests
  • Built TimeZone types are serialized and saved to disk for fast loading
  • Implemented ZonedDateTime which is the timezone-aware version of DateTime
  • Implemented calendrical arithmetic for ZonedDateTime (see README)
  • Updated Travis script and added Coveralls and Codecov (91% coverage)

Curtis Vogt added 30 commits July 6, 2015 09:54
Compatibility required that the following issue was fixed in Julia:
JuliaLang/julia#12003
Note: generate_tzinfo and generate_tzdata are now broken and need
to be updated.
New types are OffsetTimeZone and DaylightSavingTimeZone. Change was
introduced to keep the UTC offset and the DST offset separate.
Link entries were being considered continuation lines. This issue
was noticed with parsing "Pacific/Honolulu". Code was restructured
to only treat lines that start with whitespace as continuation lines.
This change should now gracefully handle modifications the the TZ
database.
Changes made to support all records provided by the TZ database
and additionally make debugging and testing easier.
Code works but is rather messy and needs refactoring.
@omus
Copy link
Member Author

omus commented Aug 13, 2015

Important note: building the package will download TZ data files from the IANA website. The FTP source we get these files is a little flaky and ends up failing downloads once in a while. As a fix I have the build script automatically attempt to retry downloading a failed file up to 3 times. If by chance we can't download a file the build will fail causing Travis to fail.

julia 0.3-
Dates

julia 0.4-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this just needs to be julia 0.4, right @IainNZ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'd like it to install it right now, Julia 0.4- is correct ("Julia 0.4 prerelease"). julia 0.4 means >=0.4.0. Not really the clearest thing in the world, is it :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes sense. Thanks.

@quinnj
Copy link
Collaborator

quinnj commented Aug 13, 2015

This is awesome @omus; definitely a lot of great work here; thanks for picking this up and running with it. Had you already started an olsen parser of sorts or did you just have to totally revamp the one I had cobbled together?

Anyway, I'm inclined to merge so that we can keep hacking on things from here, but if you'd rather wait and make tweaks, that's ok too.

@omus
Copy link
Member Author

omus commented Aug 13, 2015

@quinnj I reworked you Olsen database parser. Originally I just did enough to get it working in Julia 0.4 but then I found a couple of bugs and realized I needed to do some refactoring to make a solid test suite.

For example one of the bugs was with the old HourMin type which had two fields hour and min. If you would parse a negative offset as a String such as -1:20 when you calculated the total seconds it ended up doing hour * 3600 + min * 60 which ended up resulting in -2400 instead -4800.

You can merge this right away. I do have some tweaks to make but they should be mostly minor at this point.

quinnj added a commit that referenced this pull request Aug 13, 2015
Implemented TimeZones Interface
@quinnj quinnj merged commit 80ab8d5 into master Aug 13, 2015
@omus omus deleted the interface branch August 13, 2015 19:18
@omus omus mentioned this pull request Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants