Skip to content

Commit

Permalink
Merge branch 'release-0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Sep 27, 2019
2 parents 2284a90 + a0a251e commit ad0f733
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 164 deletions.
19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: julia
julia:
- 0.6
- 0.7
- 1.0
- 1.1
- 1.2
- 1.3
- nightly
notifications:
email: false
Expand All @@ -23,18 +23,11 @@ jobs:
script:
- julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
- julia --project=docs/ docs/make.jl
- <<: *docs
julia: 0.7
script:
- julia --project=docs/ -e 'using Pkg; Pkg.instantiate()'
- julia -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()))'
- julia --project=docs/ docs/make.jl
- <<: *docs
julia: 1.1
- <<: *docs
julia: nightly
julia: 1.2
- <<: *docs
julia: 0.6
script:
- julia -e 'Pkg.add("Documenter", v"0.19.6", v"0.19.6+"); Pkg.clone(pwd())'
- julia docs/make.jl
julia: 1.3
- <<: *docs
julia: nightly
28 changes: 28 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name = "ACME"
uuid = "ca8b7239-ccd3-5cce-807f-2072f3f0d108"
version = "0.9.0"

[deps]
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
IterTools = "1"
OrderedCollections = "1"
ProgressMeter = "0.6, 0.7, 0.8, 0.9, 1"
StaticArrays = "0.8, 0.9, 0.10, 0.11"
julia = "1"

[extras]
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"

[targets]
test = ["Test", "FFTW", "SparseArrays"]
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ACME.jl - Analog Circuit Modeling and Emulation for Julia

