Skip to content

Commit a224914

Browse files
Merge pull request #813 from AayushSabharwal/as/rm-tabletraits
refactor: remove Tables.jl impl, fall back to RecursiveArrayTools
2 parents e683d52 + 17e3b0e commit a224914

File tree

6 files changed

+27
-78
lines changed

6 files changed

+27
-78
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ SciMLStructures = "53ae85a6-f571-4167-b2af-e1d143709226"
3030
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
3131
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
3232
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
33-
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
3433

3534
[weakdeps]
3635
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
@@ -111,9 +110,10 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
111110
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
112111
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
113112
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
113+
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
114114
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
115115
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
116116
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
117117

118118
[targets]
119-
test = ["Pkg", "Plots", "UnicodePlots", "PyCall", "PythonCall", "SafeTestsets", "Serialization", "Test", "StableRNGs", "StaticArrays", "StochasticDiffEq", "Aqua", "Zygote", "PartialFunctions", "DataFrames", "OrdinaryDiffEq", "ForwardDiff"]
119+
test = ["Pkg", "Plots", "UnicodePlots", "PyCall", "PythonCall", "SafeTestsets", "Serialization", "Test", "StableRNGs", "StaticArrays", "StochasticDiffEq", "Aqua", "Zygote", "PartialFunctions", "DataFrames", "OrdinaryDiffEq", "ForwardDiff", "Tables"]

src/SciMLBase.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if isdefined(Base, :Experimental) &&
44
@eval Base.Experimental.@max_methods 1
55
end
66
using ConstructionBase
7-
using RecipesBase, RecursiveArrayTools, Tables
7+
using RecipesBase, RecursiveArrayTools
88
using SciMLStructures
99
using SymbolicIndexingInterface
1010
using DocStringExtensions
@@ -741,7 +741,6 @@ include("ensemble/ensemble_analysis.jl")
741741
include("solve.jl")
742742
include("interpolation.jl")
743743
include("integrator_interface.jl")
744-
include("tabletraits.jl")
745744
include("remake.jl")
746745
include("callbacks.jl")
747746

src/tabletraits.jl

Lines changed: 0 additions & 66 deletions
This file was deleted.

test/downstream/tables.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using ModelingToolkit, OrdinaryDiffEq, Tables, Test
2+
using ModelingToolkit: t_nounits as t, D_nounits as D
3+
4+
@variables x(t) y(t)
5+
@parameters p q
6+
@mtkbuild sys = ODESystem(
7+
[D(x) ~ p * x + q * y, 0 ~ y^2 - 2x * y - 4], t, guesses = [y => 1.0])
8+
prob = ODEProblem(sys, [x => 1.0], (0.0, 5.0), [p => 1.0, q => 2.0])
9+
sol = solve(prob, Rodas5P())
10+
11+
@test sort(collect(Tables.columnnames(Tables.columns(sol)))) ==
12+
[:timestamp, Symbol("x(t)"), Symbol("y(t)")]

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ end
115115
@time @safetestset "ODE Solution Stripping" begin
116116
include("downstream/ode_stripping.jl")
117117
end
118+
@time @safetestset "Tables interface with MTK" begin
119+
include("downstream/tables.jl")
120+
end
118121
end
119122

120123
if !is_APPVEYOR && (GROUP == "Downstream" || GROUP == "SymbolicIndexingInterface")

test/traits.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
using SciMLBase, Test
1+
using SciMLBase, Tables, Test
22
using OrdinaryDiffEq, DataFrames, SymbolicIndexingInterface
33

4-
@test SciMLBase.Tables.isrowtable(ODESolution)
5-
@test SciMLBase.Tables.isrowtable(RODESolution)
6-
@test SciMLBase.Tables.isrowtable(DAESolution)
7-
@test !SciMLBase.Tables.isrowtable(SciMLBase.NonlinearSolution)
8-
@test !SciMLBase.Tables.isrowtable(SciMLBase.LinearSolution)
9-
@test !SciMLBase.Tables.isrowtable(SciMLBase.QuadratureSolution)
10-
@test !SciMLBase.Tables.isrowtable(SciMLBase.OptimizationSolution)
4+
# https://github.com/SciML/SciMLBase.jl/pull/813#issuecomment-2401803039
5+
@test !Tables.isrowtable(ODESolution)
6+
@test !Tables.isrowtable(RODESolution)
7+
@test !Tables.isrowtable(DAESolution)
8+
@test !Tables.isrowtable(SciMLBase.NonlinearSolution)
9+
@test !Tables.isrowtable(SciMLBase.LinearSolution)
10+
@test !Tables.isrowtable(SciMLBase.QuadratureSolution)
11+
@test !Tables.isrowtable(SciMLBase.OptimizationSolution)
1112

1213
function rhs(u, p, t)
1314
return -u

0 commit comments

Comments
 (0)