Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RecipesBase = "0.5, 0.7, 0.8, 1.0"
Reexport = "1"
Statistics = "1"
Tables = "1"
julia = "1.6"
julia = "1.10"
PrettyTables = "2,3"
IteratorInterfaceExtensions = "1"
TableTraits = "1"
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ makedocs(;
"tables.md",
"plotting.md",
"retime.md",
"api.md",
],
)

Expand Down
25 changes: 25 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Public API Reference

This page lists all public functions and types exported by TimeSeries.jl.

```@autodocs
Modules = [TimeSeries]
Private = false
```

## Base Method Extensions

TimeSeries.jl extends several Base methods to work with `TimeArray` objects:

```@docs
Base.hcat(::TimeArray, ::TimeArray)
Base.hcat(::TimeArray, ::TimeArray, ::Vararg{TimeArray})
Base.vcat(::TimeArray...)
Base.map
Base.split(::TimeSeries.TimeArray, ::Function)
Base.:+
Base.:-
Base.:(==)
Base.eachrow
Base.eachcol
```
12 changes: 8 additions & 4 deletions docs/src/apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ As mentioned previously, we lose the first nine observations to the
consuming nature of this operation. They are not **missing** per se,
they simply do not exist.

```@docs
moving
```

## `upto`

Another operation common in time series analysis is an aggregation
Expand All @@ -163,3 +159,11 @@ using TimeSeries
using MarketData
basecall(cl, cumsum)
```

## `uniformspaced` and `uniformspace`

These methods check or enforce uniform spacing in time series.

## `dropnan`

Removes rows containing NaN values from a TimeArray.
33 changes: 17 additions & 16 deletions docs/src/combine.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ meta(CatApple)
meta(merge(AppleCat, CatApple))
```

```@docs
merge
```
See [`merge`](@ref) in the Public API Reference for detailed documentation.

## `collapse`

Expand Down Expand Up @@ -97,9 +95,7 @@ using Statistics
collapse(cl, month, last, mean)
```

```@docs
collapse
```
See [`collapse`](@ref) in the Public API Reference for detailed documentation.

## `vcat`

Expand All @@ -112,19 +108,16 @@ which does not consider that its arguments are actually the *same* time series.
This concatenation is *vertical* (`vcat`) because it does not create
columns, it extends existing ones (which are represented vertically).

```@docs
vcat(tas::Vararg{TimeArray,N} where N)
```
See [`vcat`](@ref) in the Public API Reference for detailed documentation.

## `map`

This function allows complete transformation of the data within the time
series, with alteration on both the time stamps and the associated
values. It works exactly like `Base.map`: the first argument is a binary
function (the time stamp and the values) that returns two values,
respectively the new time stamp and the new vector of values. It does
not perform any kind of compression like `collapse`, but rather
transformations.
This is a TimeSeries-specific overload of `map` that allows complete transformation
of the data within the time series, with alteration on both the time stamps and
the associated values. The first argument is a binary function that takes the
time stamp and the values and returns two values: the new time stamp and the
new vector of values. It does not perform any kind of compression like `collapse`,
but rather transformations.

The simplest example is to postpone all time stamps in the given time
series, here by one year:
Expand All @@ -135,3 +128,11 @@ using Dates
ta = TimeArray([Date(2015, 10, 01), Date(2015, 11, 01)], [15, 16])
map((timestamp, values) -> (timestamp + Year(1), values), ta)
```

See [`map`](@ref) in the Public API Reference for detailed documentation.

## `hcat`

Horizontally concatenates TimeArrays, adding columns.

See [`hcat`](@ref) in the Public API Reference for detailed documentation.
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ Pages = [
"tables.md",
"plotting.md",
"retime.md",
"api.md",
]
```
5 changes: 1 addition & 4 deletions docs/src/modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@ first(rename(Symbol ∘ uppercase ∘ string, ohlc))
first(rename(uppercase, ohlc, String))
```

```@docs
rename
rename!
```
See [`rename`](@ref) and [`rename!`](@ref) in the [Public API Reference](@ref) for detailed documentation.
14 changes: 13 additions & 1 deletion docs/src/retime.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ Available `extrapolate` methods are:
```@example retime
new_timestamps = range(DateTime(2019, 12, 31), DateTime(2020, 1, 2), step = Minute(15))
ta_ = retime(ta, new_timestamps, extrapolate=MissingExtrapolate())
```
```

## Interpolation Methods

Available interpolation methods: `Linear`, `Previous`, `Next`, `Nearest`.

## Aggregation Methods

Available aggregation methods: `Mean`, `Min`, `Max`, `Count`, `Sum`, `Median`, `First`, `Last`.

## Extrapolation Methods

Available extrapolation methods: `FillConstant`, `NearestExtrapolate`, `MissingExtrapolate`, `NaNExtrapolate`.
2 changes: 1 addition & 1 deletion docs/src/split.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ using TimeSeries
using MarketData

split(cl, Dates.day)
```
```
13 changes: 3 additions & 10 deletions docs/src/timearray.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,16 @@ relying on variable bindings outside of the object's type fields.

## Constructors

```@docs
TimeArray
```
See the [`TimeArray`](@ref TimeSeries.TimeArray) constructor documentation in the Public API Reference.

## Fields getter functions

There are four field getter functions exported.
They are named as same as the field names.
They are named the same as the field names.

- [`timestamp`](@ref)
- [`values`](@ref)
- [`colnames`](@ref)
- [`meta`](@ref)

```@docs
timestamp
values
colnames
meta
```
See the Public API Reference for detailed documentation of these functions.
Loading