From 50731eacf9a0f21b87c44cf6ce3e4e7c95b9bf4a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Feb 2024 13:43:22 -0500 Subject: [PATCH 1/4] See if only PreallocationTools does better? --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b63d00ec4..6787ca6ee 100644 --- a/Project.toml +++ b/Project.toml @@ -46,7 +46,7 @@ SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6" [extensions] SymbolicsForwardDiffExt = "ForwardDiff" SymbolicsGroebnerExt = "Groebner" -SymbolicsPreallocationToolsExt = ["ForwardDiff", "PreallocationTools"] +SymbolicsPreallocationToolsExt = "PreallocationTools" SymbolicsSymPyExt = "SymPy" [compat] From a55b5c0f98c75aee4cf34b9f9fab94e7b4733cbe Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Feb 2024 13:43:42 -0500 Subject: [PATCH 2/4] Update SymbolicsPreallocationToolsExt.jl --- ext/SymbolicsPreallocationToolsExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/SymbolicsPreallocationToolsExt.jl b/ext/SymbolicsPreallocationToolsExt.jl index f850c461b..5d2686c8c 100644 --- a/ext/SymbolicsPreallocationToolsExt.jl +++ b/ext/SymbolicsPreallocationToolsExt.jl @@ -2,7 +2,7 @@ module SymbolicsPreallocationToolsExt using PreallocationTools import PreallocationTools: _restructure, get_tmp -using Symbolics, ForwardDiff +using Symbolics, PreallocationTools.ForwardDiff function get_tmp(dc::DiffCache, u::Type{X}) where {T,N, X<: ForwardDiff.Dual{T, Num, N}} if length(dc.du) > length(dc.any_du) From e5ac4bf0577d1d86a668176258d5449acd9c085a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Feb 2024 16:48:03 -0500 Subject: [PATCH 3/4] Remove ForwardDiff extension and make a full dep --- Project.toml | 3 +-- src/Symbolics.jl | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 6787ca6ee..09959c397 100644 --- a/Project.toml +++ b/Project.toml @@ -13,6 +13,7 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf" DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07" +ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Groebner = "0b43b601-686d-58a3-8a1c-6623616c7cd4" IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" @@ -38,13 +39,11 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5" SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" [weakdeps] -ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Groebner = "0b43b601-686d-58a3-8a1c-6623616c7cd4" PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46" SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6" [extensions] -SymbolicsForwardDiffExt = "ForwardDiff" SymbolicsGroebnerExt = "Groebner" SymbolicsPreallocationToolsExt = "PreallocationTools" SymbolicsSymPyExt = "SymPy" diff --git a/src/Symbolics.jl b/src/Symbolics.jl index 9481525ab..80d841b80 100644 --- a/src/Symbolics.jl +++ b/src/Symbolics.jl @@ -177,6 +177,9 @@ end function symbolics_to_sympy end export symbolics_to_sympy +include("../ext/SymbolicsForwardDiffExt.jl") +using SymbolicsForwardDiffExt + @static if !isdefined(Base, :get_extension) using Requires end From b8e1be8e9fbbb68934e53377a5d30b564cbb3c4f Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Feb 2024 20:45:10 -0500 Subject: [PATCH 4/4] local module --- src/Symbolics.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symbolics.jl b/src/Symbolics.jl index 80d841b80..facd7e254 100644 --- a/src/Symbolics.jl +++ b/src/Symbolics.jl @@ -178,7 +178,7 @@ function symbolics_to_sympy end export symbolics_to_sympy include("../ext/SymbolicsForwardDiffExt.jl") -using SymbolicsForwardDiffExt +using ..SymbolicsForwardDiffExt @static if !isdefined(Base, :get_extension) using Requires