[![Join the chat at https://gitter.im/HSU-ANT/ACME.jl](https://badges.gitter.im/HSU-ANT/ACME.jl.svg)](https://gitter.im/HSU-ANT/ACME.jl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Documentation](https://img.shields.io/badge/docs-v0.8.0-blue.svg)](https://hsu-ant.github.io/ACME.jl/v0.8.0/)
[![Documentation](https://img.shields.io/badge/docs-v0.9.0-blue.svg)](https://hsu-ant.github.io/ACME.jl/v0.9.0/)
[![DOI](https://zenodo.org/badge/48224425.svg)](https://zenodo.org/badge/latestdoi/48224425)


ACME is a [Julia](http://julialang.org/) package for the simulation of
electrical circuits, focusing on audio effect circuits. It allows to
Expand Down Expand Up @@ -122,7 +124,7 @@ fail to run altogether.

## Moving on

There is some [documentation](https://hsu-ant.github.io/ACME.jl/v0.8.0/)
There is some [documentation](https://hsu-ant.github.io/ACME.jl/v0.9.0/)
available for how
to use ACME. Additionally, you can take a look at the examples that can be found
in the `examples` directory below `Pkg.dir("ACME")`.
Expand Down
6 changes: 0 additions & 6 deletions REQUIRE

This file was deleted.

File renamed without changes.
51 changes: 23 additions & 28 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "49269e311ffe11ac5b334681d212329002a9832a"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "1.5.1"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "1df01539a1c952cef21f2d2d1c092c2bcf0177d7"
git-tree-sha1 = "0513f1a8991e9d83255e0140aace0d0fc4486600"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.6.0"
version = "0.8.0"

[DocStringExtensions.deps]
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[Documenter]]
deps = ["Compat", "DocStringExtensions", "Logging", "REPL"]
git-tree-sha1 = "d7b6266f1f87a8c85ce4c1f9c0e9ba3b7831ce1d"
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "1b6ae3796f60311e39cd1770566140d2c056e87f"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.19.7"
version = "0.23.3"

[[InteractiveUtils]]
deps = ["LinearAlgebra", "Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.0"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

Expand All @@ -55,6 +56,12 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "ef0af6c8601db18c282d092ccbd2f01f3f0cd70b"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.7"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand All @@ -77,21 +84,9 @@ uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "0.19.7"
Documenter = "=0.23.3"
15 changes: 6 additions & 9 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using Documenter, ACME

makedocs(
modules = [ACME],
format = :html,
sitename = "ACME.jl",
pages = Any[
"Home" => "index.md",
Expand All @@ -12,11 +11,9 @@ makedocs(
],
)

deploydocs(
target = "build",
repo = "github.com/HSU-ANT/ACME.jl.git",
latest = "develop",
deps = nothing,
make = nothing,
julia = "1.0",
)
if v"1.0" VERSION < v"1.1" # deploy from 1.0
deploydocs(
repo = "github.com/HSU-ANT/ACME.jl.git",
devbranch = "develop",
)
end
5 changes: 5 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ Method for the Derivation of Non-Linear State-Space Models from Circuit
Schematics"](http://www.eurasip.org/Proceedings/Eusipco/Eusipco2015/papers/1570103545.pdf).

```@contents
Pages = [
"gettingstarted.md",
"ug.md",
"elements.md",
]
```
28 changes: 10 additions & 18 deletions src/ACME.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Copyright 2015, 2016, 2017, 2018, 2019 Martin Holters
# See accompanying license file.

VERSION < v"0.7.0-beta2.199" && __precompile__()

module ACME

export DiscreteModel, run!, steadystate, steadystate!, linearize, ModelRunner

using Compat.SparseArrays: SparseMatrixCSC, dropzeros!, findnz,
using SparseArrays: SparseMatrixCSC, blockdiag, dropzeros!, findnz,
nonzeros, sparse, spzeros
using Compat.LinearAlgebra: I, axpy!
import Compat.LinearAlgebra.BLAS
using LinearAlgebra: BLAS, I, axpy!, lu, rmul!
using Markdown: @doc_str

using ProgressMeter
using IterTools
using DataStructures
using OrderedCollections: OrderedDict
using StaticArrays

include("compat.jl")

include("kdtree.jl")
include("solvers.jl")

Expand Down Expand Up @@ -60,7 +56,7 @@ mutable struct Element
:pxd => (:ny,:nx), :pq => (:ny,:nq) )

elem = new()
for (key, val) in kwargs_pairs(args)
for (key, val) in args
if haskey(mat_dims, key)
val = convert(SparseMatrixCSC{Real,Int}, hcat(val)) # turn val into a sparse matrix whatever it is
update_sizes(val, mat_dims[key])
Expand Down Expand Up @@ -448,14 +444,10 @@ np(model::DiscreteModel, subidx) = size(model.dqs[subidx], 1)
nu(model::DiscreteModel) = size(model.b, 2)
ny(model::DiscreteModel) = length(model.y0)
nn(model::DiscreteModel, subidx) = size(model.fqs[subidx], 2)
nn(model::DiscreteModel) = Compat.reduce(+, init=0, size(fq, 2) for fq in model.fqs)
nn(model::DiscreteModel) = reduce(+, init=0, size(fq, 2) for fq in model.fqs)

function steadystate(model::DiscreteModel, u=zeros(nu(model)))
@static if VERSION < v"0.7.0-DEV.5211"
IA_LU = Compat.LinearAlgebra.lufact(I-model.a)
else
IA_LU = Compat.LinearAlgebra.lu(I-model.a)
end
IA_LU = lu(I-model.a)
steady_z = zeros(nn(model))
zoff = 1
for idx in 1:length(model.solvers)
Expand Down Expand Up @@ -511,8 +503,8 @@ function linearize(model::DiscreteModel, usteady::AbstractVector{Float64}=zeros(

zranges[idx] = zoff:zoff+length(zsub)-1
fqdzdps = [model.fqprevs[idx][:,zranges[n]] * dzdps[n] for n in 1:idx-1]
dqlins[idx] = Compat.reduce(+, init=model.dqs[idx], fqdzdps .* dqlins[1:idx-1])
eqlins[idx] = Compat.reduce(+, init=model.eqs[idx], fqdzdps .* eqlins[1:idx-1])
dqlins[idx] = reduce(+, init=model.dqs[idx], fqdzdps .* dqlins[1:idx-1])
eqlins[idx] = reduce(+, init=model.eqs[idx], fqdzdps .* eqlins[1:idx-1])

x0 += model.c[:,zranges[idx]] * (zsub - dzdps[idx]*psteady)
a += model.c[:,zranges[idx]] * dzdps[idx] * dqlins[idx]
Expand Down Expand Up @@ -706,7 +698,7 @@ function gensolve(a, b, x, h, thresh=0.1)
s = ait * h;
jnz, nz_vals = findnz(s')
nz_abs_vals = abs.(nz_vals)
max_abs_val = Compat.reduce(max, init=zero(eltype(s)), nz_abs_vals)
max_abs_val = reduce(max, init=zero(eltype(s)), nz_abs_vals)
if max_abs_val tol # cosidered numerical zero
continue
end
Expand Down
30 changes: 8 additions & 22 deletions src/circuit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end
elements(c::Circuit) = values(c.elements)

for n in [:nb; :nx; :nq; :nu; :nl; :ny; :nn]
@eval ($n)(c::Circuit) = Compat.reduce(+, init=0, $n(elem) for elem in elements(c))
@eval ($n)(c::Circuit) = reduce(+, init=0, $n(elem) for elem in elements(c))
end

for mat in [:mv; :mi; :mx; :mxd; :mq; :mu; :pv; :pi; :px; :pxd; :pq]
Expand Down Expand Up @@ -76,23 +76,13 @@ function nonlinear_eq_func(c::Circuit, elem_idxs=1:length(elements(c)))
if nn(elem) == 0 && nq(elem) == 0
continue
end
if VERSION >= v"0.7"
push!(funcs,
let q_indices=SVector{nq(elem),Int}(col_offset+1:col_offset+nq(elem)),
nleqfunc=nonlinear_eq_func(elem)
@inline function (q)
nleqfunc(q[q_indices])
end
end)
else
# needed to avoid allocation (during model execution) on Julia 0.6
q_indices=SVector{nq(elem),Int}(col_offset+1:col_offset+nq(elem))
push!(funcs, eval(quote
push!(funcs,
let q_indices=SVector{nq(elem),Int}(col_offset+1:col_offset+nq(elem)),
nleqfunc=nonlinear_eq_func(elem)
@inline function (q)
$(nonlinear_eq_func(elem))(q[$q_indices])
nleqfunc(q[q_indices])
end
end))
end
end)

row_offset += nn(elem)
col_offset += nq(elem)
Expand Down Expand Up @@ -225,11 +215,7 @@ disconnect!(c::Circuit, p::Tuple{Symbol,Any}) = disconnect!(c, (p[1], Symbol(p[2

function topomat!(incidence::SparseMatrixCSC{T}) where {T<:Integer}
@assert all(x -> abs(x) == 1, nonzeros(incidence))
@static if VERSION v"0.7.0-DEV.4064"
@assert all(sum(incidence, dims=1) .== 0)
else
@assert all(sum(incidence, 1) .== 0)
end
@assert all(sum(incidence, dims=1) .== 0)

t = falses(size(incidence)[2]);

Expand Down Expand Up @@ -435,7 +421,7 @@ The following will create an element for a 2.5V source, created using a 5V
source and a voltage divider, stabilized with a capacitor.
```jldoctest; output = false, setup = :(using ACME), filter = r"(ACME\.)?Element\(.*"s
circ = @circuit(begin
circ = @circuit begin
r1 = resistor(10e3)
r2 = resistor(10e3), [1] == r1[2]
c = capacitor(1e-6), [1] == r2[1], [2] == r2[2]
Expand Down
17 changes: 0 additions & 17 deletions src/compat.jl

This file was deleted.

Loading

2 comments on commit ad0f733

@martinholters
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/3868

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.0 -m "<description of version>" ad0f733a04d71650e8d35c499c789ef684e2be5a
git push origin v0.9.0

Please sign in to comment.