Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9974d5b
Start defining main types
kellertuer Mar 14, 2025
6aff115
Setup docs and first actions.
kellertuer Mar 14, 2025
0231074
Setup tests.
kellertuer Mar 14, 2025
3239f6f
Start with stopping criteria.
kellertuer Mar 14, 2025
6106ce7
First steps towards stopping criterion.
kellertuer Mar 14, 2025
555eecb
Further on SC.
kellertuer Mar 14, 2025
fcdc02f
Towards the first plain interface.
kellertuer Mar 14, 2025
5c9b76f
fix compat.
kellertuer Mar 14, 2025
8bc978a
Fix make.jl
kellertuer Mar 14, 2025
64e98f9
Update docs/make.jl
kellertuer Mar 14, 2025
450cd2c
Fix an emoji typo.
kellertuer Mar 14, 2025
e6b4b99
update README.
kellertuer Mar 14, 2025
46f4ba6
Small typo
lkdvos Mar 14, 2025
2dab83b
Add simple test
lkdvos Mar 14, 2025
5ec3915
Actually run tests
lkdvos Mar 14, 2025
6e681e3
return `state`
lkdvos Mar 14, 2025
8115f5e
Start redesign
kellertuer Mar 15, 2025
8958870
Merge branch 'kellertuer/main-types' of github.com:JuliaManifolds/Alg…
kellertuer Mar 15, 2025
d4c9948
finish redesign.
kellertuer Mar 15, 2025
651577a
Implement most of StopWhenAny and StopWhenAll and their |, & operations.
kellertuer Mar 15, 2025
dff8c74
Update src/stopping_criterion.jl
kellertuer Mar 16, 2025
ba7bc85
Apply suggestions from code review
kellertuer Mar 16, 2025
0e98869
Update src/stopping_criterion.jl
kellertuer Mar 16, 2025
83b44ee
Update src/stopping_criterion.jl
kellertuer Mar 16, 2025
3ce717f
Update src/stopping_criterion.jl
kellertuer Mar 16, 2025
badca09
Update src/stopping_criterion.jl
kellertuer Mar 16, 2025
3460c22
Update src/stopping_criterion.jl
kellertuer Mar 30, 2025
1aeb445
A few points from the discussions
kellertuer Mar 30, 2025
7aa39b7
add context.
kellertuer Mar 30, 2025
6bb3f18
Refactor interface to have `problem, algorithm, state`
lkdvos Mar 31, 2025
2637011
longer argument names
lkdvos Mar 31, 2025
52ad3e9
Small fixes and adapt tests
lkdvos Mar 31, 2025
8d2ef32
Formatter
lkdvos Mar 31, 2025
a2dc6c2
refatctor stopping criterion and is_finished.
kellertuer Apr 8, 2025
8b18564
Update src/stopping_criterion.jl
kellertuer Apr 8, 2025
c2db111
Replace `get_` with `getproperty`
lkdvos Apr 11, 2025
1d88373
remove some intermediate buffers
lkdvos Apr 11, 2025
692bc44
fix typo
lkdvos Apr 11, 2025
0b4d003
Apply suggestions from formatter
lkdvos Apr 11, 2025
3380089
Fix indentation
lkdvos Apr 11, 2025
b29c16d
Merge branch 'kellertuer/main-types' of https://github.com/JuliaManif…
lkdvos Apr 11, 2025
965ac50
Add Aqua tests
lkdvos Apr 11, 2025
d2e9b12
remove manifest from git
lkdvos Apr 11, 2025
f8260dc
Add missing compat entry
lkdvos Apr 11, 2025
9be623d
Fix exports
lkdvos Apr 11, 2025
2b776d0
Add readme badges
lkdvos Apr 11, 2025
b467400
Add missing supertype
lkdvos Apr 11, 2025
38dba58
Add some tests for stopping criteria
lkdvos Apr 11, 2025
2ed240b
fix tests
lkdvos Apr 11, 2025
a087e62
Apply suggestions from code review
lkdvos Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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 }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI
on:
push:
branches: [master]
tags: [v*]
pull_request:

