From 6b5751c25dc345a8be25917572c83cfaff1d2405 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Aug 2024 10:35:37 -0400 Subject: [PATCH 1/2] Remove Requires.jl --- Project.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Project.toml b/Project.toml index 9fb97ed16..ebb80a014 100644 --- a/Project.toml +++ b/Project.toml @@ -30,7 +30,6 @@ NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" @@ -81,7 +80,6 @@ PrecompileTools = "1" RecipesBase = "1.1" Reexport = "1" ReferenceTests = "0.9" -Requires = "1.1" RuntimeGeneratedFunctions = "0.5.9" SciMLBase = "2" Setfield = "1" From 5fa265851baa4281ba5b220440fae12e5974ec23 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Aug 2024 10:37:05 -0400 Subject: [PATCH 2/2] Update Symbolics.jl --- src/Symbolics.jl | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/src/Symbolics.jl b/src/Symbolics.jl index 8d88e1470..1aa995851 100644 --- a/src/Symbolics.jl +++ b/src/Symbolics.jl @@ -200,36 +200,21 @@ 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 - -@static if !isdefined(Base,:get_extension) - function __init__() - @require Groebner="0b43b601-686d-58a3-8a1c-6623616c7cd4" begin - include("../ext/SymbolicsGroebnerExt.jl") - end - @require SymPy="24249f21-da20-56a4-8eb1-6a02cf4ae2e6" begin - include("../ext/SymbolicsSymPyExt.jl") - end - Base.Experimental.register_error_hint(TypeError) do io, exc - if exc.expected == Bool && exc.got isa Num - println(io, - "\nA symbolic expression appeared in a Boolean context. This error arises in situations where Julia expects a Bool, like ") - printstyled(io, "if boolean_condition", color = :blue) - printstyled( - io, "\t\t use ifelse(boolean_condition, then branch, else branch)\n", - color = :green) - printstyled(io, "x && y", color = :blue) - printstyled(io, "\t\t\t\t use x & y\n", color = :green) - printstyled(io, "boolean_condition ? a : b", color = :blue) - printstyled(io, "\t use ifelse(boolean_condition, a, b)\n", color = :green) - print(io, - "but a symbolic expression appeared instead of a Bool. For help regarding control flow with symbolic variables, see https://docs.sciml.ai/ModelingToolkit/dev/basics/FAQ/#How-do-I-handle-if-statements-in-my-symbolic-forms?") - end +function __init__() + Base.Experimental.register_error_hint(TypeError) do io, exc + if exc.expected == Bool && exc.got isa Num + println(io, + "\nA symbolic expression appeared in a Boolean context. This error arises in situations where Julia expects a Bool, like ") + printstyled(io, "if boolean_condition", color = :blue) + printstyled( + io, "\t\t use ifelse(boolean_condition, then branch, else branch)\n", + color = :green) + printstyled(io, "x && y", color = :blue) + printstyled(io, "\t\t\t\t use x & y\n", color = :green) + printstyled(io, "boolean_condition ? a : b", color = :blue) + printstyled(io, "\t use ifelse(boolean_condition, a, b)\n", color = :green) + print(io, + "but a symbolic expression appeared instead of a Bool. For help regarding control flow with symbolic variables, see https://docs.sciml.ai/ModelingToolkit/dev/basics/FAQ/#How-do-I-handle-if-statements-in-my-symbolic-forms?") end end end