Skip to content

Commit

Permalink
Merge pull request #1180 from JuliaSymbolics/compilation
Browse files Browse the repository at this point in the history
Reduce dependencies and compilation
  • Loading branch information
ChrisRackauckas authored Jun 27, 2024
2 parents 1dbe8c4 + 100351c commit e6a34cd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
SymbolicLimits = "19f23fe9-fdab-4a78-91af-e7b7767979c3"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Expand Down Expand Up @@ -84,7 +84,6 @@ RuntimeGeneratedFunctions = "0.5.9"
SciMLBase = "2"
Setfield = "1"
SpecialFunctions = "2"
StaticArrays = "1.1"
SymPy = "2"
SymbolicIndexingInterface = "0.3.14"
SymbolicLimits = "0.2.0"
Expand Down
44 changes: 21 additions & 23 deletions src/Symbolics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,42 @@ module Symbolics

using PrecompileTools

@recompile_invalidations begin
using DocStringExtensions, Markdown

using DocStringExtensions, Markdown
using LinearAlgebra

using LinearAlgebra
using Reexport

using Reexport
using DomainSets

using DomainSets
using Setfield

using Setfield
import DomainSets: Domain

import DomainSets: Domain
using TermInterface
import TermInterface: maketerm, iscall, operation, arguments, symtype, metadata

using TermInterface
import TermInterface: maketerm, iscall, operation, arguments, symtype, metadata
import SymbolicUtils: Term, Add, Mul, Pow, Sym, Div, BasicSymbolic,
FnType, @rule, Rewriters, substitute,
promote_symtype, isadd, ismul, ispow, isterm, issym, isdiv

import SymbolicUtils: Term, Add, Mul, Pow, Sym, Div, BasicSymbolic,
FnType, @rule, Rewriters, substitute,
promote_symtype, isadd, ismul, ispow, isterm, issym, isdiv
using SymbolicUtils.Code

using SymbolicUtils.Code
import SymbolicUtils.Rewriters: Chain, Prewalk, Postwalk, Fixpoint

import SymbolicUtils.Rewriters: Chain, Prewalk, Postwalk, Fixpoint
import SymbolicUtils.Code: toexpr

import SymbolicUtils.Code: toexpr
import ArrayInterface
using RuntimeGeneratedFunctions
using SciMLBase, IfElse
import MacroTools

import ArrayInterface
using RuntimeGeneratedFunctions
using SciMLBase, IfElse
import MacroTools
using SymbolicIndexingInterface

using SymbolicIndexingInterface
import SymbolicLimits

import SymbolicLimits
using ADTypes: ADTypes

using ADTypes: ADTypes
end
@reexport using SymbolicUtils
RuntimeGeneratedFunctions.init(@__MODULE__)

Expand Down
2 changes: 1 addition & 1 deletion src/arrays.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using SymbolicUtils
using SymbolicUtils: @capture
using StaticArrays
using StaticArraysCore
import Base: eltype, length, ndims, size, axes, eachindex

export @arrayop, ArrayMaker, @makearray, @setview, @setview!
Expand Down
4 changes: 3 additions & 1 deletion src/diff.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract type Operator <: Function end
abstract type Operator end
propagate_shape(::Operator, x) = axes(x)

"""
Expand Down Expand Up @@ -45,6 +45,7 @@ end
(D::Differential)(x::Union{Num, Arr}) = wrap(D(unwrap(x)))
(D::Differential)(x::Complex{Num}) = wrap(ComplexTerm{Real}(D(unwrap(real(x))), D(unwrap(imag(x)))))
SymbolicUtils.promote_symtype(::Differential, T) = T
SymbolicUtils.isbinop(f::Differential) = false

is_derivative(x) = iscall(x) ? operation(x) isa Differential : false

Expand All @@ -54,6 +55,7 @@ Base.:*(D1::Differential, D2::Differential) = D1 ∘ D2
Base.:^(D::Differential, n::Integer) = iszero(n) ? identity : _repeat_apply(D, n)

Base.show(io::IO, D::Differential) = print(io, "Differential(", D.x, ")")
Base.nameof(D::Differential) = :Differential

Base.:(==)(D1::Differential, D2::Differential) = isequal(D1.x, D2.x)
Base.hash(D::Differential, u::UInt) = hash(D.x, xor(u, 0xdddddddddddddddd))
Expand Down

0 comments on commit e6a34cd

Please sign in to comment.