jobs:
test:
name: Julia ${{ matrix.julia-version }}–${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ["lts", "1", "pre"]
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: x64
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
env:
PYTHON: ""
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./lcov.info
name: codecov-umbrella
fail_ci_if_error: false
if: ${{ matrix.os =='ubuntu-latest' }}
26 changes: 26 additions & 0 deletions .github/workflows/clear_preview.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@v4
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 }}
65 changes: 65 additions & 0 deletions .github/workflows/documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Documenter
on:
push:
branches: [main]
tags: [v*]
pull_request:

jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
# if: contains( github.event.pull_request.labels.*.name, 'preview docs') || github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
# - uses: quarto-dev/quarto-actions/setup@v2
# with:
# version: "1.6.38"
- uses: julia-actions/setup-julia@latest
with:
version: "1.11"
- name: Julia Cache
uses: julia-actions/cache@v2
# - name: Cache Quarto
# id: cache-quarto
# uses: actions/cache@v4
# env:
# cache-name: cache-quarto
# with:
# path: tutorials/_freeze
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('tutorials/*.qmd') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-
# - name: Cache Documenter
# id: cache-documenter
# uses: actions/cache@v4
# env:
# cache-name: cache-documenter
# with:
# path: docs/src/tutorials
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('tutorials/*.qmd') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-
# - name: Cache CondaPkg
# id: cache-condaPkg
# uses: actions/cache@v4
# env:
# cache-name: cache-condapkg
# with:
# path: docs/.CondaPkg
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('docs/CondaPkg.toml') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-
- name: "Documenter rendering"
run: "docs/make.jl --quarto"
env:
PYTHON: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
# note:
# name: "Documentation deployment note."
# runs-on: ubuntu-latest
# if: "!contains( github.event.pull_request.labels.*.name, 'preview docs')"
# steps:
# - name: echo instructions
# run: echo 'The Documentation is only generated and pushed on a PR if the “preview docs” label is added.'
30 changes: 30 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Format
on:
push:
branches: [master]
tags: [v*]
pull_request:

jobs:
format:
name: "Format Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: 1
- uses: julia-actions/cache@v2
- name: Install JuliaFormatter and format
run: |
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter", version="1"))
using JuliaFormatter
format("."; verbose=true)
shell: julia --color=yes {0}
- name: Suggest formatting changes
uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
tool_name: JuliaFormatter
fail_on_error: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs/build
docs/Manifest.toml
Comment thread
kellertuer marked this conversation as resolved.
19 changes: 19 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.11.4"
manifest_format = "2.0"
project_hash = "95f2e526c8800bfc6b50be6b2a71dba6d896214b"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
version = "1.11.0"

