Skip to content

Commit

Permalink
rename to VegSeasons
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Jan 23, 2024
1 parent 3de633a commit d4eb23a
Show file tree
Hide file tree
Showing 12 changed files with 413 additions and 307 deletions.
20 changes: 20 additions & 0 deletions .github/backup/Documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Documenter
on:
push:
branches: [master, main]
tags: [v*]
pull_request:
branches: [master, main]
jobs:
Documenter:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
RASTERDATASOURCES_PATH: ".."
GKSwstype: "100"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://github.com/Alexander-Barth/NCDatasets.jl/blob/master/.github/workflows/ci.yml
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
# - '1.3'
- '1'
# - 'nightly'
os:
- ubuntu-latest
- macOS-latest
# - windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email te@st.er
- uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}

- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
24 changes: 24 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CompatHelper

on:
schedule:
- cron: '15 23 */4 * *'

jobs:
CompatHelper:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.2.0]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
18 changes: 18 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://github.com/JuliaRegistries/TagBot
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "FindPeaks2"
name = "VegSeasons"
uuid = "7ffb45d2-0618-4371-ac45-d24d5e1e2ebc"
authors = ["Dongdong Kong <kongdd@users.noreply.github.com>"]
version = "0.1.0"
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# VegSeasons.jl

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://kongdd.github.io/nlminb.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://kongdd.github.io/nlminb.jl/dev)
[![CI](https://github.com/eco-hydro/VegSeasons.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/eco-hydro/VegSeasons.jl/actions/workflows/CI.yml)
[![Codecov](https://codecov.io/gh/eco-hydro/VegSeasons.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/eco-hydro/VegSeasons.jl/tree/master)

> Dongdong Kong
31 changes: 10 additions & 21 deletions scripts/ex-findpeaks_01.qmd
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
---
title: "findpeaks"
format: html
code-line-numbers: true
---

# 加载包与数据
```{julia}
using Findpeaks
using VegSeasons
using Ipaper
# using Dates
using Plots
using Statistics: quantile
using RTableTools
# 这一个函数,负担极重
function write_fig2(file="Rplot.pdf", width=10, height=5; show=true)
plot!(size=(width * 72, height * 72))
savefig(file)
if show
show_file(file)
end
end
# pwd()
df = fread("data-raw/02475000.csv")
```
Expand All @@ -31,20 +18,22 @@ x = df.q
date = df.date
TRS = quantile(x, 0.8)
df_peaks = findpeaks(x)
d2 = filter_peaks(df_peaks, minpeakheight=TRS, A_min=TRS*0.1, minpeakdistance=3)
@time d_peaks = findpeaks(x)
@time d_peaks = findpeaks_allen(x)
d2 = filter_peaks(d_peaks, minpeakheight=TRS, A_min=TRS * 0.1, minpeakdistance=3)
# info = @pipe filter(d -> !(d.status ∈ ["minpeakheight", "minpeakdistance"][1:1]), d2)
d2
# fwrite(info, "peak_info.csv")
# _[_.status .== "", :]
# _[_.status .== "", :]
# d_peaks = @pipe df_peaks |>
# filter(d -> d.val_peak >= TRS && d.h_min >= TRS*0.1, _)
# print(d_peaks)
# t_peak = date[d_peaks.pos_peak];
# val_peak = d_peaks.val_peak;
t_peak = date[d_peaks.pos_peak];
val_peak = d_peaks.val_peak;
```


Expand All @@ -68,5 +57,5 @@ scatter!(p, t_peak, val_peak,
label="Peak",
markercolor=:red,
markershape=:circle)
write_fig2("Rplot.pdf")
write_fig("Rplot.pdf")
```
4 changes: 3 additions & 1 deletion src/FindPeaks2.jl → src/VegSeasons.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module FindPeaks2
module VegSeasons

using DataFrames: DataFrame, sort!, nrow
using Statistics: mean, median


include("findpeaks.jl")
include("findpeaks_allen.jl")


end # module FindPeaks2
Loading

0 comments on commit d4eb23a

Please sign in to comment.