From f2ebfbf6a5b2ab05455bd29653d8b3c4f9c2787e Mon Sep 17 00:00:00 2001 From: Iago-lito Date: Mon, 23 Jan 2023 14:52:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Disambiguate=20:=CE=B1=20symbols?= =?UTF-8?q?=20in=20:compact=20generated=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proper fix once #98 has been adressed. --- src/inputs/functional_response.jl | 4 ++-- src/model/generate_dbdt_compact.jl | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/inputs/functional_response.jl b/src/inputs/functional_response.jl index 3cf654e1e..051b5492c 100644 --- a/src/inputs/functional_response.jl +++ b/src/inputs/functional_response.jl @@ -449,7 +449,7 @@ function (F::LinearResponse)(parms, ::Symbol) # Basic information made available as variables in the generated code. S = richness(parms.network) - data = Dict(:S => S, :α => F.α) + data = Dict(:S => S, :α_F => F.α) # Flatten sparse matrices into plain compact arrays. cons, res = findnz(parms.network.A) @@ -464,7 +464,7 @@ function (F::LinearResponse)(parms, ::Symbol) # Construct FR values. # (only one iteration over nonzero (i,j) entries is needed) for (ij, (i, j)) in enumerate(zip(nonzero_links...)) - F[ij] = ω[ij] * α[i] * B[j] + F[ij] = ω[ij] * α_F[i] * B[j] end )] diff --git a/src/model/generate_dbdt_compact.jl b/src/model/generate_dbdt_compact.jl index f0da76ff1..ec497b7aa 100644 --- a/src/model/generate_dbdt_compact.jl +++ b/src/model/generate_dbdt_compact.jl @@ -39,11 +39,13 @@ function generate_dbdt_compact(parms::ModelParameters) for (k, v) in d if haskey(data, k) && v != data[k] throw( - "Error in package source: \n" * - "$(gen) code generator produced data '$(k)': $v " * - "($(typeof(v)))\n" * - "inconsistently with previously generated data '$(k)': $(data[k]) " * - "($(typeof(data[k])))\n", + AssertionError( + "Error in package source: \n" * + "$(gen) code generator produced data '$(k)': $v " * + "($(typeof(v)))\n" * + "inconsistently with previously generated data '$(k)': $(data[k]) " * + "($(typeof(data[k])))\n", + ), ) end data[k] = v