Skip to content

Commit

Permalink
Merge pull request #2222 from xtalax/recompile
Browse files Browse the repository at this point in the history
Recompile Invalidations
  • Loading branch information
ChrisRackauckas authored Sep 11, 2023
2 parents 2f81ea6 + 5b58e4d commit d4095cf
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 66 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Expand Down
136 changes: 70 additions & 66 deletions src/ModelingToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,79 @@
$(DocStringExtensions.README)
"""
module ModelingToolkit
using DocStringExtensions
using Compat
using AbstractTrees
using DiffEqBase, SciMLBase, ForwardDiff, Reexport
using SciMLBase: StandardODEProblem, StandardNonlinearProblem, handle_varmap
using Distributed
using StaticArrays, LinearAlgebra, SparseArrays, LabelledArrays
using InteractiveUtils
using Latexify, Unitful, ArrayInterface
using MacroTools
@reexport using UnPack
using Setfield, ConstructionBase
using JumpProcesses
using DataStructures
using SpecialFunctions, NaNMath
using RuntimeGeneratedFunctions
using RuntimeGeneratedFunctions: drop_expr
using Base.Threads
using DiffEqCallbacks
using Graphs
import MacroTools: splitdef, combinedef, postwalk, striplines
import Libdl
using DocStringExtensions
using Base: RefValue
using Combinatorics
import IfElse
import Distributions
import FunctionWrappersWrappers
using URIs: URI

using PrecompileTools, Reexport
@recompile_invalidations begin
using DocStringExtensions
using Compat
using AbstractTrees
using DiffEqBase, SciMLBase, ForwardDiff
using SciMLBase: StandardODEProblem, StandardNonlinearProblem, handle_varmap
using Distributed
using StaticArrays, LinearAlgebra, SparseArrays, LabelledArrays
using InteractiveUtils
using Latexify, Unitful, ArrayInterface
using MacroTools
using Setfield, ConstructionBase
using JumpProcesses
using DataStructures
using SpecialFunctions, NaNMath
using RuntimeGeneratedFunctions
using RuntimeGeneratedFunctions: drop_expr
using Base.Threads
using DiffEqCallbacks
using Graphs
import MacroTools: splitdef, combinedef, postwalk, striplines
import Libdl
using DocStringExtensions
using Base: RefValue
using Combinatorics
import IfElse
import Distributions
import FunctionWrappersWrappers
using URIs: URI

using RecursiveArrayTools

import SymbolicIndexingInterface
import SymbolicIndexingInterface: independent_variables, states, parameters
export independent_variables, states, parameters
import SymbolicUtils
import SymbolicUtils: istree, arguments, operation, similarterm, promote_symtype,
Symbolic, isadd, ismul, ispow, issym, FnType,
@rule, Rewriters, substitute, metadata, BasicSymbolic,
Sym, Term
using SymbolicUtils.Code
import SymbolicUtils.Code: toexpr
import SymbolicUtils.Rewriters: Chain, Postwalk, Prewalk, Fixpoint
import JuliaFormatter

using MLStyle

using Reexport
using Symbolics: degree
@reexport using Symbolics
using Symbolics: _parse_vars, value, @derivatives, get_variables,
exprs_occur_in, solve_for, build_expr, unwrap, wrap,
VariableSource, getname, variable, Connection, connect,
NAMESPACE_SEPARATOR
import Symbolics: rename, get_variables!, _solve, hessian_sparsity,
jacobian_sparsity, isaffine, islinear, _iszero, _isone,
tosymbol, lower_varname, diff2term, var_from_nested_derivative,
BuildTargets, JuliaTarget, StanTarget, CTarget, MATLABTarget,
ParallelForm, SerialForm, MultithreadedForm, build_function,
rhss, lhss, prettify_expr, gradient,
jacobian, hessian, derivative, sparsejacobian, sparsehessian,
substituter, scalarize, getparent

import DiffEqBase: @add_kwonly

import Graphs: SimpleDiGraph, add_edge!, incidence_matrix

@reexport using UnPack
end
RuntimeGeneratedFunctions.init(@__MODULE__)

using RecursiveArrayTools

import SymbolicIndexingInterface
import SymbolicIndexingInterface: independent_variables, states, parameters
export independent_variables, states, parameters
import SymbolicUtils
import SymbolicUtils: istree, arguments, operation, similarterm, promote_symtype,
Symbolic, isadd, ismul, ispow, issym, FnType,
@rule, Rewriters, substitute, metadata, BasicSymbolic,
Sym, Term
using SymbolicUtils.Code
import SymbolicUtils.Code: toexpr
import SymbolicUtils.Rewriters: Chain, Postwalk, Prewalk, Fixpoint
import JuliaFormatter

using MLStyle

using Reexport
using Symbolics: degree
@reexport using Symbolics
export @derivatives
using Symbolics: _parse_vars, value, @derivatives, get_variables,
exprs_occur_in, solve_for, build_expr, unwrap, wrap,
VariableSource, getname, variable, Connection, connect,
NAMESPACE_SEPARATOR
import Symbolics: rename, get_variables!, _solve, hessian_sparsity,
jacobian_sparsity, isaffine, islinear, _iszero, _isone,
tosymbol, lower_varname, diff2term, var_from_nested_derivative,
BuildTargets, JuliaTarget, StanTarget, CTarget, MATLABTarget,
ParallelForm, SerialForm, MultithreadedForm, build_function,
rhss, lhss, prettify_expr, gradient,
jacobian, hessian, derivative, sparsejacobian, sparsehessian,
substituter, scalarize, getparent

import DiffEqBase: @add_kwonly

import Graphs: SimpleDiGraph, add_edge!, incidence_matrix

for fun in [:toexpr]
@eval begin
Expand Down

0 comments on commit d4095cf

Please sign in to comment.