Skip to content

Commit d57fe09

Browse files
authoredJun 21, 2024··
Use Julia Pkg extensions and remove InteractiveDynamics (#206)
* update readme badges and CI * use pkg extrensions in project * add extension file * port docstrings into main package * update version * port source code here from InterDyn * port visualization doc file * update make.jl * add stdlib dependencies * add documentation workflow to correct folder * remove all refernecs to interactivedynamics * also from docs/project * remove this libass thing * fix typo in make.jl * add DataStructures to dependencies * fix the typos * fix all docs problems * finish all doc updates!!!!! * fix using latest makie version
1 parent d511071 commit d57fe09

29 files changed

+1505
-171
lines changed
 

‎.github/workflows/CompatHelper.yml

+36-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
name: CompatHelper
2-
32
on:
43
schedule:
5-
- cron: '00 * * * *'
6-
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
79
jobs:
810
CompatHelper:
9-
runs-on: ${{ matrix.os }}
10-
strategy:
11-
matrix:
12-
julia-version: [1]
13-
julia-arch: [x86]
14-
os: [ubuntu-latest]
11+
runs-on: ubuntu-latest
1512
steps:
16-
- uses: julia-actions/setup-julia@latest
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
1719
with:
18-
version: ${{ matrix.julia-version }}
19-
- name: Pkg.add("CompatHelper")
20-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
21-
- name: CompatHelper.main()
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
2242
env:
2343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
run: julia -e 'using CompatHelper; CompatHelper.main()'
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

‎.github/workflows/TagBot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
- uses: JuliaRegistries/TagBot@v1
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
15-
ssh: ${{ secrets.DOCUMENTER_KEY }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}

‎.github/workflows/ci.yml

+8-52
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
pull_request:
44
branches:
55
- master
6+
- '**' # matches every branch
67
push:
78
branches:
89
- master
@@ -16,7 +17,7 @@ jobs:
1617
matrix:
1718
version:
1819
- '1'
19-
os: [ubuntu-latest, windows-latest, macos-latest]
20+
os: [ubuntu-latest] # adjust according to need, e.g. os: [ubuntu-latest] if testing only on linux
2021
arch:
2122
- x64
2223
steps:
@@ -33,7 +34,7 @@ jobs:
3334
with:
3435
version: ${{ matrix.version }}
3536
arch: ${{ matrix.arch }}
36-
- uses: actions/cache@v2
37+
- uses: actions/cache@v1
3738
env:
3839
cache-name: cache-artifacts
3940
with:
@@ -43,55 +44,10 @@ jobs:
4344
${{ runner.os }}-test-${{ env.cache-name }}-
4445
${{ runner.os }}-test-
4546
${{ runner.os }}-
46-
- uses: julia-actions/julia-buildpkg@latest
47-
- uses: julia-actions/julia-runtest@latest
47+
- uses: julia-actions/julia-buildpkg@v1
4848

49-
docs:
50-
name: Documentation
51-
runs-on: ${{ matrix.os }}
52-
strategy:
53-
fail-fast: false
54-
matrix:
55-
version:
56-
- '1'
57-
os:
58-
- ubuntu-18.04
59-
arch:
60-
- x64
61-
steps:
62-
# Cancel ongoing documentation build if pushing to branch again before the previous
63-
# build is finished.
64-
- name: Cancel ongoing builds and checkout
65-
uses: styfle/cancel-workflow-action@0.6.0
49+
- uses: julia-actions/julia-runtest@v1
50+
- uses: julia-actions/julia-processcoverage@v1
51+
- uses: codecov/codecov-action@v1
6652
with:
67-
access_token: ${{ github.token }}
68-
- uses: actions/checkout@v2
69-
- uses: julia-actions/setup-julia@v1
70-
with:
71-
version: '1'
72-
- uses: actions/cache@v1
73-
env:
74-
cache-name: cache-artifacts
75-
with:
76-
path: ~/.julia/artifacts
77-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
78-
restore-keys: |
79-
${{ runner.os }}-test-${{ env.cache-name }}-
80-
${{ runner.os }}-test-
81-
${{ runner.os }}-
82-
- name: Install binary dependencies
83-
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
84-
- name: Install Julia dependencies
85-
run: >
86-
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
87-
julia --project=docs -e '
88-
using Pkg
89-
Pkg.develop(PackageSpec(path=pwd()))
90-
Pkg.instantiate()'
91-
- name: Generate documentation and deploy
92-
env: # needed for pushing to gh-pages branch
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
95-
run: >
96-
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
97-
julia --project=docs --color=yes docs/make.jl
53+
file: lcov.info

‎.github/workflows/doccleanup.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ jobs:
1212
uses: actions/checkout@v2
1313
with:
1414
ref: gh-pages
15-
16-
- name: Delete preview and history
15+
- name: Delete preview and history + push changes
1716
run: |
18-
git config user.name "Documenter.jl"
19-
git config user.email "documenter@juliadocs.github.io"
20-
git rm -rf "previews/PR$PRNUM"
21-
git commit -m "delete preview"
22-
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
17+
if [ -d "previews/PR$PRNUM" ]; then
18+
git config user.name "Documenter.jl"
19+
git config user.email "documenter@juliadocs.github.io"
20+
git rm -rf "previews/PR$PRNUM"
21+
git commit -m "delete preview"
22+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
23+
git push --force origin gh-pages-new:gh-pages
24+
fi
2325
env:
24-
PRNUM: ${{ github.event.number }}
25-
26-
- name: Push changes
27-
run: |
28-
git push --force origin gh-pages-new:gh-pages
26+
PRNUM: ${{ github.event.number }}

‎.github/workflows/documentation.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: julia-actions/setup-julia@v1
18+
with:
19+
version: '1'
20+
- name: Install dependencies
21+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
22+
- name: Build and deploy
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
25+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
26+
run: julia --project=docs/ docs/make.jl

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Manifest.toml
44
update*
55
*.scss
66
*.css
7+
*.mp4

‎Project.toml

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicalBilliards"
22
uuid = "4986ee89-4ee5-5cef-b6b8-e49ba721d7a5"
33
repo = "https://github.com/JuliaDynamics/DynamicalBilliards.jl.git"
4-
version = "4.0.0"
4+
version = "4.1.0"
55

66
[deps]
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
@@ -12,8 +12,20 @@ Scratch = "6c6a2e73-6563-6170-7368-637461726353"
1212
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1313
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1414

15+
[weakdeps]
16+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
17+
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
18+
19+
[extensions]
20+
DynamicalBilliardsVisualizations = ["Makie", "DataStructures"]
21+
1522
[compat]
1623
Elliptic = "1"
1724
Scratch = "1"
1825
StaticArrays = "1"
19-
julia = "1"
26+
InteractiveUtils = "1"
27+
LinearAlgebra = "1"
28+
Distributed = "1"
29+
DataStructures = "0.18"
30+
Makie = "≥ 0.19"
31+
julia = "1.9"

‎README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
A Julia package for dynamical billiard systems in two dimensions.
44
The goals of the package is to provide a flexible and intuitive framework for fast implementation of billiard systems of arbitrary construction.
55

6-
| **Documentation** | **Citation** | **Travis** | **Gitter** |
7-
|:--------:|:--------:|:---------------:|:-----:|
8-
|[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaDynamics.github.io/DynamicalBilliards.jl/dev), [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaDynamics.github.io/DynamicalBilliards.jl/stable)| [![status](http://joss.theoj.org/papers/753469f6b18c9c38127a7727d13c87cd/status.svg)](http://joss.theoj.org/papers/753469f6b18c9c38127a7727d13c87cd) | [![Build Status](https://travis-ci.org/JuliaDynamics/DynamicalBilliards.jl.svg?branch=master)](https://travis-ci.org/JuliaDynamics/DynamicalBilliards.jl) | [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/JuliaDynamics/Lobby)
6+
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaDynamics.github.io/DynamicalBilliards.jl/dev)
7+
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaDynamics.github.io/DynamicalBilliards.jl/stable)
8+
[![CI](https://github.com/JuliaDynamics/DynamicalBilliards.jl/workflows/CI/badge.svg)](https://github.com/JuliaDynamics/DynamicalBilliards.jl/actions?query=workflow%3ACI)
9+
[![codecov](https://codecov.io/gh/JuliaDynamics/DynamicalBilliards.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaDynamics/DynamicalBilliards.jl)
10+
[![citation](http://joss.theoj.org/papers/753469f6b18c9c38127a7727d13c87cd/status.svg)](http://joss.theoj.org/papers/753469f6b18c9c38127a7727d13c87cd)
911

1012
If you have used this package for research that resulted in a publication, please be kind enough to cite the papers listed in the [CITATION.bib](CITATION.bib) file.
1113

1214
## Features
15+
1316
Please see the [documentation](https://JuliaDynamics.github.io/DynamicalBilliards.jl/dev) for list of features, tutorials and installation instructions.
1417

1518
## Acknowledgements
19+
1620
This package is mainly developed by George Datseris. However, this development would not have been possible without significant help from other people:
1721

1822
1. [Lukas Hupe](https://github.com/lhupe)(@lhupe) Contributed the lyapunov spectrum calculation for magnetic propagation, implemented the boundary map function and did other contributions in bringing this package to version 2.0 (see [here](https://github.com/JuliaDynamics/DynamicalBilliards.jl/projects/1)).

‎docs/Project.toml

-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,5 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
55
DynamicalBilliards = "4986ee89-4ee5-5cef-b6b8-e49ba721d7a5"
6-
InteractiveDynamics = "ec714cd0-5f51-11eb-0b6e-452e7367ff84"
76
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
87
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
9-
libsass_jll = "47bcb7c8-5119-555a-9eeb-0afcc36cd728"
10-
11-
[compat]
12-
Documenter = "0.24.6"
13-
libsass_jll = "~3.5"

‎docs/build_docs_with_style.jl

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing
2+
3+
import Pkg
4+
Pkg.pkg"add Documenter@1"
5+
6+
# Load documenter
7+
using Documenter
8+
using DocumenterTools: Themes
9+
ENV["JULIA_DEBUG"] = "Documenter"
10+
11+
# For easier debugging when downloading from a specific branch.
12+
github_user = "JuliaDynamics"
13+
branch = "master"
14+
download_path = "https://raw.githubusercontent.com/$github_user/doctheme/$branch"
15+
16+
import Downloads
17+
for file in ("juliadynamics-lightdefs.scss", "juliadynamics-darkdefs.scss", "juliadynamics-style.scss")
18+
Downloads.download("$download_path/$file", joinpath(@__DIR__, file))
19+
end
20+
21+
# create the themes
22+
for w in ("light", "dark")
23+
header = read(joinpath(@__DIR__, "juliadynamics-style.scss"), String)
24+
theme = read(joinpath(@__DIR__, "juliadynamics-$(w)defs.scss"), String)
25+
write(joinpath(@__DIR__, "juliadynamics-$(w).scss"), header*"\n"*theme)
26+
end
27+
28+
# compile the themes
29+
Themes.compile(joinpath(@__DIR__, "juliadynamics-light.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-light.css"))
30+
Themes.compile(joinpath(@__DIR__, "juliadynamics-dark.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-dark.css"))
31+
32+
# Download and apply CairoMakie plotting style
33+
using CairoMakie
34+
Downloads.download("$download_path/style.jl", joinpath(@__DIR__, "style.jl"))
35+
include("style.jl")
36+
37+
"""
38+
build_docs_with_style(pages::Vector, modules... ;
39+
bib = nothing, authors = "George Datseris and contributors",
40+
htmlkw = NamedTuple(), kw...
41+
)
42+
43+
Call the `makedocs` function with some predefined style components.
44+
The first module dictates site name, while the rest need to be included
45+
to expand and cross-referrence docstrings from other modules.
46+
`kw` are propagated to `makedocs` while `htmlkw` are propagated to
47+
`Documenter.HTML`.
48+
"""
49+
function build_docs_with_style(pages, modules...;
50+
bib = nothing, authors = "George Datseris", draft = false,
51+
htmlkw = NamedTuple(), kwargs...
52+
)
53+
settings = (
54+
modules = [modules...],
55+
format = Documenter.HTML(;
56+
prettyurls = CI,
57+
assets = [
58+
asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css),
59+
],
60+
collapselevel = 3,
61+
htmlkw...,
62+
),
63+
sitename = "$(modules[1]).jl",
64+
authors,
65+
pages,
66+
draft,
67+
doctest = false,
68+
checkdocs = :exported,
69+
linkcheck_timeout = 2,
70+
# The following Documenter fails will NOT ERROR the docbuild!
71+
warnonly = [:doctest, :missing_docs],
72+
kwargs...
73+
)
74+
75+
if isnothing(bib)
76+
makedocs(; settings...)
77+
else
78+
makedocs(; plugins=[bib], settings...)
79+
end
80+
81+
if CI
82+
deploydocs(
83+
repo = "github.com/JuliaDynamics/$(modules[1]).jl.git",
84+
target = "build",
85+
push_preview = true
86+
)
87+
end
88+
89+
end

0 commit comments

Comments
 (0)
Please sign in to comment.