From 4ff2006ccd4b49fdec9ae94a9df204d489843db2 Mon Sep 17 00:00:00 2001 From: longemen3000 Date: Wed, 23 Oct 2024 14:40:18 -0300 Subject: [PATCH] move DynamicQuantities to extension --- Project.toml | 8 +++++++- ext/LangmuirDynamicQuantitiesExt.jl | 11 +++++++++++ src/models/models.jl | 4 ---- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 ext/LangmuirDynamicQuantitiesExt.jl diff --git a/Project.toml b/Project.toml index f35f19b..73727bf 100644 --- a/Project.toml +++ b/Project.toml @@ -6,7 +6,6 @@ version = "0.1.0" [deps] BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209" CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Integrals = "de52edbc-65ea-441a-8357-d3a637375a31" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -21,6 +20,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] BlackBoxOptim = "^0.6.2" CommonSolve = "0.2.4" +DynamicQuantities = "1" ForwardDiff = "^0.10" Integrals = "4" LinearAlgebra = "1" @@ -33,6 +33,12 @@ TableOperations = "1" Tables = "^1.8" julia = "1.9" +[weakdeps] +DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821" + +[extensions] +LangmuirDynamicQuantitiesExt = "DynamicQuantities" + [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/ext/LangmuirDynamicQuantitiesExt.jl b/ext/LangmuirDynamicQuantitiesExt.jl new file mode 100644 index 0000000..cbe7382 --- /dev/null +++ b/ext/LangmuirDynamicQuantitiesExt.jl @@ -0,0 +1,11 @@ +module LangmuirDynamicQuantitiesExt + +import Langmuir +import DynamicQuantities +using DynamicQuantities: @u_str + +function Langmuir.Rgas(model::Langmuir.IsothermModel{<:DynamicQuantities.Quantity}) + return 8.31446261815324u"J/mol/K" +end + +end #module \ No newline at end of file diff --git a/src/models/models.jl b/src/models/models.jl index 360c1ff..84ddfa5 100644 --- a/src/models/models.jl +++ b/src/models/models.jl @@ -6,10 +6,6 @@ end Rgas(model) = 8.31446261815324 #J.mol⁻¹.K⁻¹ -function Rgas(model::IsothermModel{<:Quantity}) - return 8.31446261815324u"J/mol/K" -end - """ model_length(model::IsothermModel)