Skip to content

Commit

Permalink
update docs workflow (#194)
Browse files Browse the repository at this point in the history
* update docs workflow

* avoid double running

* Remove the blocking docstring (will be removed in next PR anyway)

---------

Co-authored-by: Benoît Richard <kolaru@hotmail.com>
  • Loading branch information
lucaferranti and Kolaru committed May 30, 2024
1 parent 754c005 commit e7a6631
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 12 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down Expand Up @@ -45,3 +47,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 }}
26 changes: 26 additions & 0 deletions .github/workflows/docscleanup.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/krawczyk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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}

Expand Down

0 comments on commit e7a6631

Please sign in to comment.