Skip to content

Commit

Permalink
Merge pull request #87 from SciML/formatting
Browse files Browse the repository at this point in the history
Formatting
  • Loading branch information
ChrisRackauckas authored Jun 8, 2023
2 parents cfffce6 + 9c982ee commit f49eeb3
Show file tree
Hide file tree
Showing 33 changed files with 2,740 additions and 2,043 deletions.
1 change: 0 additions & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
style = "sciml"
whitespace_in_kwargs = false
always_use_return = true
indent = 2
format_docstrings = true
join_lines_based_on_source = false
separate_kwargs_with_semicolon = true
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
version:
- '1'
- '1.6'
- '~1.9.0-0'
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.7]
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/FormatPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: format-pr
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".")'
# https://github.com/marketplace/actions/create-pull-request
# https://github.com/peter-evans/create-pull-request#reference-example
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Format .jl files
title: 'Automatic JuliaFormatter.jl run'
branch: auto-juliaformatter-pr
delete-branch: true
labels: formatting, automated pr, no changelog
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
16 changes: 16 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ rng = Random.default_rng()
Random.seed!(rng, seed)

model = Lux.Chain(Lux.Dense(2, 2),
DEQs.DeepEquilibriumNetwork(Lux.Parallel(+, Lux.Dense(2, 2; bias=false),
Lux.Dense(2, 2; bias=false)),
DEQs.ContinuousDEQSolver(; abstol=0.1f0,
reltol=0.1f0,
abstol_termination=0.1f0,
reltol_termination=0.1f0)))
DEQs.DeepEquilibriumNetwork(Lux.Parallel(+,
Lux.Dense(2, 2; bias=false),
Lux.Dense(2, 2; bias=false)),
DEQs.ContinuousDEQSolver(;
abstol=0.1f0,
reltol=0.1f0,
abstol_termination=0.1f0,
reltol_termination=0.1f0)))

ps, st = gpu.(Lux.setup(rng, model))
x = gpu(rand(rng, Float32, 2, 1))
Expand Down
34 changes: 20 additions & 14 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ bib = CitationBibliography(joinpath(@__DIR__, "ref.bib"); sorting=:nyt)

include("pages.jl")

makedocs(bib; sitename="Fast Deep Equilibrium Networks", authors="Avik Pal et al.",
clean=true, doctest=false, modules=[DeepEquilibriumNetworks],
strict=[
:doctest,
:linkcheck,
:parse_error,
:example_block,
# Other available options are
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block,
# :footnote, :meta_block, :missing_docs, :setup_block
], checkdocs=:all,
format=Documenter.HTML(; assets=["assets/favicon.ico"],
canonical="https://docs.sciml.ai/DeepEquilibriumNetworks/stable/"),
pages=pages)
makedocs(bib;
sitename="Fast Deep Equilibrium Networks",
authors="Avik Pal et al.",
clean=true,
doctest=false,
modules=[DeepEquilibriumNetworks],
strict=[
:doctest,
:linkcheck,
:parse_error,
:example_block,
# Other available options are
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block,
# :footnote, :meta_block, :missing_docs, :setup_block
],
checkdocs=:all,
format=Documenter.HTML(;
assets=["assets/favicon.ico"],
canonical="https://docs.sciml.ai/DeepEquilibriumNetworks/stable/"),
pages=pages)

deploydocs(; repo="github.com/SciML/DeepEquilibriumNetworks.jl.git", push_preview=true)
14 changes: 7 additions & 7 deletions docs/pages.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pages = [
"Home" => "index.md",
"Manual" => [
"Dynamical Systems" => "manual/solvers.md",
"DEQ Layers" => "manual/deqs.md",
"Miscellaneous" => "manual/misc.md",
],
"References" => "references.md",
"Home" => "index.md",
"Manual" => [
"Dynamical Systems" => "manual/solvers.md",
"DEQ Layers" => "manual/deqs.md",
"Miscellaneous" => "manual/misc.md",
],
"References" => "references.md",
]
14 changes: 8 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ rng = Random.default_rng()
Random.seed!(rng, seed)

model = Lux.Chain(Lux.Dense(2, 2),
DEQs.DeepEquilibriumNetwork(Lux.Parallel(+, Lux.Dense(2, 2; bias=false),
Lux.Dense(2, 2; bias=false)),
DEQs.ContinuousDEQSolver(; abstol=0.1f0,
reltol=0.1f0,
abstol_termination=0.1f0,
reltol_termination=0.1f0)))
DEQs.DeepEquilibriumNetwork(Lux.Parallel(+,
Lux.Dense(2, 2; bias=false),
Lux.Dense(2, 2; bias=false)),
DEQs.ContinuousDEQSolver(;
abstol=0.1f0,
reltol=0.1f0,
abstol_termination=0.1f0,
reltol_termination=0.1f0)))

ps, st = gpu.(Lux.setup(rng, model))
x = gpu(rand(rng, Float32, 2, 1))
Expand Down
Loading

0 comments on commit f49eeb3

Please sign in to comment.