From 146bcb460f542128b5df4a8a6f25db0454fdcb8f Mon Sep 17 00:00:00 2001 From: lucaferranti Date: Tue, 19 Sep 2023 10:41:26 +0300 Subject: [PATCH 1/3] update docs workflow --- .github/workflows/CI.yml | 24 ++++++++++++++++++++++++ .github/workflows/docscleanup.yml | 26 ++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docscleanup.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3bf06e4..92ab146 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -45,3 +45,27 @@ jobs: - uses: codecov/codecov-action@v1 with: file: lcov.info + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - run: | + julia --project=docs -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate()' + - run: | + julia --project=docs -e ' + using Documenter: DocMeta, doctest + using IntervalRootFinding + DocMeta.setdocmeta!(IntervalRootFinding, :DocTestSetup, :(using IntervalRootFinding); recursive=true) + doctest(IntervalRootFinding)' + - run: julia --project=docs docs/make.jl + env: + GKSwstype: nul # Fix for Plots with GR backend + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file diff --git a/.github/workflows/docscleanup.yml b/.github/workflows/docscleanup.yml new file mode 100644 index 0000000..22d9043 --- /dev/null +++ b/.github/workflows/docscleanup.yml @@ -0,0 +1,26 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v2 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "previews/PR$PRNUM" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "previews/PR$PRNUM" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + PRNUM: ${{ github.event.number }} \ No newline at end of file diff --git a/README.md b/README.md index aa6649e..7cb02aa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![coverage](https://codecov.io/gh/JuliaIntervals/IntervalRootFinding.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaIntervals/IntervalRootFinding.jl) -[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaintervals.github.io/pages/packages/intervalrootfinding/) +[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaintervals.github.io/IntervalRootFinding.jl/latest/) This package provides guaranteed methods for finding **roots** of functions, i.e. solutions to the equation `f(x) == 0` for a function `f`. To do so, it uses methods from interval analysis, using interval arithmetic from the [`IntervalArithmetic.jl`](https://github.com/JuliaIntervals/IntervalArithmetic.jl) package by the same authors. From b23e625b61f6da470a4bfb540bc8c690ea360f42 Mon Sep 17 00:00:00 2001 From: lucaferranti Date: Tue, 19 Sep 2023 10:43:09 +0300 Subject: [PATCH 2/3] avoid double running --- .github/workflows/CI.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 92ab146..37f1ec1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,7 +1,9 @@ name: CI on: - - push - - pull_request + push: + branches: + - master + pull_request: jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} From 2b36aa20a1ae59f683476428d6de5b3fdbe9500c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Richard?= Date: Thu, 30 May 2024 11:20:06 +0200 Subject: [PATCH 3/3] Remove the blocking docstring (will be removed in next PR anyway) --- src/krawczyk.jl | 6 +++--- src/newton.jl | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/krawczyk.jl b/src/krawczyk.jl index 206fc34..55e69f3 100644 --- a/src/krawczyk.jl +++ b/src/krawczyk.jl @@ -4,9 +4,9 @@ # const D = differentiate -"""Returns two intervals, the first being a point within the -interval x such that the interval corresponding to the derivative of f there -does not contain zero, and the second is the inverse of its derivative""" +# """Returns two intervals, the first being a point within the +# interval x such that the interval corresponding to the derivative of f there +# does not contain zero, and the second is the inverse of its derivative""" function guarded_derivative_midpoint(f::Function, f_prime::Function, x::Interval{T}) where {T} α = convert(T, 0.46875) # close to 0.5, but exactly representable as a floating point diff --git a/src/newton.jl b/src/newton.jl index 83f8180..f74b9c8 100644 --- a/src/newton.jl +++ b/src/newton.jl @@ -2,8 +2,8 @@ # Newton method -"""If a root is known to be inside an interval, -`newton_refine` iterates the interval Newton method until that root is found.""" +# """If a root is known to be inside an interval, +# `newton_refine` iterates the interval Newton method until that root is found.""" function newton_refine(f::Function, f_prime::Function, X::Union{Interval{T}, IntervalBox{N,T}}; tolerance=eps(T), debug=false) where {N,T} @@ -28,10 +28,10 @@ end -"""`newton` performs the interval Newton method on the given function `f` -with its optional derivative `f_prime` and initial interval `x`. -Optional keyword arguments give the `tolerance`, `maxlevel` at which to stop -subdividing, and a `debug` boolean argument that prints out diagnostic information.""" +# """`newton` performs the interval Newton method on the given function `f` +# with its optional derivative `f_prime` and initial interval `x`. +# Optional keyword arguments give the `tolerance`, `maxlevel` at which to stop +# subdividing, and a `debug` boolean argument that prints out diagnostic information.""" function newton(f::Function, f_prime::Function, x::Interval{T}, level::Int=0; tolerance=eps(T), debug=false, maxlevel=30) where {T}