-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
101 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "TimeAxes" | ||
uuid = "9a9fc9a6-283d-47e9-a2f6-b3a44e559ea3" | ||
authors = ["Zachary P. Christensen <[email protected]>"] | ||
version = "0.1.1" | ||
version = "0.2.0" | ||
|
||
[deps] | ||
AxisIndices = "f52c9ee2-1b1c-4fd8-8546-6350938c7f11" | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,88 @@ | ||
# TimeAxes | ||
|
||
```@doc | ||
TimeAxes | ||
``` | ||
|
||
## Examples | ||
|
||
A simple array with a time dimension time units along the axis. | ||
```jldoctest doc_examples | ||
julia> using TimeAxes | ||
julia> using Unitful: s | ||
julia> A = NamedAxisArray{(:time,)}(collect(1:100), (1:100)s); | ||
``` | ||
|
||
### Iteration | ||
|
||
One could use the time axis for iteration... | ||
```jldoctest doc_examples | ||
julia> sum([A[i] for i in axes(A, 1)]) | ||
5050 | ||
``` | ||
|
||
|
||
...or windows of the time axis. | ||
```jldoctest doc_examples | ||
julia> A2 = sum([A[i] for i in AxisIterator(axes(A, 1), 10)]) | ||
10-element NamedAxisArray{Int64,1} | ||
• time - 1 s:1 s:10 s | ||
1 s 460 | ||
2 s 470 | ||
3 s 480 | ||
4 s 490 | ||
5 s 500 | ||
6 s 510 | ||
7 s 520 | ||
8 s 530 | ||
9 s 540 | ||
10 s 550 | ||
``` | ||
|
||
Some other basic functions related to time data are also available. | ||
```jldoctest doc_examples | ||
julia> lag(A2, 1) | ||
9-element NamedAxisArray{Int64,1} | ||
• time - 2 s:1 s:10 s | ||
2 s 460 | ||
3 s 470 | ||
4 s 480 | ||
5 s 490 | ||
6 s 500 | ||
7 s 510 | ||
8 s 520 | ||
9 s 530 | ||
10 s 540 | ||
julia> lead(A2, 1) | ||
9-element NamedAxisArray{Int64,1} | ||
• time - 1 s:1 s:9 s | ||
1 s 470 | ||
2 s 480 | ||
3 s 490 | ||
4 s 500 | ||
5 s 510 | ||
6 s 520 | ||
7 s 530 | ||
8 s 540 | ||
9 s 550 | ||
``` | ||
|
||
More time specific methods may be found in the [References](#References) | ||
|
||
|
||
## API | ||
## References | ||
|
||
```@autodocs | ||
Modules = [TimeAxes] | ||
Order = [:type, :function] | ||
``` |
This file contains 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
1234e44
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.
@JuliaRegistrator register
Release Notes:
lead
andlag
functions1234e44
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.
Registration pull request created: JuliaRegistries/General/16551
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: