Browse Source

Added tests and ensured notebook compilation

pull/13/head
bosonbaas 5 months ago
parent
commit
9b5cb677d1
  1. 389
      examples/company_demo/concise_demo_ACT.ipynb
  2. 3
      src/DB.jl
  3. 6
      test/Presentations.jl
  4. 2
      test/Queries.jl
  5. 4
      test/runtests.jl

389
examples/company_demo/concise_demo_ACT.ipynb
File diff suppressed because it is too large
View File

3
src/DB.jl

@ -13,13 +13,14 @@ module DB
typeToSQL(x) = TypeToSQL[string(x)]
@present TheorySQL(FreeSchema) begin
Int::Data
Int64::Data
Real::Data
String::Data
Bool::Data
end;
function SchemaType(present::Presentation)
ACSetType(present){Int, Real, String, Bool}
ACSetType(present){Int, Int64, Real, String, Bool}
end
const AbstractSQL = AbstractACSetType(TheorySQL)

6
test/Presentations.jl

@ -19,6 +19,8 @@ extract, split_im, train, evaluate = add_processes!(wf, [(:extract, Files, Image
(:evaluate, NeuralNet⊗Images, Accuracy⊗Metadata)]);
# Convert to Schema
TrainDB = present_to_schema(wf);
draw_schema(wf)
g = draw_schema(wf)
@test typeof(wf) <: Catlab.Present.Presentation
@test wf isa Catlab.Present.Presentation
@test TrainDB <: Catlab.CategoricalAlgebra.ACSet
@test g isa Catlab.Graphics.Graphviz.Graph

2
test/Queries.jl

@ -2,6 +2,7 @@ using AlgebraicRelations.DB
using AlgebraicRelations.Queries
using SQLite
using DataFrames
using Catlab
@present WorkplaceSchema <: TheorySQL begin
# Data tables
@ -76,4 +77,5 @@ end
@test ["Alice Smith",
"Bob Jones",
"John Doe"] == A[!, "n"]
@test draw_query(q) isa Catlab.Graphics.Graphviz.Graph
end

4
test/runtests.jl

@ -12,6 +12,6 @@ end
include("Queries.jl")
end
@testset "Workflow" begin
include("Workflows.jl")
@testset "Presentations" begin
include("Presentations.jl")
end
Loading…
Cancel
Save