Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check Changelog
on:
pull_request:

jobs:
Check-Changelog:
name: Check Changelog Action
runs-on: ubuntu-latest
steps:
- uses: tarides/changelog-check-action@v3
with:
changelog: Changelog.md
13 changes: 13 additions & 0 deletions .github/workflows/spell_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request, workflow_dispatch]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v6
- name: Check spelling
uses: crate-ci/typos@v1.45.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docs/build
docs/Manifest.toml
Manifest.toml
docs/src/changelog.md
10 changes: 10 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable Changes to the Julia package `AlgorithmsInterface.jl` are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] 2026/05/01

Initial release.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AlgorithmsInterface"
uuid = "d1e3940c-cd12-4505-8585-b0a4b322527d"
authors = ["Ronny Bergmann <git@ronnybergmann.net>"]
authors = ["Ronny Bergmann <git@ronnybergmann.net>", "Lukas Devos <ldevos98@gmail.com>"]
version = "0.1.0"

[deps]
Expand All @@ -16,4 +16,3 @@ julia = "1.10"

[workspace]
projects = ["test", "docs"]

7 changes: 5 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`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.

[![docs][docs-dev-img]][docs-dev-url] [![CI][ci-img]][ci-url] [![runic][runic-img]][runic-url] [![codecov][codecov-img]][codecov-url]
[![docs][docs-dev-img]][docs-dev-url] [![CI][ci-img]][ci-url] [![runic][runic-img]][runic-url] [![codecov][codecov-img]][codecov-url] [![aqua][aqua-img]][aqua-url]

[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://JuliaManifolds.github.io/AlgorithmsInterface.jl/dev/
Expand All @@ -17,6 +17,9 @@
[runic-img]: https://img.shields.io/badge/code_style-%E1%9A%B1%E1%9A%A2%E1%9A%BE%E1%9B%81%E1%9A%B2-black
[runic-url]: https://github.com/fredrikekre/Runic.jl

[aqua-img]: https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg
[aqua-url]: https://github.com/JuliaTesting/Aqua.jl

# Statement of need

A first approach to algorithms is a simple for-loop for a maximum number of iterations.
Expand All @@ -28,7 +31,7 @@ Finally, a common interface also allows to easily combine existing algorithms, h

# Main features

See the [intial discussion](https://github.com/JuliaManifolds/AlgorithmsInterface.jl/discussions/1)
See the [initial 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)

## Further ideas
Expand Down
63 changes: 56 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,62 @@ if "--help" ∈ ARGS
exit(0)
end

using Pkg
Pkg.activate(@__DIR__)
Pkg.develop(PackageSpec(; path = (@__DIR__) * "/../"))
Pkg.resolve()
Pkg.instantiate()
# if docs is not the current active environment, switch to it
# (from https://github.com/JuliaIO/HDF5.jl/pull/1020/) 
if Base.active_project() != joinpath(@__DIR__, "Project.toml")
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
end

#
# Load packages
using Documenter, DocumenterCitations, DocumenterInterLinks
using AlgorithmsInterface

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

#
# Copy and reformat changelog

# (d) add contributing.md and changelog.md to the docs – and link to releases and issues

function add_links(line::String, url::String = "https://github.com/JuliaManifolds/Manopt.jl")
# replace issues (#XXXX) -> ([#XXXX](url/issue/XXXX))
while (m = match(r"\(\#([0-9]+)\)", line)) !== nothing
id = m.captures[1]
line = replace(line, m.match => "([#$id]($url/issues/$id))")
end
# replace ## [X.Y.Z] -> with a link to the release [X.Y.Z](url/releases/tag/vX.Y.Z)
while (m = match(r"\#\# \[([0-9]+.[0-9]+.[0-9]+)\] (.*)", line)) !== nothing
tag = m.captures[1]
date = m.captures[2]
line = replace(line, m.match => "## [$tag]($url/releases/tag/v$tag) ($date)")
end
return line
end

generated_path = joinpath(@__DIR__, "src")
base_url = "https://github.com/JuliaManifolds/Manopt.jl/blob/master/"
isdir(generated_path) || mkdir(generated_path)
for (md_file, doc_file) in [("Changelog.md", "changelog.md")]
open(joinpath(generated_path, doc_file), "w") do io
# Point to source license file
println(
io,
"""
```@meta
EditURL = "$(base_url)$(md_file)"
```
""",
)
# Write the contents out below the meta block
for line in eachline(joinpath(dirname(@__DIR__), md_file))
println(io, add_links(line))
end
end
end

bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style = :alpha)
links = InterLinks()
makedocs(;
Expand All @@ -47,8 +92,12 @@ makedocs(;
"Interface" => "interface.md",
"Stopping criteria" => "stopping_criterion.md",
"Logging" => "logging.md",
"Notation" => "notation.md",
"References" => "references.md",
"Miscellanea" => [
"Internals" => "internals.md",
"Notation" => "notation.md",
"Changelog" => "changelog.md",
"References" => "references.md",
],
],
expandfirst = ["interface.md", "stopping_criterion.md"],
plugins = [bib, links],
Expand Down
File renamed without changes
Binary file removed docs/src/assets/logo-text-dark.png
Binary file not shown.
Binary file removed docs/src/assets/logo-text-readme-dark.png
Binary file not shown.
Binary file removed docs/src/assets/logo-text-readme.png
Binary file not shown.
Binary file removed docs/src/assets/logo-text.png
Binary file not shown.
15 changes: 15 additions & 0 deletions docs/src/internals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Internals

## Test

```@docs
AlgorithmsInterface.Test
```

```@autodocs
Modules = [AlgorithmsInterface]
Pages = ["test_suite.jl"]
Order = [:type, :function]
Private = true
Public = true
```
4 changes: 2 additions & 2 deletions docs/src/stopping_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function AlgorithmsInterface.initialize_state!(problem::SqrtProblem, algorithm::
# reset the state for the algorithm
state.iterate = rand()
state.iteration = 0

# reset the state for the stopping criterion
state = AlgorithmsInterface.initialize_state!(
problem, algorithm, algorithm.stopping_criterion, state.stopping_criterion_state
Expand Down Expand Up @@ -244,7 +244,7 @@ criterion = StopWhenStable(1e-8)
heron_sqrt(16.0; stopping_criterion = criterion)
```

Note that our work payed off, as we can still compose this stopping criterion with other criteria as well:
Note that our work payd off, as we can still compose this stopping criterion with other criteria as well:

```@example Heron
criterion = StopWhenStable(1e-8) | StopAfterIteration(5)
Expand Down
2 changes: 2 additions & 0 deletions src/AlgorithmsInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ include("interface/interface.jl")
include("stopping_criterion.jl")
include("logging.jl")

include("test_suite.jl")

# general interface
export Algorithm, Problem, State
export initialize_state, initialize_state!
Expand Down
Loading
Loading