https://github.com/beacon-biosignals/timespans.jl

A Julia package that provides a `TimeSpan` type for representing a continuous span between two points in time.

https://github.com/beacon-biosignals/timespans.jl

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary

Keywords from Contributors

numerical onda julialang programming-language nonlinear-programming probability-distributions ida convex-optimization sciml dataframes
Last synced: 10 months ago · JSON representation

Repository

A Julia package that provides a `TimeSpan` type for representing a continuous span between two points in time.

Basic Info
  • Host: GitHub
  • Owner: beacon-biosignals
  • License: other
  • Language: Julia
  • Default Branch: main
  • Size: 215 KB
Statistics
  • Stars: 7
  • Watchers: 23
  • Forks: 2
  • Open Issues: 12
  • Releases: 24
Created over 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

TimeSpans.jl

CI codecov

TimeSpans.jl provides a simple TimeSpan type for representing a continuous span between two points in time, along with generic utility functions for common operations on TimeSpan-like types. Importantly, the package exposes a minimal interface (TimeSpans.start and TimeSpans.stop) that any type can implement to enable support for the TimeSpans API.

Example usage

```julia julia> span = TimeSpan(Nanosecond(100), Nanosecond(1000)) TimeSpan(00:00:00.000000100, 00:00:00.000001000)

julia> start(span) 100 nanoseconds

julia> stop(span) 1000 nanoseconds

julia> duration(span) 900 nanoseconds ```

TimeSpans.jl supports common functions for comparing timespans, such as contains and overlaps:

julia julia> overlaps(TimeSpan(Minute(1), Minute(5)), TimeSpan(Minute(2), Minute(10))) true julia> TimeSpans.contains(TimeSpan(Minute(1), Minute(5)), TimeSpan(Minute(2), Minute(10))) false

Operations on collections of timespans include merge_spans and invert_spans:

```julia julia> spans = [TimeSpan(Minute(1), Minute(5)), TimeSpan(Minute(2), Minute(6)), TimeSpan(Minute(10), Minute(15))] 3-element Vector{TimeSpan}: TimeSpan(00:01:00.000000000, 00:05:00.000000000) TimeSpan(00:02:00.000000000, 00:06:00.000000000) TimeSpan(00:10:00.000000000, 00:15:00.000000000)

2 out of 3 spans overlap, returning 2 merged timespans

julia> merge_spans(overlaps, spans) 2-element Vector{TimeSpan}: TimeSpan(00:01:00.000000000, 00:06:00.000000000) TimeSpan(00:10:00.000000000, 00:15:00.000000000)

no timespans contain one another

julia> merge_spans(TimeSpans.contains, spans) 3-element Vector{TimeSpan}: TimeSpan(00:01:00.000000000, 00:05:00.000000000) TimeSpan(00:02:00.000000000, 00:06:00.000000000) TimeSpan(00:10:00.000000000, 00:15:00.000000000)

julia> parent_span = TimeSpan(Minute(0), Minute(15)) TimeSpan(00:00:00.000000000, 00:15:00.000000000)

return spans within parent_span when provided spans are removed

julia> invertspans(spans, parentspan) 2-element Vector{TimeSpan}: TimeSpan(00:00:00.000000000, 00:01:00.000000000) TimeSpan(00:06:00.000000000, 00:10:00.000000000) ```

Timespans can be indexed corresponding to a signal of a given sample rate, and vice versa.

```julia julia> indexfromtime(100, TimeSpan(Second(0), Second(1))) 1:100

julia> indexfromtime(100, TimeSpan(Second(1))) 101:101

julia> indexfromtime(100, TimeSpan(Second(3), Second(6))) 301:600

julia> timefromindex(1, 1) 0 nanoseconds

julia> timefromindex(1, 2) 1000000000 nanoseconds

julia> timefromindex(100, 100) 990000000 nanoseconds

julia> timefromindex(100, 101) 1000000000 nanoseconds ```

GitHub Events

Total
  • Watch event: 1
  • Delete event: 5
  • Issue comment event: 3
  • Push event: 12
  • Pull request review comment event: 1
  • Pull request review event: 5
  • Pull request event: 8
  • Create event: 3
Last Year
  • Watch event: 1
  • Delete event: 5
  • Issue comment event: 3
  • Push event: 12
  • Pull request review comment event: 1
  • Pull request review event: 5
  • Pull request event: 8
  • Create event: 3

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 40
  • Total Committers: 14
  • Avg Commits per committer: 2.857
  • Development Distribution Score (DDS): 0.675
Past Year
  • Commits: 5
  • Committers: 3
  • Avg Commits per committer: 1.667
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
Jarrett Revels j****s@g****m 13
Alex Arslan a****n@c****t 5
Phillip Alday p****y 4
Eric Hanson 5****n 4
dependabot[bot] 4****] 3
Curtis Vogt c****t@g****m 2
Chris de Graaf me@c****v 2
kendal-s 9****s 1
Kim Laberinto g****t@k****m 1
Hannah Robertson h****a 1
Glenn Moynihan g****y@g****m 1
Eric Davies i****2@g****m 1
mich11 m****n@b****o 1
Jason Manley j****y@b****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 23
  • Total pull requests: 48
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 13
  • Total pull request authors: 15
  • Average comments per issue: 3.74
  • Average comments per pull request: 1.02
  • Merged pull requests: 38
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • ericphanson (6)
  • palday (2)
  • mich11 (2)
  • haberdashPI (2)
  • jrevels (2)
  • SimonDanisch (1)
  • kimlaberinto (1)
  • kleinschmidt (1)
  • glennmoy (1)
  • ssfrr (1)
  • hannahilea (1)
  • omus (1)
  • JuliaTagBot (1)
Pull Request Authors
  • ararslan (9)
  • dependabot[bot] (9)
  • palday (6)
  • ericphanson (5)
  • jrevels (4)
  • omus (4)
  • kimlaberinto (2)
  • kendal-s (2)
  • haberdashPI (2)
  • christopher-dG (2)
  • glennmoy (2)
  • iamed2 (2)
  • mich11 (1)
  • jmmanley (1)
Top Labels
Issue Labels
breaking (1)
Pull Request Labels
dependencies (8)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 771 total
  • Total dependent packages: 4
  • Total dependent repositories: 0
  • Total versions: 24
juliahub.com: TimeSpans

A Julia package that provides a `TimeSpan` type for representing a continuous span between two points in time.

  • Versions: 24
  • Dependent Packages: 4
  • Dependent Repositories: 0
  • Downloads: 771 Total
Rankings
Dependent repos count: 9.9%
Dependent packages count: 13.2%
Average: 25.4%
Forks count: 33.3%
Stargazers count: 45.1%
Last synced: 11 months ago