-
Notifications
You must be signed in to change notification settings - Fork 4
WIP: Try switching to NanoDates for dates #63
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
Open
anowacki
wants to merge
10
commits into
master
Choose a base branch
from
nanodates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #63 +/- ##
==========================================
- Coverage 67.36% 66.74% -0.63%
==========================================
Files 21 23 +2
Lines 2185 2198 +13
==========================================
- Hits 1472 1467 -5
- Misses 713 731 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace use of the Dates standard library type `DateTime` with `NanoDate` of NanoDates.jl. The means that dates are represented internally with ns precision, and `NanoDate`s are returned when calling e.g. `origin_time` or `dates`. This also means that we no longer need to set `b` to anything other than 0 when reading miniSEED files (which are resolved usually to µs).
Include a mention of the use of `NanoDate`s in the manual in the section on `Event`s, since that is where the `.time` field holds the date.
In addition to the `dates` function, now export an additional function which returns samples to the nearest ms in UTC time, to make it easier for users who don't need to use a `NanoSecond`.
Add the plotting of sample values against absolute (UTC) time, rather
than relative time, by passing `date=true` to `plot_traces` (and
therefore also to `Makie.plot(::AbstractArray{<:Seis.AbstractTrace})`).
For now, issues with Makie means that picks are plotted with diamonds
rather than vertical lines, and labels cannot be plotted. These may be
worked around in future or remedied upstream.
On 32-bit platforms, rounding to an `Int` means rounding to and `Int32`, and this can fail when using `NanoDate`s because the values are too large. Change this to an explicit `Int64` to try to avoid this.
Currently plotting with `space=:relative` doesn't work when using an axis with units of `DateTime` (MakieOrg/Makie.jl#4324). Work around the issue by plotting into a 'dimensionless' scene, as per the suggestion of MakieOrg/Makie.jl#4324 (comment)
Move the default `axis` keyword arguments into the `axis` keyword for the `Makie.lines` call which now creates the axis for each trace. This allows the user to set keyword arguments for `Makie.Axis` without resetting the defaults completely.
Incorrect rounding means that although `datetimes` was working, the test was broken. Fix by rounding to a large enough integer to cope with the size of time interval in ns used in the test.
Updat the documentation environment to enable docs to be built with the NanoDates dependency.
NanoDates supports Julia v1.7+, while LTS is now v1.10, so it is time to drop support for v1.6 and only support LTS for new features.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt at switching to the use of
NanoDates fromNanoDates.jl for origin times. For practical purposes this
avoids all issues with sampling intervals which are not
whole numbers of milliseconds (so long as they are still
sensibly rounded to nanoseconds), and so makes it easier to
deal with high-sample-rate data in absolute time.
datetimeto return sample dates asDateTimesdateoption toplot_traces