[[deps.Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
version = "1.11.0"

[[deps.Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
version = "1.11.0"
16 changes: 14 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
name = "AlgorithmInterface"
uuid = "125df6b2-f2b1-44d3-9e4a-6c50c163a640"
name = "AlgorithmsInterface"
uuid = "d1e3940c-cd12-4505-8585-b0a4b322527d"
authors = ["Ronny Bergmann <git@ronnybergmann.net>"]
version = "0.1.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

[compat]
Dates = "1.10"
julia = "1.10"
[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
22 changes: 6 additions & 16 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IterativeAlgorithmsInterface.jl
# 🧮 AlgorithmsInterface.jl

`IterativeAlgorithmsInterface.jl` is a Julia package to provide a common interface to run iterative tasks. **Algorithm** here refers to an iterative sequence of commands, that are run until a certain stopping criterion is met.
`AlgorithmsInterface.jl` is a Julia package to provide a common interface to run iterative tasks. **Algorithm** here refers to an iterative sequence of commands, that are run until a certain stopping criterion is met.

# Statement of need

Expand All @@ -13,20 +13,10 @@ Finally, a common interface also allows to easily combine existing algorithms, h

# Main features

We consider solving _Tasks_, which consist of
See the [intial discussion](https://github.com/JuliaManifolds/AlgorithmsInterface.jl/discussions/1)
as well as the [overview on existing things](https://github.com/JuliaManifolds/AlgorithmsInterface.jl/discussions/2)

* An `AbstractProblem` to solve, which contains all information that is static to the problem and usually does not change during the iterations, this might for example be a cost function and its gradient in an optimisation problem.
* An `AbstractAlgorithmState` that both specifies which algorithm to use to _solve_ the problem, but also stores all parameters that an algorithm needs as well as everything the algorithm needs to store between two iterations.

This generic data structures are accompanied by the methods

* `step!(problem::Problem, state::AlgorithmState, k)` to perform the `k`th iteration of the algorithm.
* `solve!(problem::Problem, state::AlgorithmState)` to solve a problem with a given algorithm, which is identified by the `AlgorithmState`.
* `stop(problem::Problem, state::AlgorithmState)` to check whether the algorithm should stop.

where the first is the main one to implement for a new algorithm.

# Further ideas
## Further ideas

* generic stopping criteria `<:AbstractStoppingCriterion`
* `StopAfterIteration(i)` for example
Expand All @@ -35,7 +25,7 @@ where the first is the main one to implement for a new algorithm.
* by default `stop()` from above would check such a stopping criterion
* generic debug and record functionality – together with hooks even

# possible extensions
## Possible extensions

* to `LineSearches.jl`
*
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
AlgorithmsInterface = "d1e3940c-cd12-4505-8585-b0a4b322527d"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
53 changes: 53 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env julia
#
#

if "--help" ∈ ARGS
println("""
docs/make.jl

Render the `AlgorithmsInterface.jl` documentation with optional arguments

Arguments
* `--help` print this help and exit without rendering the documentation
* `--prettyurls` toggle the pretty urls part to true, which is always set on CI
""")
exit(0)
end

using Pkg
Pkg.activate(@__DIR__)
Pkg.develop(PackageSpec(; path = (@__DIR__) * "/../"))
Pkg.resolve()
Pkg.instantiate()

using Documenter, DocumenterCitations, DocumenterInterLinks
using AlgorithmsInterface

run_on_CI = (get(ENV, "CI", nothing) == "true")

bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style = :alpha)
links = InterLinks()
makedocs(;
format = Documenter.HTML(;
prettyurls = run_on_CI || ("--prettyurls" ∈ ARGS),
assets = [
# "assets/favicon.ico",
"assets/citations.css",
"assets/link-icons.css",
],
),
modules = [AlgorithmsInterface],
authors = "Ronny Bergmann, Lukas Devos, and contributors.",
sitename = "AlgorithmsInterface.jl",
pages = [
"Home" => "index.md",
"Interface" => "interface.md",
"Stopping criteria" => "stopping_criterion.md",
"References" => "references.md",
],
plugins = [bib, links],
)
deploydocs(; repo = "github.com/JuliaManifolds/AlgorithmsInterface.jl", push_preview = true)
#back to main env
Pkg.activate()
19 changes: 19 additions & 0 deletions docs/src/assets/citations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Taken from https://juliadocs.org/DocumenterCitations.jl/v1.2/styling/ */

.citation dl {
display: grid;
grid-template-columns: max-content auto; }
.citation dt {
grid-column-start: 1; }
.citation dd {
grid-column-start: 2;
margin-bottom: 0.75em; }
.citation ul {
padding: 0 0 2.25em 0;
margin: 0;
list-style: none;}
.citation ul li {
text-indent: -2.25em;
margin: 0.33em 0.5em 0.5em 2.25em;}
.citation ol li {
padding-left:0.75em;}
Loading