diff --git a/Project.toml b/Project.toml index 7e773ae0..19f0ebe9 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/docs/make.jl b/docs/make.jl index b5bc0a9b..f8a17016 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -20,6 +20,7 @@ makedocs(; "tables.md", "plotting.md", "retime.md", + "api.md", ], ) diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 00000000..e2df34e2 --- /dev/null +++ b/docs/src/api.md @@ -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 +``` \ No newline at end of file diff --git a/docs/src/apply.md b/docs/src/apply.md index 40cb6b29..5a75e40c 100644 --- a/docs/src/apply.md +++ b/docs/src/apply.md @@ -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 @@ -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. diff --git a/docs/src/combine.md b/docs/src/combine.md index d1a06852..23fd1b38 100644 --- a/docs/src/combine.md +++ b/docs/src/combine.md @@ -54,9 +54,7 @@ meta(CatApple) meta(merge(AppleCat, CatApple)) ``` -```@docs -merge -``` +See [`merge`](@ref) in the Public API Reference for detailed documentation. ## `collapse` @@ -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` @@ -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: @@ -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. diff --git a/docs/src/index.md b/docs/src/index.md index 6aa3826c..48a4c2d8 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -19,5 +19,6 @@ Pages = [ "tables.md", "plotting.md", "retime.md", + "api.md", ] ``` diff --git a/docs/src/modify.md b/docs/src/modify.md index 85a49358..ebbfa457 100644 --- a/docs/src/modify.md +++ b/docs/src/modify.md @@ -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. diff --git a/docs/src/retime.md b/docs/src/retime.md index 4160db86..555a7abd 100644 --- a/docs/src/retime.md +++ b/docs/src/retime.md @@ -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()) -``` \ No newline at end of file +``` + +## 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`. diff --git a/docs/src/split.md b/docs/src/split.md index fbced9bb..ab9e77b6 100644 --- a/docs/src/split.md +++ b/docs/src/split.md @@ -134,4 +134,4 @@ using TimeSeries using MarketData split(cl, Dates.day) -``` \ No newline at end of file +``` diff --git a/docs/src/timearray.md b/docs/src/timearray.md index 964b3853..8c710457 100644 --- a/docs/src/timearray.md +++ b/docs/src/timearray.md @@ -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.