Skip to content

Commit 858f3d1

Browse files
authored
Merge pull request #7 from SciML/smc/cleanup
Cleanup
2 parents 092469d + e76c4b5 commit 858f3d1

File tree

7 files changed

+34
-56
lines changed

7 files changed

+34
-56
lines changed

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
nin = "nin"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# UDEComponents
22

3-
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://SebastianM-C.github.io/UDEComponents.jl/stable/)
4-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://SebastianM-C.github.io/UDEComponents.jl/dev/)
5-
[![Build Status](https://github.com/SebastianM-C/UDEComponents.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/SebastianM-C/UDEComponents.jl/actions/workflows/CI.yml?query=branch%3Amain)
6-
[![Coverage](https://codecov.io/gh/SebastianM-C/UDEComponents.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/SebastianM-C/UDEComponents.jl)
3+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://SciML.github.io/UDEComponents.jl/stable/)
4+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://SciML.github.io/UDEComponents.jl/dev/)
5+
[![Build Status](https://github.com/SciML/UDEComponents.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/SciML/UDEComponents.jl/actions/workflows/CI.yml?query=branch%3Amain)
6+
[![Coverage](https://codecov.io/gh/SciML/UDEComponents.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/SciML/UDEComponents.jl)
77
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
88
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
99

docs/make.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
using UDEComponents
22
using Documenter
33

4-
DocMeta.setdocmeta!(UDEComponents, :DocTestSetup, :(using UDEComponents); recursive=true)
4+
DocMeta.setdocmeta!(UDEComponents, :DocTestSetup, :(using UDEComponents); recursive = true)
55

66
makedocs(;
7-
modules=[UDEComponents],
8-
authors="Sebastian Micluța-Câmpeanu <[email protected]> and contributors",
9-
sitename="UDEComponents.jl",
10-
format=Documenter.HTML(;
11-
canonical="https://SebastianM-C.github.io/UDEComponents.jl",
12-
edit_link="main",
13-
assets=String[],
7+
modules = [UDEComponents],
8+
authors = "Sebastian Micluța-Câmpeanu <[email protected]> and contributors",
9+
sitename = "UDEComponents.jl",
10+
format = Documenter.HTML(;
11+
canonical = "https://SciML.github.io/UDEComponents.jl",
12+
edit_link = "main",
13+
assets = String[]
1414
),
15-
pages=[
16-
"Home" => "index.md",
17-
],
15+
pages = [
16+
"Home" => "index.md"
17+
]
1818
)
1919

2020
deploydocs(;
21-
repo="github.com/SebastianM-C/UDEComponents.jl",
22-
devbranch="main",
21+
repo = "github.com/SciML/UDEComponents.jl",
22+
devbranch = "main"
2323
)

src/UDEComponents.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ include("utils.jl")
1515
include("hacks.jl") # this should be removed / upstreamed
1616

1717
"""
18-
1918
create_ude_component(n_input = 1, n_output = 1;
2019
chain = multi_layer_feed_forward(n_input, n_output),
2120
rng = Xoshiro(0))

src/utils.jl

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
function multi_layer_feed_forward(input_length, output_length; width::Int = 5,
2-
depth::Int = 1, activation = softplus)
2+
depth::Int = 1, activation = softplus, disable_optimizations = false)
33
Lux.Chain(Lux.Dense(input_length, width, activation),
44
[Lux.Dense(width, width, activation) for _ in 1:(depth)]...,
5-
Lux.Dense(width, output_length); disable_optimizations = true)
5+
Lux.Dense(width, output_length); disable_optimizations)
66
end
7-
8-
# Symbolics.@register_array_symbolic print_input(x) begin
9-
# size = size(x)
10-
# eltype = eltype(x)
11-
# end
12-
13-
# function print_input(x)
14-
# @info x
15-
# x
16-
# end
17-
18-
# function debug_component(n_input, n_output)
19-
# @named input = RealInput(nin = n_input)
20-
# @named output = RealOutput(nout = n_output)
21-
22-
# eqs = [output.u ~ print_input(input.u)]
23-
24-
# @named dbg_comp = ODESystem(eqs, t_nounits, [], [], systems = [input, output])
25-
# end

test/lotka_volterra.jl

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ end
4343
model = lotka_ude()
4444
nn = create_ude_component(2, 2)
4545

46-
eqs = [
47-
connect(model.nn_in, nn.output)
48-
connect(model.nn_out, nn.input)
49-
]
46+
eqs = [connect(model.nn_in, nn.output)
47+
connect(model.nn_out, nn.input)]
5048

5149
ude_sys = complete(ODESystem(
5250
eqs, ModelingToolkit.t_nounits, systems = [model, nn], name = :ude_sys))
@@ -83,7 +81,6 @@ function loss(x, (prob, sol_ref, get_vars, get_refs))
8381
end
8482
end
8583

86-
8784
of = OptimizationFunction{true}(loss, AutoForwardDiff())
8885

8986
ps = (prob, sol_ref, get_vars, get_refs);
@@ -95,20 +92,19 @@ ps = (prob, sol_ref, get_vars, get_refs);
9592

9693
op = OptimizationProblem(of, x0, (prob, sol_ref, get_vars, get_refs))
9794

98-
9995
# using Plots
10096

10197
# oh = []
10298

103-
plot_cb = (opt_state, loss) -> begin
104-
@info "step $(opt_state.iter), loss: $loss"
105-
# push!(oh, opt_state)
106-
# new_p = SciMLStructures.replace(Tunable(), prob.p, opt_state.u)
107-
# new_prob = remake(prob, p = new_p)
108-
# sol = solve(new_prob, Rodas4())
109-
# display(plot(sol))
110-
false
111-
end
99+
# plot_cb = (opt_state, loss) -> begin
100+
# @info "step $(opt_state.iter), loss: $loss"
101+
# push!(oh, opt_state)
102+
# new_p = SciMLStructures.replace(Tunable(), prob.p, opt_state.u)
103+
# new_prob = remake(prob, p = new_p)
104+
# sol = solve(new_prob, Rodas4())
105+
# display(plot(sol))
106+
# false
107+
# end
112108

113109
res = solve(op, Adam(), maxiters = 2000)#, callback = plot_cb)
114110

test/qa.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ using UDEComponents
33
using Aqua
44
using JET
55

6-
@testset verbose = true "Code quality (Aqua.jl)" begin
6+
@testset verbose=true "Code quality (Aqua.jl)" begin
77
Aqua.find_persistent_tasks_deps(UDEComponents)
88
Aqua.test_ambiguities(UDEComponents, recursive = false)
99
Aqua.test_deps_compat(UDEComponents)
1010
# TODO: fix type piracy in propagate_ndims and propagate_shape
11-
Aqua.test_piracies(UDEComponents, broken=true)
11+
Aqua.test_piracies(UDEComponents, broken = true)
1212
Aqua.test_project_extras(UDEComponents)
1313
Aqua.test_stale_deps(UDEComponents, ignore = Symbol[])
1414
Aqua.test_unbound_args(UDEComponents)

0 commit comments

Comments
 (0)