diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml new file mode 100644 index 00000000..5ef28bd0 --- /dev/null +++ b/.JuliaFormatter.toml @@ -0,0 +1,3 @@ +style = "blue" +format_markdown = true +format_docstrings = true diff --git a/.github/workflows/Format.yml b/.github/workflows/Format.yml new file mode 100644 index 00000000..b6614264 --- /dev/null +++ b/.github/workflows/Format.yml @@ -0,0 +1,31 @@ +name: format-pr +on: + schedule: + - cron: "0 0 * * *" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/cache@v2 + - name: Install JuliaFormatter and format + run: | + julia -e 'import Pkg; Pkg.add("JuliaFormatter")' + julia -e 'using JuliaFormatter; format(".")' + + # https://github.com/marketplace/actions/create-pull-request + # https://github.com/peter-evans/create-pull-request#reference-example + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Format .jl files + title: "Automatic JuliaFormatter.jl run" + branch: auto-juliaformatter-pr + delete-branch: true + labels: formatting, automated pr, no changelog + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/README.md b/README.md index 83a500dd..8af09436 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,34 @@ TimeSeries.jl ============ -[![Build Status](https://github.com/JuliaStats/TimeSeries.jl/workflows/CI/badge.svg?branch=master)](https://github.com/JuliaStats/TimeSeries.jl/actions?query=workflow%3ACI) -[![Coverage Status](https://codecov.io/gh/JuliaStats/TimeSeries.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaStats/TimeSeries.jl) + [![Latest Documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaStats.github.io/TimeSeries.jl/dev) [![Stable Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaStats.github.io/TimeSeries.jl/stable) +[![Build Status](https://github.com/JuliaStats/TimeSeries.jl/workflows/CI/badge.svg)](https://github.com/JuliaStats/TimeSeries.jl/actions?query=workflow%3ACI) +[![Coverage Status](https://codecov.io/gh/JuliaStats/TimeSeries.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaStats/TimeSeries.jl) + +[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/JuliaDiff/BlueStyle) + TimeSeries aims to provide a lightweight framework for working with time series data in Julia. Documentation is provided [here](http://juliastats.github.io/TimeSeries.jl/latest/). + +## Installation +Assuming that you already have Julia correctly installed, it suffices to import TimeSeries.jl in the standard way: + +```julia +using Pkg +Pkg.add("TimeSeries") +``` + +## Examples + +```julia +using TimeSeries +using Dates + +dates = Date(2018, 1, 1):Day(1):Date(2018, 12, 31) +ta = TimeArray(dates, rand(length(dates))) + +timestamps = DateTime(2018, 1, 1):Hour(1):DateTime(2018, 12, 31) +ta = TimeArray(timestamps, rand(length(timestamps))) +``` \ No newline at end of file