Browse Source

Added tests and ensured notebook compilation

pull/13/head
bosonbaas 2 months ago
parent
commit
9b5cb677d1
5 changed files with 130 additions and 274 deletions
  1. +120
    -269
      examples/company_demo/concise_demo_ACT.ipynb
  2. +2
    -1
      src/DB.jl
  3. +4
    -2
      test/Presentations.jl
  4. +2
    -0
      test/Queries.jl
  5. +2
    -2
      test/runtests.jl

+ 120
- 269
examples/company_demo/concise_demo_ACT.ipynb
File diff suppressed because it is too large
View File


+ 2
- 1
src/DB.jl View File

@ -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)


+ 4
- 2
test/Presentations.jl View File

@ -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
- 0
test/Queries.jl View File

@ -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

+ 2
- 2
test/runtests.jl View File

@ -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