Skip to content

Commit

Permalink
Use Julia Pkg extensions and remove InteractiveDynamics (#206)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Datseris authored Jun 21, 2024
1 parent d511071 commit d57fe09
Show file tree
Hide file tree
Showing 29 changed files with 1,505 additions and 171 deletions.
51 changes: 36 additions & 15 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
name: CompatHelper

on:
schedule:
- cron: '00 * * * *'

- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- 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 }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
2 changes: 1 addition & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
60 changes: 8 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- master
- '**' # matches every branch
push:
branches:
- master
Expand All @@ -16,7 +17,7 @@ jobs:
matrix:
version:
- '1'
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest] # adjust according to need, e.g. os: [ubuntu-latest] if testing only on linux
arch:
- x64
steps:
Expand All @@ -33,7 +34,7 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v2
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
Expand All @@ -43,55 +44,10 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-buildpkg@v1

docs:
name: Documentation
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1'
os:
- ubuntu-18.04
arch:
- x64
steps:
# Cancel ongoing documentation build if pushing to branch again before the previous
# build is finished.
- name: Cancel ongoing builds and checkout
uses: styfle/[email protected]
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install binary dependencies
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
- name: Install Julia dependencies
run: >
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: Generate documentation and deploy
env: # needed for pushing to gh-pages branch
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: >
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
julia --project=docs --color=yes docs/make.jl
file: lcov.info
22 changes: 10 additions & 12 deletions .github/workflows/doccleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ jobs:
uses: actions/checkout@v2
with:
ref: gh-pages

- name: Delete preview and history
- name: Delete preview and history + push changes
run: |
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
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 }}

- name: Push changes
run: |
git push --force origin gh-pages-new:gh-pages
PRNUM: ${{ github.event.number }}
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Documentation

on:
push:
branches:
- main
tags: '*'
pull_request:

jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia --project=docs/ docs/make.jl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Manifest.toml
update*
*.scss
*.css
*.mp4
16 changes: 14 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DynamicalBilliards"
uuid = "4986ee89-4ee5-5cef-b6b8-e49ba721d7a5"
repo = "https://github.com/JuliaDynamics/DynamicalBilliards.jl.git"
version = "4.0.0"
version = "4.1.0"

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

[weakdeps]
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

[extensions]
DynamicalBilliardsVisualizations = ["Makie", "DataStructures"]

[compat]
Elliptic = "1"
Scratch = "1"
StaticArrays = "1"
julia = "1"
InteractiveUtils = "1"
LinearAlgebra = "1"
Distributed = "1"
DataStructures = "0.18"
Makie = "≥ 0.19"
julia = "1.9"
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
A Julia package for dynamical billiard systems in two dimensions.
The goals of the package is to provide a flexible and intuitive framework for fast implementation of billiard systems of arbitrary construction.

| **Documentation** | **Citation** | **Travis** | **Gitter** |
|:--------:|:--------:|:---------------:|:-----:|
|[![](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)
[![](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)
[![CI](https://github.com/JuliaDynamics/DynamicalBilliards.jl/workflows/CI/badge.svg)](https://github.com/JuliaDynamics/DynamicalBilliards.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/JuliaDynamics/DynamicalBilliards.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaDynamics/DynamicalBilliards.jl)
[![citation](http://joss.theoj.org/papers/753469f6b18c9c38127a7727d13c87cd/status.svg)](http://joss.theoj.org/papers/753469f6b18c9c38127a7727d13c87cd)

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.

## Features

Please see the [documentation](https://JuliaDynamics.github.io/DynamicalBilliards.jl/dev) for list of features, tutorials and installation instructions.

## Acknowledgements

This package is mainly developed by George Datseris. However, this development would not have been possible without significant help from other people:

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)).
Expand Down
6 changes: 0 additions & 6 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
DynamicalBilliards = "4986ee89-4ee5-5cef-b6b8-e49ba721d7a5"
InteractiveDynamics = "ec714cd0-5f51-11eb-0b6e-452e7367ff84"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
libsass_jll = "47bcb7c8-5119-555a-9eeb-0afcc36cd728"

[compat]
Documenter = "0.24.6"
libsass_jll = "~3.5"
89 changes: 89 additions & 0 deletions docs/build_docs_with_style.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing

import Pkg
Pkg.pkg"add Documenter@1"

# Load documenter
using Documenter
using DocumenterTools: Themes
ENV["JULIA_DEBUG"] = "Documenter"

# For easier debugging when downloading from a specific branch.
github_user = "JuliaDynamics"
branch = "master"
download_path = "https://raw.githubusercontent.com/$github_user/doctheme/$branch"

import Downloads
for file in ("juliadynamics-lightdefs.scss", "juliadynamics-darkdefs.scss", "juliadynamics-style.scss")
Downloads.download("$download_path/$file", joinpath(@__DIR__, file))
end

# create the themes
for w in ("light", "dark")
header = read(joinpath(@__DIR__, "juliadynamics-style.scss"), String)
theme = read(joinpath(@__DIR__, "juliadynamics-$(w)defs.scss"), String)
write(joinpath(@__DIR__, "juliadynamics-$(w).scss"), header*"\n"*theme)
end

# compile the themes
Themes.compile(joinpath(@__DIR__, "juliadynamics-light.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-light.css"))
Themes.compile(joinpath(@__DIR__, "juliadynamics-dark.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-dark.css"))

# Download and apply CairoMakie plotting style
using CairoMakie
Downloads.download("$download_path/style.jl", joinpath(@__DIR__, "style.jl"))
include("style.jl")

"""
build_docs_with_style(pages::Vector, modules... ;
bib = nothing, authors = "George Datseris and contributors",
htmlkw = NamedTuple(), kw...
)
Call the `makedocs` function with some predefined style components.
The first module dictates site name, while the rest need to be included
to expand and cross-referrence docstrings from other modules.
`kw` are propagated to `makedocs` while `htmlkw` are propagated to
`Documenter.HTML`.
"""
function build_docs_with_style(pages, modules...;
bib = nothing, authors = "George Datseris", draft = false,
htmlkw = NamedTuple(), kwargs...
)
settings = (
modules = [modules...],
format = Documenter.HTML(;
prettyurls = CI,
assets = [
asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css),
],
collapselevel = 3,
htmlkw...,
),
sitename = "$(modules[1]).jl",
authors,
pages,
draft,
doctest = false,
checkdocs = :exported,
linkcheck_timeout = 2,
# The following Documenter fails will NOT ERROR the docbuild!
warnonly = [:doctest, :missing_docs],
kwargs...
)

if isnothing(bib)
makedocs(; settings...)
else
makedocs(; plugins=[bib], settings...)
end

if CI
deploydocs(
repo = "github.com/JuliaDynamics/$(modules[1]).jl.git",
target = "build",
push_preview = true
)
end

end
Loading

0 comments on commit d57fe09

Please sign in to comment.