From 5f474b00063de5b87349213b3c217a1f7d0501c1 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 7 May 2018 11:37:56 +0200 Subject: [PATCH 1/4] Use `dims` keyword argument for `squeeze` --- REQUIRE | 2 +- src/ACME.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/REQUIRE b/REQUIRE index b03db6ad..b3e45ef3 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,5 +1,5 @@ julia 0.6 -Compat 0.61.0 +Compat 0.64.0 DataStructures 0.2.9 IterTools 0.1.0 ProgressMeter 0.2.1 diff --git a/src/ACME.jl b/src/ACME.jl index ea296cfa..f19afe9b 100644 --- a/src/ACME.jl +++ b/src/ACME.jl @@ -298,7 +298,7 @@ function model_matrices(circ::Circuit, t::Rational{BigInt}) merge!(res, Dict(zip([:v0 :ev :dv; :i0 :ei :di; :x0 :b :a; :q0 :eq_full :dq_full], matsplit(x, rowsizes, [1; nu(circ); nx(circ)])))) for v in (:v0, :i0, :x0, :q0) - res[v] = squeeze(res[v], 2) + res[v] = squeeze(res[v], dims=2) end p = [pv(circ) pi(circ) px(circ)//2+pxd(circ)//t pq(circ)] From 400f59a17f742369a774bf83ef7dc0522ed457ab Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 7 May 2018 12:48:06 +0200 Subject: [PATCH 2/4] Avoid calling `gensolve` with `a` and `b` having different element types --- src/ACME.jl | 2 +- test/runtests.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ACME.jl b/src/ACME.jl index f19afe9b..ab8b63da 100644 --- a/src/ACME.jl +++ b/src/ACME.jl @@ -741,7 +741,7 @@ gensolve(a, b, thresh=0.1) = function rank_factorize(a::SparseMatrixCSC) f = a - nullspace = gensolve(a', spzeros(size(a, 2), 0))[2] + nullspace = gensolve(a', spzeros(eltype(a), size(a, 2), 0))[2] c = Matrix{eltype(a)}(I, size(a, 1), size(a, 1)) while size(nullspace, 2) > 0 i, j = argmax(abs.(nullspace)).I diff --git a/test/runtests.jl b/test/runtests.jl index 3ef9a72d..2d0f5605 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -203,7 +203,7 @@ end @testset "gensolve/rank_factorize" begin a = Rational{BigInt}[1 1 1; 1 1 2; 1 2 1; 1 2 2; 2 1 1; 2 1 2] b = Rational{BigInt}[1 2 3 4 5 6; 6 5 4 3 2 1; 1 0 1 0 1 0] - nullspace = ACME.gensolve(sparse(a'), spzeros(size(a, 2), 0))[2] + nullspace = ACME.gensolve(sparse(a'), spzeros(Rational{BigInt}, size(a, 2), 0))[2] @test nullspace'*a == spzeros(3, 3) c, f = ACME.rank_factorize(sparse(a * b)) @test c*f == a*b From d5523950eb83724dee1bf68c2f5300bc8648b5a3 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 7 May 2018 12:50:03 +0200 Subject: [PATCH 3/4] Work around JuliaLang/julia#27013 --- src/circuit.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/circuit.jl b/src/circuit.jl index 474b7eee..1fe2fa42 100644 --- a/src/circuit.jl +++ b/src/circuit.jl @@ -286,8 +286,9 @@ function topomat!(incidence::SparseMatrixCSC{T}) where {T<:Integer} dl = ti[:, (!).(t)] tv = spzeros(T, size(dl, 2), size(incidence, 2)) - tv[:, t] = -dl' - tv[:, (!).(t)] = SparseMatrixCSC{T}(I, size(dl, 2), size(dl, 2)) + # findall here works around JuliaLang/julia#27013 (introdcued in 0.7.0-DEV.4983) + tv[:, findall(t)] = -dl' + tv[:, findall((!).(t))] = SparseMatrixCSC{T}(I, size(dl, 2), size(dl, 2)) tv, ti end From d269fdbe437e72dec83c21033cba16c3eff94580 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Tue, 8 May 2018 08:59:48 +0200 Subject: [PATCH 4/4] Bump version to 0.7.1 --- README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1fd438bf..60fdb58a 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,7 @@ # 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-stable-blue.svg)](https://hsu-ant.github.io/ACME.jl/stable) -[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hsu-ant.github.io/ACME.jl/latest) - -[![ACME](http://pkg.julialang.org/badges/ACME_0.5.svg)](http://pkg.julialang.org/?pkg=ACME) -[![ACME](http://pkg.julialang.org/badges/ACME_0.6.svg)](http://pkg.julialang.org/?pkg=ACME) -[![ACME](http://pkg.julialang.org/badges/ACME_0.7.svg)](http://pkg.julialang.org/?pkg=ACME) - -[![Build Status](https://travis-ci.org/HSU-ANT/ACME.jl.svg?branch=develop)](https://travis-ci.org/HSU-ANT/ACME.jl) -[![codecov](https://codecov.io/gh/HSU-ANT/ACME.jl/branch/develop/graph/badge.svg)](https://codecov.io/gh/HSU-ANT/ACME.jl) -[![Coverage Status](https://coveralls.io/repos/github/HSU-ANT/ACME.jl/badge.svg?branch=develop)](https://coveralls.io/github/HSU-ANT/ACME.jl) +[![Documentation](https://img.shields.io/badge/docs-v0.7.1-blue.svg)](https://hsu-ant.github.io/ACME.jl/v0.7.1) ACME is a [Julia](http://julialang.org/) package for the simulation of electrical circuits, focusing on audio effect circuits. It allows to @@ -131,7 +122,7 @@ fail to run altogether. ## Moving on -There is some [documentation](https://hsu-ant.github.io/ACME.jl/latest) +There is some [documentation](https://hsu-ant.github.io/ACME.jl/v0.7.1) 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")`.