From 452cd2f9cabcb1df014ca42f9b9ecd27165d9b39 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 14:42:12 -0500 Subject: [PATCH 01/13] try to fix documentation by using Pkg and activating the package --- docs/make.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index ac7a69c..4849d3f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,9 @@ +using Pkg using Documenter + push!(LOAD_PATH, "../src/") + +Pkg.activate(".") using BioEnergeticFoodWebs makedocs( @@ -8,6 +12,6 @@ makedocs( deploydocs( deps = Deps.pip("pygments", "mkdocs", "mkdocs-material", "python-markdown-math"), - julia = "0.6", + julia = "1.0", repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" ) From d6e4af7d9561cc36095315e34e066f5ece03dba2 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 15:23:48 -0500 Subject: [PATCH 02/13] (same) add sitename to makedocs --- docs/make.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 4849d3f..2c41b70 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -7,11 +7,12 @@ Pkg.activate(".") using BioEnergeticFoodWebs makedocs( - modules = [BioEnergeticFoodWebs] + modules = [BioEnergeticFoodWebs], + sitename = "BioEnergeticFoodWebs.jl" ) deploydocs( - deps = Deps.pip("pygments", "mkdocs", "mkdocs-material", "python-markdown-math"), + deps = Deps.pip("pygments", "mkdocs", "mkdocs-material", "python-markdown-math"), julia = "1.0", repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" ) From a12f89579613e5c7b6547696818e4cb3b6ba7f89 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 16:05:59 -0500 Subject: [PATCH 03/13] Specify mkdocs and mkdocs-material version as temporary solution (python version on travis is <2.7.9) --- docs/make.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 2c41b70..f41e54c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,7 +12,7 @@ makedocs( ) deploydocs( - deps = Deps.pip("pygments", "mkdocs", "mkdocs-material", "python-markdown-math"), - julia = "1.0", + deps = Deps.pip("pygments", "mkdocs==0.17.5", "mkdocs-material==2.9.4", "python-markdown-math"), + julia = "0.7", repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" ) From f572101e7f9f8a45990ae1a93276bedffc978020 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 16:39:34 -0500 Subject: [PATCH 04/13] (same) pin documenter to 0.19 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a9cd41..9969ace 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,9 @@ before_script: Pkg.add([PackageSpec(name="BinaryBuilder", rev="master"), PackageSpec(name="BinaryProvider")])' after_success: - julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())' - - julia -e 'import Pkg; Pkg.add("Documenter")' - - julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); include(joinpath("docs", "make.jl"))' + #- julia -e 'import Pkg; Pkg.add("Documenter")' + - julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); include(joinpath("docs", "make.jl"))' + #- julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); include(joinpath("docs", "make.jl"))' notifications: webhooks: urls: From b332f65d8e8e5ca8ca8c4eaeff3b45b0a1495a19 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 17:10:54 -0500 Subject: [PATCH 05/13] (same) remove julia keyword in deploydocs --- docs/make.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index f41e54c..24edbf2 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,11 +8,19 @@ using BioEnergeticFoodWebs makedocs( modules = [BioEnergeticFoodWebs], - sitename = "BioEnergeticFoodWebs.jl" + sitename = "BioEnergeticFoodWebs.jl", + pages = [ + "Index" => "index.md", + "Installation" => "man/installation.md", + "Generating random networks" => "man/random.md", + "First simulation" => "man/first_simulation.md", + "Extinctions" => "man/extinctions.md", + "Temperature dependence" => "man/temperature.md", + "Contributing" => "man/contributing.md" + ] ) deploydocs( deps = Deps.pip("pygments", "mkdocs==0.17.5", "mkdocs-material==2.9.4", "python-markdown-math"), - julia = "0.7", repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" ) From 8778a1e3172cbc30cec92c1e390337b5b2f9dff5 Mon Sep 17 00:00:00 2001 From: Azenor Bideault Date: Fri, 1 Mar 2019 17:27:00 -0500 Subject: [PATCH 06/13] Adjust normalisation constant for ExpBA --- src/temperature_dependence_functions.jl | 68 ++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/temperature_dependence_functions.jl b/src/temperature_dependence_functions.jl index b95ca58..2693e87 100644 --- a/src/temperature_dependence_functions.jl +++ b/src/temperature_dependence_functions.jl @@ -286,22 +286,22 @@ This function can be called with the keywords :growth, :growthrate or :r as an a Example : model_parameters(A, growthrate = ExponentialBA(:r)) -| Parameter | Meaning | Default values | Reference | -|:------------------|:--------------------------------------|:---------------|:--------------------------------------| -| norm_constant | scaling coefficient | exp(-15.68) | Ehnes et al. 2011, Binzer et al. 2012 | -| activation_energy | activation energy | -0.84 | Ehnes et al. 2011, Binzer et al. 2012 | -| T0 | normalization temperature (K) | 293.15 | Binzer et al. 2012, Binzer et al. 2012| -| β | allometric exponent | -0.25 | Ehnes et al. 2011 | -| k | Boltzmann norm_constant | 8.617e-5 | | +| Parameter | Meaning | Default values | Reference | +|:------------------|:--------------------------------------|:----------------|:--------------------------------------| +| norm_constant | scaling coefficient | exp(-15.68)*4e6 | Ehnes et al. 2011, Binzer et al. 2012 | +| activation_energy | activation energy | -0.84 | Ehnes et al. 2011, Binzer et al. 2012 | +| T0 | normalization temperature (K) | 293.15 | Binzer et al. 2012, Binzer et al. 2012| +| β | allometric exponent | -0.25 | Ehnes et al. 2011 | +| k | Boltzmann norm_constant | 8.617e-5 | | Default values are given as an example. The function can be called with the default parameters: - exponential_BA_r() Parameters can also be specified: - - exponential_BA_r(passed_temp_parameters = (norm_constant = exp(-15.68), activation_energy = -0.72, T0 = 293.15, β = -0.25)) + - exponential_BA_r(passed_temp_parameters = (norm_constant = exp(-15.68)*4e6, activation_energy = -0.72, T0 = 293.15, β = -0.25)) """ -function exponential_BA_r(default_temp_parameters = (norm_constant = exp(-15.68), activation_energy = -0.84, T0 = 293.15, β = -0.25); passed_temp_parameters...) +function exponential_BA_r(default_temp_parameters = (norm_constant = exp(-15.68)*4e6, activation_energy = -0.84, T0 = 293.15, β = -0.25); passed_temp_parameters...) k = 8.617e-5 if length(passed_temp_parameters) != 0 tmpargs = passed_temp_parameters[:passed_temp_parameters] @@ -318,32 +318,32 @@ end This function can be called with the keywords :metabolism, :x or :metabolicrate as an argument in `ExponentialBA`, itself called in `model_parameters`, to define an exponential Boltzmann-Arrhénius function (Gillooly et al. 2001, Brown et al. 2004) for metabolic rate. Example : model_parameters(A, metabolicrate = ExponentialBA(:x)) -| Parameter | Meaning | Default values | Reference | -|:-------------------------------|:------------------------------------------------|:---------------|:--------------------------------------| -| norm_constant_producer | scaling coefficient for producers | exp(-16.54) | Ehnes et al. 2011, Binzer et al. 2012 | -| norm_constant_invertebrate | scaling coefficient for invertebrates | exp(-16.54) | Ehnes et al. 2011, Binzer et al. 2012 | -| norm_constant_vertebrate | scaling coefficient for vertebrates | exp(-16.54) | Ehnes et al. 2011, Binzer et al. 2012 | -| activation_energy_producer | activation energy for producers | -0.69 | Ehnes et al. 2011, Binzer et al. 2012 | -| activation_energy_invertebrate | activation energy for invertebrates | -0.69 | Ehnes et al. 2011, Binzer et al. 2012 | -| activation_energy_vertebrate | activation energy for vertebrates | -0.69 | Ehnes et al. 2011, Binzer et al. 2012 | -| T0_producer | normalization temperature (K) for producers | 293.15 | Binzer et al. 2012, Binzer et al. 2012| -| T0_invertebrate | normalization temperature (K) for invertebrates | 293.15 | Binzer et al. 2012, Binzer et al. 2012| -| T0_vertebrate | normalization temperature (K) for vertebrates | 293.15 | Binzer et al. 2012, Binzer et al. 2012| -| β_producer | allometric exponent for producers | -0.31 | Ehnes et al. 2011 | -| β_invertebrate | allometric exponent for invertebrates | -0.31 | Ehnes et al. 2011 | -| β_vertebrate | allometric exponent for vertebrates | -0.31 | Ehnes et al. 2011 | +| Parameter | Meaning | Default values | Reference | +|:-------------------------------|:------------------------------------------------|:-----------------|:--------------------------------------| +| norm_constant_producer | scaling coefficient for producers | exp(-16.54)*4e6 | Ehnes et al. 2011, Binzer et al. 2012 | +| norm_constant_invertebrate | scaling coefficient for invertebrates | exp(-16.54)*4e6 | Ehnes et al. 2011, Binzer et al. 2012 | +| norm_constant_vertebrate | scaling coefficient for vertebrates | exp(-16.54)*4e6 | Ehnes et al. 2011, Binzer et al. 2012 | +| activation_energy_producer | activation energy for producers | -0.69 | Ehnes et al. 2011, Binzer et al. 2012 | +| activation_energy_invertebrate | activation energy for invertebrates | -0.69 | Ehnes et al. 2011, Binzer et al. 2012 | +| activation_energy_vertebrate | activation energy for vertebrates | -0.69 | Ehnes et al. 2011, Binzer et al. 2012 | +| T0_producer | normalization temperature (K) for producers | 293.15 | Binzer et al. 2012 | +| T0_invertebrate | normalization temperature (K) for invertebrates | 293.15 | Binzer et al. 2012 | +| T0_vertebrate | normalization temperature (K) for vertebrates | 293.15 | Binzer et al. 2012 | +| β_producer | allometric exponent for producers | -0.31 | Ehnes et al. 2011 | +| β_invertebrate | allometric exponent for invertebrates | -0.31 | Ehnes et al. 2011 | +| β_vertebrate | allometric exponent for vertebrates | -0.31 | Ehnes et al. 2011 | Default values are given as an example. The function can be called with the default parameters: - exponential_BA_x() Parameters can also be specified: - - exponential_BA_x(passed_temp_parameters = (norm_constant_producer = -16.54, norm_constant_invertebrate = exp(-16.54), norm_constant_vertebrate = exp(-16.54), - activation_energy_producer = exp(-16.54), activation_energy_invertebrate = -0.69, activation_energy_vertebrate = -0.69, + - exponential_BA_x(passed_temp_parameters = (norm_constant_producer = exp(-16.54)*4e6, norm_constant_invertebrate = exp(-16.54)*4e6, norm_constant_vertebrate = exp(-16.54)*4e6, + activation_energy_producer = -0.69, activation_energy_invertebrate = -0.69, activation_energy_vertebrate = -0.69, T0_producer = 300.15, T0_invertebrate = 300.15, T0_vertebrate = 293.15, β_producer = -0.31, β_invertebrate = -0.31, β_vertebrate = -0.31)) """ -function exponential_BA_x(default_temp_parameters = (norm_constant_producer = exp(-16.54), norm_constant_invertebrate = exp(-16.54), norm_constant_vertebrate = exp(-16.54), +function exponential_BA_x(default_temp_parameters = (norm_constant_producer = exp(-16.54)*4e6, norm_constant_invertebrate = exp(-16.54)*4e6, norm_constant_vertebrate = exp(-16.54)*4e6, activation_energy_producer = -0.69, activation_energy_invertebrate = -0.69, activation_energy_vertebrate = -0.69, T0_producer = 293.15, T0_invertebrate = 293.15, T0_vertebrate = 293.15, β_producer = -0.31, β_invertebrate = -0.31, β_vertebrate = -0.31); passed_temp_parameters...) @@ -373,8 +373,8 @@ Example : model_parameters(A, attackrate = ExponentialBA(:attackrate)) | Parameter | Meaning | Default values | Reference | |:-------------------------------|:------------------------------------------------|:---------------|:--------------------------------------| -| norm_constant_invertebrate | scaling coefficient for invertebrate | exp(-13.1) | Rall et al. 2012, Binzer et al. 2015 | -| norm_constant_vertebrate | scaling coefficient for vertebrate | exp(-13.1) | Rall et al. 2012, Binzer et al. 2015 | +| norm_constant_invertebrate | scaling coefficient for invertebrate | exp(-13.1)*4e6 | Rall et al. 2012, Binzer et al. 2015 | +| norm_constant_vertebrate | scaling coefficient for vertebrate | exp(-13.1)*4e6 | Rall et al. 2012, Binzer et al. 2015 | | activation_energy_invertebrate | activation energy for invertebrates | -0.38 | Rall et al. 2012, Binzer et al. 2015 | | activation_energy_vertebrate | activation energy for vertebrates | -0.38 | Rall et al. 2012, Binzer et al. 2015 | | T0_invertebrate | normalization temperature (K) for invertebrates | 293.15 | Rall et al. 2012, Binzer et al. 2015 | @@ -388,12 +388,12 @@ Default values are given as an example. The function can be called with the default parameters: - exponential_BA_attackr() Parameters can also be specified: - - exponential_BA_attackr(passed_temp_parameters = (norm_constant_vertebrate = exp(-13.1), norm_constant_invertebrate = exp(-13.1), + - exponential_BA_attackr(passed_temp_parameters = (norm_constant_vertebrate = exp(-13.1)*4e6, norm_constant_invertebrate = exp(-13.1)*4e6, activation_energy_vertebrate = -0.38, activation_energy_invertebrate = -0.38, T0_vertebrate = 293.15, T0_invertebrate = 293.15, β_producer = 0.25, β_vertebrate = -0.8, β_invertebrate = 0.8)) """ -function exponential_BA_attackr(default_temp_parameters = (norm_constant_vertebrate = exp(-13.1), norm_constant_invertebrate = exp(-13.1), +function exponential_BA_attackr(default_temp_parameters = (norm_constant_vertebrate = exp(-13.1)*4e6, norm_constant_invertebrate = exp(-13.1)*4e6, activation_energy_vertebrate = -0.38, activation_energy_invertebrate = -0.38, T0_vertebrate = 293.15, T0_invertebrate = 293.15, β_producer = 0.25, β_vertebrate = -0.8, β_invertebrate = -0.8); passed_temp_parameters...) @@ -439,8 +439,8 @@ Example : model_parameters(A, handlingtime = ExponentialBA(:handlingtime)) | Parameter | Meaning | Default values | Reference | |:-------------------------------|:------------------------------------------------|:---------------|:--------------------------------------| -| norm_constant_invertebrate | scaling coefficient for invertebrate | exp(9.66) | Rall et al. 2012, Binzer et al. 2015 | -| norm_constant_vertebrate | scaling coefficient for vertebrate | exp(9.66) | Rall et al. 2012, Binzer et al. 2015 | +| norm_constant_invertebrate | scaling coefficient for invertebrate | exp(9.66)*4e6 | Rall et al. 2012, Binzer et al. 2015 | +| norm_constant_vertebrate | scaling coefficient for vertebrate | exp(9.66)*4e6 | Rall et al. 2012, Binzer et al. 2015 | | activation_energy_invertebrate | activation energy for invertebrates | 0.26 | Rall et al. 2012, Binzer et al. 2015 | | activation_energy_vertebrate | activation energy for vertebrates | 0.26 | Rall et al. 2012, Binzer et al. 2015 | | T0_invertebrate | normalization temperature (K) for invertebrates | 293.15 | Rall et al. 2012, Binzer et al. 2015 | @@ -455,12 +455,12 @@ Default values are given as an example. The function can be called with the default parameters: - exponential_BA_handlingt() Parameters can also be specified: - - exponential_BA_handlingt(passed_temp_parameters = (norm_constant_vertebrate = exp(9.66), norm_constant_invertebrate = exp(9.66), + - exponential_BA_handlingt(passed_temp_parameters = (norm_constant_vertebrate = exp(9.66)*4e6, norm_constant_invertebrate = exp(9.66)*4e6, activation_energy_vertebrate = 0.26, activation_energy_invertebrate = 0.26, T0_vertebrate = 293.15, T0_invertebrate = 293.15, β_producer = -0.45, β_vertebrate = 0.47, β_invertebrate = 0.47)) """ -function exponential_BA_handlingt(default_temp_parameters = (norm_constant_vertebrate = exp(9.66), norm_constant_invertebrate = exp(9.66), +function exponential_BA_handlingt(default_temp_parameters = (norm_constant_vertebrate = exp(9.66)*4e6, norm_constant_invertebrate = exp(9.66)*4e6, activation_energy_vertebrate = 0.26, activation_energy_invertebrate = 0.26, T0_vertebrate = 293.15, T0_invertebrate = 293.15, β_producer = -0.45, β_vertebrate = 0.47, β_invertebrate = 0.47); passed_temp_parameters...) From b3d0bd3c555c119409c32a41687f7877cc97f4c8 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 17:32:46 -0500 Subject: [PATCH 07/13] debug doc deployment --- .travis.yml | 5 +++-- docs/make.jl | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9969ace..da82f7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,9 @@ before_script: Pkg.add([PackageSpec(name="BinaryBuilder", rev="master"), PackageSpec(name="BinaryProvider")])' after_success: - julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())' - #- julia -e 'import Pkg; Pkg.add("Documenter")' - - julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); include(joinpath("docs", "make.jl"))' + - julia -e 'import Pkg; Pkg.add("Documenter")' + - julia -e 'ENV["DOCUMENTER_DEBUG"] = "true"; cd(Pkg.dir("BioEnergeticFoodWebs", "docs")); include("make.jl")' + #- julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); include(joinpath("docs", "make.jl"))' #- julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); include(joinpath("docs", "make.jl"))' notifications: webhooks: diff --git a/docs/make.jl b/docs/make.jl index 24edbf2..f811336 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -22,5 +22,6 @@ makedocs( deploydocs( deps = Deps.pip("pygments", "mkdocs==0.17.5", "mkdocs-material==2.9.4", "python-markdown-math"), + julia = "nightly", repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" ) From 649c7cd44b5790705693bdb557644be7820fcfb5 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Fri, 1 Mar 2019 17:42:55 -0500 Subject: [PATCH 08/13] (same) --- .travis.yml | 2 +- docs/make.jl | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index da82f7d..bd4754b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_script: after_success: - julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())' - julia -e 'import Pkg; Pkg.add("Documenter")' - - julia -e 'ENV["DOCUMENTER_DEBUG"] = "true"; cd(Pkg.dir("BioEnergeticFoodWebs", "docs")); include("make.jl")' + - julia -e 'import Pkg; import Documenter; ENV["DOCUMENTER_DEBUG"] = "true"; cd(Pkg.dir("BioEnergeticFoodWebs", "docs")); include("make.jl")' #- julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); include(joinpath("docs", "make.jl"))' #- julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); include(joinpath("docs", "make.jl"))' notifications: diff --git a/docs/make.jl b/docs/make.jl index f811336..a7ddc96 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,17 +8,8 @@ using BioEnergeticFoodWebs makedocs( modules = [BioEnergeticFoodWebs], - sitename = "BioEnergeticFoodWebs.jl", - pages = [ - "Index" => "index.md", - "Installation" => "man/installation.md", - "Generating random networks" => "man/random.md", - "First simulation" => "man/first_simulation.md", - "Extinctions" => "man/extinctions.md", - "Temperature dependence" => "man/temperature.md", - "Contributing" => "man/contributing.md" - ] - ) + sitename = "BioEnergeticFoodWebs.jl" + ) deploydocs( deps = Deps.pip("pygments", "mkdocs==0.17.5", "mkdocs-material==2.9.4", "python-markdown-math"), From adfd1d03f67fd7d46cf8285e25fa651c996cc3a7 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Mon, 4 Mar 2019 13:24:49 -0500 Subject: [PATCH 09/13] fix :white_check_mark: for exponentialBA --- test/biological_rates.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/biological_rates.jl b/test/biological_rates.jl index a7f246d..5e5f7fa 100644 --- a/test/biological_rates.jl +++ b/test/biological_rates.jl @@ -172,12 +172,12 @@ module TestExponentialBA #defaults p_r_d = model_parameters(omnivory, T = temp, bodymass = bmass, vertebrates = metabolic_status, growthrate = ExponentialBA(:r)) k = 8.617e-5 - r_d = exp(-15.68) .* (bmass .^-0.25) .* exp.(-0.84 .* (293.15 .- temp) ./ (k .* temp .* 293.15)) + r_d = exp(-15.68) .* 4e6 .* (bmass .^-0.25) .* exp.(-0.84 .* (293.15 .- temp) ./ (k .* temp .* 293.15)) @test p_r_d[:r] == r_d #change temperature temp2 = 250.0 p_r_t = model_parameters(omnivory, T = temp2, bodymass = bmass, vertebrates = metabolic_status, growthrate = ExponentialBA(:r)) - r_t = exp(-15.68) .* (bmass .^-0.25) .* exp.(-0.84 .* (293.15 .- temp2) ./ (k .* temp2 .* 293.15)) + r_t = exp(-15.68) .* 4e6 .* (bmass .^-0.25) .* exp.(-0.84 .* (293.15 .- temp2) ./ (k .* temp2 .* 293.15)) @test p_r_t[:r] == r_t #rate increases with temperature @test !any(p_r_t[:r] .> p_r_d[:r]) @@ -190,11 +190,11 @@ module TestExponentialBA #METABOLISM #defaults p_x_d = model_parameters(omnivory, T = temp, bodymass = bmass, vertebrates = metabolic_status, metabolicrate = ExponentialBA(:x)) - x_d = exp(-16.54) .* (bmass .^-0.31) .* exp.(-0.69 .* (293.15 .- temp) ./ (k .* temp .* 293.15)) + x_d = exp(-16.54) .* 4e6 .* (bmass .^-0.31) .* exp.(-0.69 .* (293.15 .- temp) ./ (k .* temp .* 293.15)) @test p_x_d[:x] == x_d #change temperature p_x_t = model_parameters(omnivory, T = temp2, bodymass = bmass, vertebrates = metabolic_status, metabolicrate = ExponentialBA(:x)) - x_t = exp(-16.54) .* (bmass .^-0.31) .* exp.(-0.69 .* (293.15 .- temp2) ./ (k .* temp2 .* 293.15)) + x_t = exp(-16.54) .* 4e6 .* (bmass .^-0.31) .* exp.(-0.69 .* (293.15 .- temp2) ./ (k .* temp2 .* 293.15)) @test p_x_t[:x] == x_t #rate increases with temperature @test !any(p_x_t[:x] .> p_x_d[:x]) @@ -214,12 +214,12 @@ module TestExponentialBA #ATTACK #defaults p_ar_d = model_parameters(omnivory, T = temp, bodymass = bmass, vertebrates = metabolic_status, attackrate = ExponentialBA(:attackrate)) - ar_d = exp.([-13.1, -13.1, 0.0]) .* (bmass .^[-0.8, -0.8, 0.0]) .* (bmass' .^[0 -0.8 0.25; 0 0 0.25 ; 0 0 0]) .* exp.([-0.38, -0.38, 0.0] .* ([293.15, 293.15, 0.0] .- temp) ./ (k .* temp .* [293.15, 293.15, 0.0])) + ar_d = exp.([-13.1, -13.1, 0.0]) .* 4e6 .* (bmass .^[-0.8, -0.8, 0.0]) .* (bmass' .^[0 -0.8 0.25; 0 0 0.25 ; 0 0 0]) .* exp.([-0.38, -0.38, 0.0] .* ([293.15, 293.15, 0.0] .- temp) ./ (k .* temp .* [293.15, 293.15, 0.0])) ar_d[isnan.(ar_d)] .= 0 @test p_ar_d[:ar] == ar_d #change temperature p_ar_t = model_parameters(omnivory, T = temp2, bodymass = bmass, vertebrates = metabolic_status, attackrate = ExponentialBA(:attackrate)) - ar_t = exp.([-13.1, -13.1, 0.0]) .* (bmass .^[-0.8, -0.8, 0.0]) .* (bmass' .^[0 -0.8 0.25; 0 0 0.25 ; 0 0 0]) .* exp.([-0.38, -0.38, 0.0] .* ([293.15, 293.15, 0.0] .- temp2) ./ (k .* temp2 .* [293.15, 293.15, 0.0])) + ar_t = exp.([-13.1, -13.1, 0.0]) .* 4e6 .* (bmass .^[-0.8, -0.8, 0.0]) .* (bmass' .^[0 -0.8 0.25; 0 0 0.25 ; 0 0 0]) .* exp.([-0.38, -0.38, 0.0] .* ([293.15, 293.15, 0.0] .- temp2) ./ (k .* temp2 .* [293.15, 293.15, 0.0])) ar_t[isnan.(ar_t)] .= 0 @test p_ar_t[:ar] == ar_t #rate increases with temperature @@ -237,12 +237,12 @@ module TestExponentialBA #HANDLING #defaults p_ht_d = model_parameters(omnivory, T = temp, bodymass = bmass, vertebrates = metabolic_status, handlingtime = ExponentialBA(:handlingtime)) - ht_d = exp.([9.66, 9.66, 0.0]) .* (bmass .^[0.47, 0.47, 0.0]) .* (bmass' .^[0.0 0.47 -0.45 ; 0 0 -0.45; 0 0 0]) .* exp.([0.26, 0.26, 0.0] .* ([293.15, 293.15, 0.0] .- temp) ./ (k .* temp .* [293.15, 293.15, 0.0])) + ht_d = exp.([9.66, 9.66, 0.0]) .* 4e6 .* (bmass .^[0.47, 0.47, 0.0]) .* (bmass' .^[0.0 0.47 -0.45 ; 0 0 -0.45; 0 0 0]) .* exp.([0.26, 0.26, 0.0] .* ([293.15, 293.15, 0.0] .- temp) ./ (k .* temp .* [293.15, 293.15, 0.0])) ht_d[isnan.(ht_d)] .= 0 @test p_ht_d[:ht] == ht_d #change temperature p_ht_t = model_parameters(omnivory, T = temp2, bodymass = bmass, vertebrates = metabolic_status, handlingtime = ExponentialBA(:handlingtime)) - ht_t = exp.([9.66, 9.66, 0.0]) .* (bmass .^[0.47, 0.47, 0.0]) .* (bmass' .^[0.0 0.47 -0.45 ; 0 0 -0.45; 0 0 0]) .* exp.([0.26, 0.26, 0.0] .* ([293.15, 293.15, 0.0] .- temp2) ./ (k .* temp2 .* [293.15, 293.15, 0.0])) + ht_t = exp.([9.66, 9.66, 0.0]) .* 4e6 .* (bmass .^[0.47, 0.47, 0.0]) .* (bmass' .^[0.0 0.47 -0.45 ; 0 0 -0.45; 0 0 0]) .* exp.([0.26, 0.26, 0.0] .* ([293.15, 293.15, 0.0] .- temp2) ./ (k .* temp2 .* [293.15, 293.15, 0.0])) ht_t[isnan.(ht_t)] .= 0 @test p_ht_t[:ht] == ht_t #rate decreases with temperature From 51bf150fcf142934103cc2fe52cd40a8050b846d Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Mon, 4 Mar 2019 14:19:51 -0500 Subject: [PATCH 10/13] try to fix docs deployment --- .travis.yml | 3 ++- docs/make.jl | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd4754b..508911b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ matrix: julia: - 0.7 - 1.0 + - nightly addons: apt: packages: @@ -20,7 +21,7 @@ before_script: after_success: - julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())' - julia -e 'import Pkg; Pkg.add("Documenter")' - - julia -e 'import Pkg; import Documenter; ENV["DOCUMENTER_DEBUG"] = "true"; cd(Pkg.dir("BioEnergeticFoodWebs", "docs")); include("make.jl")' + - julia -e 'import Pkg; import Documenter; ENV["DOCUMENTER_DEBUG"] = "true"; import BioEnergeticFoodWebs; include(joinpath("docs", "make.jl"))' #- julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); include(joinpath("docs", "make.jl"))' #- julia -e 'import Pkg; cd(Pkg.dir("BioEnergeticFoodWebs")); include(joinpath("docs", "make.jl"))' notifications: diff --git a/docs/make.jl b/docs/make.jl index a7ddc96..8635cb2 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -13,6 +13,5 @@ makedocs( deploydocs( deps = Deps.pip("pygments", "mkdocs==0.17.5", "mkdocs-material==2.9.4", "python-markdown-math"), - julia = "nightly", repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" ) From 5e3ca4237f7b0d5a1dccece3248dc149f41221e8 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Mon, 4 Mar 2019 15:50:56 -0500 Subject: [PATCH 11/13] same --- docs/make.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 8635cb2..0061491 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -13,5 +13,6 @@ makedocs( deploydocs( deps = Deps.pip("pygments", "mkdocs==0.17.5", "mkdocs-material==2.9.4", "python-markdown-math"), - repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git" + repo = "github.com/PoisotLab/BioEnergeticFoodWebs.jl.git", + devbranch = "next" ) From 9b6e8c7b2c400595eb65733c35e20a6ebc06d844 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Mon, 4 Mar 2019 16:11:45 -0500 Subject: [PATCH 12/13] Deploy documentation and update Readme --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 27fae72..9221502 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,19 @@ # Bio-energetic food web model -[![RTD](https://img.shields.io/badge/doc-stable-blue.svg)](https://poisotlab.github.io/BioEnergeticFoodWebs.jl/stable/) +[![RTD](https://img.shields.io/badge/doc-latest-blue.svg)](https://poisotlab.github.io/BioEnergeticFoodWebs.jl/latest/) [![GitHub tag](https://img.shields.io/github/tag/PoisotLab/BioEnergeticFoodWebs.jl.svg)](https://github.com/PoisotLab/BioEnergeticFoodWebs.jl/releases) [![DOI](https://zenodo.org/badge/70102258.svg)](https://zenodo.org/badge/latestdoi/70102258) [![Gitter](https://img.shields.io/gitter/room/PoisotLab/BioEnergeticFoodWebs.jl.svg)](https://gitter.im/PoisotLab/BioEnergeticFoodWebs.jl) -[![BioEnergeticFoodWebs](http://pkg.julialang.org/badges/BioEnergeticFoodWebs_0.4.svg)](http://pkg.julialang.org/?pkg=BioEnergeticFoodWebs) -[![BioEnergeticFoodWebs](http://pkg.julialang.org/badges/BioEnergeticFoodWebs_0.5.svg)](http://pkg.julialang.org/?pkg=BioEnergeticFoodWebs) -[![BioEnergeticFoodWebs](http://pkg.julialang.org/badges/BioEnergeticFoodWebs_0.6.svg)](http://pkg.julialang.org/?pkg=BioEnergeticFoodWebs) - Simulations of biomass flows in food webs is a difficult task, yet performing it correctly is required to understand the ties betweeen the structure and function of ecological communities. This package provides a robustly tested, well-documented, computationally efficient common interface for the simulation of bio-energetic systems in food webs. +This package is no longer compatible with Julia 0.6 (or older). + ## Stable [![Travis branch](https://img.shields.io/travis/PoisotLab/BioEnergeticFoodWebs.jl/master.svg)](https://travis-ci.org/PoisotLab/BioEnergeticFoodWebs.jl) @@ -26,7 +24,6 @@ of bio-energetic systems in food webs. ## In development -[![RTD](https://img.shields.io/badge/doc-latest-blue.svg)](https://poisotlab.github.io/BioEnergeticFoodWebs.jl/latest/) [![Travis branch](https://img.shields.io/travis/PoisotLab/BioEnergeticFoodWebs.jl/next.svg)](https://travis-ci.org/PoisotLab/BioEnergeticFoodWebs.jl) [![Coveralls branch](https://img.shields.io/coveralls/PoisotLab/BioEnergeticFoodWebs.jl/next.svg)](https://coveralls.io/github/PoisotLab/BioEnergeticFoodWebs.jl?branch=next) From b0b2d676999f9779af396c4a0761c795a93d6518 Mon Sep 17 00:00:00 2001 From: Eva Delmas Date: Mon, 4 Mar 2019 16:33:42 -0500 Subject: [PATCH 13/13] fix equations format in docs --- docs/src/man/temperature.md | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/docs/src/man/temperature.md b/docs/src/man/temperature.md index 17313cc..62b8b8c 100644 --- a/docs/src/man/temperature.md +++ b/docs/src/man/temperature.md @@ -34,9 +34,7 @@ Note that rates can be negative (outside of the thermal range) when using the ex Bernhardt et al. (2018) proposed an extension of the original model of Eppley (1972). Following this extension the thermal performance curve of rate $q_i$ of species $i$ is defined by the equation: -$$ -q_i(T) = M_i^\beta * m0 * exp(b * T) * (1 - (\frac{T - T_{\text{opt}}}{\text{range}/2})^2) -$$ +$q_i(T) = M_i^\beta * m0 * exp(b * T) * (1 - (\frac{T - T_{\text{opt}}}{\text{range}/2})^2)$ Where $M_i$ is the body mass of species $i$ and T is the temperature in degrees Kelvin. The default parameters values are described for each rate below. @@ -79,9 +77,7 @@ p_newvalues = model_parameters(A, metabolicrate = ExtendedEppley(:metabolicrate, The Boltzmann Arrhenius model, following the Metabolic Theory in Ecology, describes the scaling of a biological rate ($q$) with temperature by: -$$ -q_i(T) = q_0 * M^\beta_i * exp(E-\frac{T_0 - T}{kT_0T}) -$$ +$q_i(T) = q_0 * M^\beta_i * exp(E-\frac{T_0 - T}{kT_0T})$ Where $q_0$ is the organisms state-dependent scaling coefficient, calculated for 1g at 20 degrees Celsius (273.15 degrees Kelvin), β is the rate specific allometric scaling exponent, $E$ is the activation energy in $eV$ (electronvolts) of the response, $T_0$ is the normalization temperature and $k$ is the Boltzmann constant ($8.617 10^{-5} eV.K^{-1}$). As for all other equations, $T$ is the temperature and $M_i$ is the typical adult body mass of species $i$. @@ -190,15 +186,11 @@ p_newvalues = model_parameters(A, handlingtime = ExponentialBA(:handlingtime, pa To describe a more classical unimodal relationship of biological rates with temperature, one can also use the **extended** Boltzmann Arrhenius function. This is an extension based on the Johnson and Lewin model to describe the decrease in biological rates at higher temperatures (and is still based on chemical reaction kinetics). -$$ -q_i(T) = exp(q_0) * M^\beta_i * exp(\frac{E}{kT * l(T)}) -$$ +$q_i(T) = exp(q_0) * M^\beta_i * exp(\frac{E}{kT * l(T)})$ Where $l(T)$ is : -$$ -l(T) = \frac{1}{1 + exp[\frac{-1}{kT} + (\frac{E_D}{T_{opt}} + k * ln(\frac{E}{E_D - E}))]} -$$ +$l(T) = \frac{1}{1 + exp[\frac{-1}{kT} + (\frac{E_D}{T_{opt}} + k * ln(\frac{E}{E_D - E}))]}$ #### Growth rate @@ -260,8 +252,8 @@ Note: The body-mass allometric scaling (originally defined as $M_i^\beta$) becom | Parameter | Keyword | Meaning | Default values | References | | --------- | ---------------------------------- | ------------------------------------ | -------------- | --------------------- | -| $r_0$ | `norm_constant_invertebrate` | growth dependent scaling coefficient | $5.10^13$ | Bideault et al 2019 | -| $r_0$ | `norm_constant_vertebrate` | growth dependent scaling coefficient | $5.10^13$ | Bideault et al 2019 | +| $r_0$ | `norm_constant_invertebrate` | growth dependent scaling coefficient | $5.10^{13}$ | Bideault et al 2019 | +| $r_0$ | `norm_constant_vertebrate` | growth dependent scaling coefficient | $5.10^{13}$ | Bideault et al 2019 | | $\beta_i$ | `β_producer` | allometric exponent | 0.25 | Gillooly et al., 2002 | | $\beta_i$ | `β_invertebrate` | allometric exponent | 0.25 | Gillooly et al., 2002 | | $\beta_i$ | `β_vertebrate` | allometric exponent | 0.25 | Gillooly et al., 2002 | @@ -285,9 +277,7 @@ p_newvalues = model_parameters(A, attackrate = ExtendedBA(:attackrate, parameter A simple gaussian function (or inverted gaussian function depending on the rate) has also been used in studies to model the scaling of biological rates with temperature. This can be formalized by the following equation: -$$ -q_i(T) = M_i^\beta * q_{opt} * exp[\pm (\frac{(T - T_{opt})^2}{2s_q^2})] -$$ +$q_i(T) = M_i^\beta * q_{opt} * exp[\pm (\frac{(T - T_{opt})^2}{2s_q^2})]$ #### Growth rate @@ -412,9 +402,7 @@ If multiple keywords are provided, the model will use this order of priority: bo To simulate the effect of temperature on body masses, the model uses the following general formula, following Forster and Hirst 2012: -$$ -M_i(T) = m_i * exp(log_{10}(PCM / 100 + 1) * T - 293.15) -$$ +$M_i(T) = m_i * exp(log_{10}(PCM / 100 + 1) * T - 293.15)$ Where $M_i$ is the body mass of species $i$, $T$ is the temperature (in Kelvins), $m_i$ is the body mass when there is no effect of temperature (provided by the user through `Z`, `bodymass` or `dry_mass_293`) and $PCM$ is the Percentage change in body-mass per degree Celsius. This percentage is calculated differently depending on the type of system or the type of response wanted (Forster and Hirst 2012, Sentis et al 2017):