From 9514c4683a1f7a28b4c9668dc51bcfb9e031465c Mon Sep 17 00:00:00 2001 From: Evan Patterson Date: Fri, 27 Oct 2023 10:55:37 -0700 Subject: [PATCH] CLEANUP: Reexport GATlab from `Catlab.Theories`. --- docs/literate/graphs/graphs_label.jl | 7 +++---- docs/literate/sketches/meets.jl | 5 ++--- docs/literate/sketches/preorders.jl | 2 +- docs/literate/wiring_diagrams/wd_cset.jl | 7 ++----- experiments/Markov/src/MarkovCategories.jl | 1 - experiments/Markov/src/StochExpr.jl | 2 +- experiments/Markov/test/StochMapsExpr.jl | 2 +- src/categorical_algebra/CatElements.jl | 1 - src/categorical_algebra/FinSets.jl | 1 - src/graphics/GraphvizCategories.jl | 1 - src/graphs/BipartiteGraphs.jl | 1 - src/graphs/PropertyGraphs.jl | 1 - src/theories/Theories.jl | 4 +++- src/wiring_diagrams/CPortGraphs.jl | 1 - src/wiring_diagrams/MonoidalDirected.jl | 1 - test/categorical_algebra/ACSetsGATsInterop.jl | 3 +-- test/categorical_algebra/CSets.jl | 1 - test/categorical_algebra/CatElements.jl | 2 +- test/categorical_algebra/Categories.jl | 1 - test/categorical_algebra/Chase.jl | 1 - test/categorical_algebra/DataMigrations.jl | 2 +- test/categorical_algebra/FinCats.jl | 1 - test/categorical_algebra/FinSets.jl | 1 - test/categorical_algebra/FunctorialDataMigrations.jl | 1 - test/categorical_algebra/StructuredCospans.jl | 1 - test/graphics/GraphvizCategories.jl | 1 - test/programs/GenerateJuliaPrograms.jl | 2 -- test/programs/ParseJuliaPrograms.jl | 2 -- test/theories/Theories.jl | 1 - 29 files changed, 16 insertions(+), 41 deletions(-) diff --git a/docs/literate/graphs/graphs_label.jl b/docs/literate/graphs/graphs_label.jl index 7de1d28b5..ec6065de1 100644 --- a/docs/literate/graphs/graphs_label.jl +++ b/docs/literate/graphs/graphs_label.jl @@ -1,10 +1,9 @@ # # Labeled Graphs # This example demonstrates how to define new C-Sets from existing C-Sets via the example of adding labels to a graph. We treat labels as members of an arbitrary FinSet of labels rather than a data attribute for pedagogical reasons. When you think of graphs where the labels are numbers, colors, or values of some kind, you would want to make them attributes. The motivation for this example is to be the simplest extension to the theory of graphs that you could possibly make. -using GATlab, Catlab.Theories -using Catlab.CategoricalAlgebra -using Catlab.Graphs -using Catlab.Graphics +using Catlab.Theories, Catlab.CategoricalAlgebra +using Catlab.Graphs, Catlab.Graphics + using Colors draw(g) = to_graphviz(g, node_labels=true, edge_labels=true) diff --git a/docs/literate/sketches/meets.jl b/docs/literate/sketches/meets.jl index 0d490e816..992710f88 100644 --- a/docs/literate/sketches/meets.jl +++ b/docs/literate/sketches/meets.jl @@ -9,10 +9,9 @@ using Core: GeneratedFunctionStub using Test -using GATlab, Catlab.Theories, Catlab.CategoricalAlgebra -using Catlab.Graphics - +using Catlab.Theories, Catlab.CategoricalAlgebra, Catlab.Graphics import Catlab.Theories: compose + using DataStructures # # Defining some basic preorders diff --git a/docs/literate/sketches/preorders.jl b/docs/literate/sketches/preorders.jl index 17a28e20c..e29343446 100644 --- a/docs/literate/sketches/preorders.jl +++ b/docs/literate/sketches/preorders.jl @@ -12,7 +12,7 @@ using Core: GeneratedFunctionStub using Test -using GATlab, Catlab.Theories, Catlab.CategoricalAlgebra +using Catlab.Theories, Catlab.CategoricalAlgebra import Catlab.Theories: compose #= diff --git a/docs/literate/wiring_diagrams/wd_cset.jl b/docs/literate/wiring_diagrams/wd_cset.jl index 59e7e3f98..9b544de22 100644 --- a/docs/literate/wiring_diagrams/wd_cset.jl +++ b/docs/literate/wiring_diagrams/wd_cset.jl @@ -1,10 +1,7 @@ # # Wiring Diagrams as Attributed C-Sets # Catlab supports many different flavors of diagrammatic syntax. These support the different combinatorial data structures that we use for representing categorical constructions. We will discuss DirectedWiringDiagrams, UndirectedWiringDiagrams, and CPortGraphs in this document. -using GATlab, Catlab.Theories -using Catlab.CategoricalAlgebra -using Catlab.WiringDiagrams -using Catlab.Programs -using Catlab.Graphics +using Catlab.Theories, Catlab.CategoricalAlgebra +using Catlab.WiringDiagrams, Catlab.Programs, Catlab.Graphics using Catlab.Graphics: Graphviz draw(d::WiringDiagram) = to_graphviz(d, diff --git a/experiments/Markov/src/MarkovCategories.jl b/experiments/Markov/src/MarkovCategories.jl index 65f2fb9ee..bb047fa3f 100644 --- a/experiments/Markov/src/MarkovCategories.jl +++ b/experiments/Markov/src/MarkovCategories.jl @@ -3,7 +3,6 @@ export ThMarkovCategory, FreeMarkovCategory, Ob, Hom, dom, codom, compose, ⋅, ∘, otimes, ⊗, braid, mcopy, Δ, delete, ◊, expectation, 𝔼 -using GATlab using Catlab.Theories, Catlab.WiringDiagrams import GATlab: show_latex import Catlab.Theories: Ob, Hom, dom, codom, compose, ⋅, ∘, otimes, ⊗, braid, diff --git a/experiments/Markov/src/StochExpr.jl b/experiments/Markov/src/StochExpr.jl index d4798d175..b24f158c2 100644 --- a/experiments/Markov/src/StochExpr.jl +++ b/experiments/Markov/src/StochExpr.jl @@ -1,6 +1,6 @@ export crand -using GATlab, Catlab.Theories +using Catlab.Theories # How do you give semantics to a stochastic map? You call it. diff --git a/experiments/Markov/test/StochMapsExpr.jl b/experiments/Markov/test/StochMapsExpr.jl index a7251d409..72c5ace89 100644 --- a/experiments/Markov/test/StochMapsExpr.jl +++ b/experiments/Markov/test/StochMapsExpr.jl @@ -1,6 +1,6 @@ using Test -using GATlab, Catlab.Theories +using Catlab.Theories using Markov X = Ob(FreeCartesianCategory, :Float64) diff --git a/src/categorical_algebra/CatElements.jl b/src/categorical_algebra/CatElements.jl index 1f6b6f06e..adb7a53d1 100644 --- a/src/categorical_algebra/CatElements.jl +++ b/src/categorical_algebra/CatElements.jl @@ -3,7 +3,6 @@ export SchElements, AbstractElements, Elements, elements, inverse_elements using DataStructures: OrderedDict -using GATlab using ...Theories using ..CSets, ..FinSets, ..HomSearch diff --git a/src/categorical_algebra/FinSets.jl b/src/categorical_algebra/FinSets.jl index 53b19e1bc..2a78c43c2 100644 --- a/src/categorical_algebra/FinSets.jl +++ b/src/categorical_algebra/FinSets.jl @@ -15,7 +15,6 @@ import Tables, PrettyTables using ACSets @reexport using ..Sets -using GATlab using ...Theories, ...Graphs using ..FinCats, ..FreeDiagrams, ..Limits, ..Subobjects import ...Theories: Ob, meet, ∧, join, ∨, top, ⊤, bottom, ⊥, ⋅, dom, codom, diff --git a/src/graphics/GraphvizCategories.jl b/src/graphics/GraphvizCategories.jl index 0e0eac1ad..acfe15251 100644 --- a/src/graphics/GraphvizCategories.jl +++ b/src/graphics/GraphvizCategories.jl @@ -3,7 +3,6 @@ module GraphvizCategories export to_graphviz, to_graphviz_property_graph -using GATlab using ...Theories, ...CategoricalAlgebra, ...Graphs, ..GraphvizGraphs import ..Graphviz import ..GraphvizGraphs: to_graphviz, to_graphviz_property_graph diff --git a/src/graphs/BipartiteGraphs.jl b/src/graphs/BipartiteGraphs.jl index e0af1f878..cc3ddb3cf 100644 --- a/src/graphs/BipartiteGraphs.jl +++ b/src/graphs/BipartiteGraphs.jl @@ -18,7 +18,6 @@ export HasBipartiteVertices, HasBipartiteGraph, rem_edge₁₂!, rem_edge₂₁!, rem_edges₁₂!, rem_edges₂₁! using ACSets, ...ACSetsGATsInterop -using GATlab using ...Theories using ..BasicGraphs: flatten import ..BasicGraphs: nv, ne, vertices, edges, src, tgt, add_edge!, add_edges!, diff --git a/src/graphs/PropertyGraphs.jl b/src/graphs/PropertyGraphs.jl index 37e790df4..c7b781d71 100644 --- a/src/graphs/PropertyGraphs.jl +++ b/src/graphs/PropertyGraphs.jl @@ -6,7 +6,6 @@ export AbstractPropertyGraph, PropertyGraph, SchPropertyGraph, set_gprop!, set_vprop!, set_eprop!, set_gprops!, set_vprops!, set_eprops! using ACSets -using GATlab using ...Theories using ..BasicGraphs import ..BasicGraphs: nv, ne, src, tgt, inv, edges, vertices, diff --git a/src/theories/Theories.jl b/src/theories/Theories.jl index c77cecab5..2067e3f86 100644 --- a/src/theories/Theories.jl +++ b/src/theories/Theories.jl @@ -6,11 +6,13 @@ are also included. module Theories export CategoryExpr, ObExpr, HomExpr +using Reexport + import Base: ≤, +, *, inv, zero, join, show, collect, ndims import AlgebraicInterfaces: dom, codom, compose, id, Ob, ob, Hom, hom, munit, mcompose, ocompose, oapply, attr, attrtype -using GATlab +@reexport using GATlab import GATlab: show_unicode, show_latex """ Base type for GAT expressions in categories or other categorical structures. diff --git a/src/wiring_diagrams/CPortGraphs.jl b/src/wiring_diagrams/CPortGraphs.jl index d6fce927f..1848f9d63 100644 --- a/src/wiring_diagrams/CPortGraphs.jl +++ b/src/wiring_diagrams/CPortGraphs.jl @@ -3,7 +3,6 @@ export SchCPortGraph, SchOpenCPortGraph, SchSymCPortGraph, SchOpenSymCPortGraph, CPortGraph, OpenCPortGraph, SymCPortGraph, OpenSymCPortGraph, ThBundledCPG, BundledCPG -using GATlab using ...Theories, ...CategoricalAlgebra, ...Graphs import ...CategoricalAlgebra: migrate! import ..DirectedWiringDiagrams: ocompose diff --git a/src/wiring_diagrams/MonoidalDirected.jl b/src/wiring_diagrams/MonoidalDirected.jl index 6997fe272..68cd0e7e5 100644 --- a/src/wiring_diagrams/MonoidalDirected.jl +++ b/src/wiring_diagrams/MonoidalDirected.jl @@ -13,7 +13,6 @@ export Ports, Junction, PortOp, BoxOp, functor, permute, using StructEquality -using GATlab using ...Theories import GATlab: functor, head import ...Theories: dom, codom, id, compose, ⋅, ∘, diff --git a/test/categorical_algebra/ACSetsGATsInterop.jl b/test/categorical_algebra/ACSetsGATsInterop.jl index 6028b00a2..ce467d6ba 100644 --- a/test/categorical_algebra/ACSetsGATsInterop.jl +++ b/test/categorical_algebra/ACSetsGATsInterop.jl @@ -1,8 +1,7 @@ module TestACSetsGATsInterop using Test -using GATlab -using Catlab.CategoricalAlgebra +using GATlab, Catlab.CategoricalAlgebra using Catlab.Graphs: SchGraph, SchWeightedGraph @present SchDendrogram(FreeSchema) begin diff --git a/test/categorical_algebra/CSets.jl b/test/categorical_algebra/CSets.jl index aa30a13c3..6c1d09242 100644 --- a/test/categorical_algebra/CSets.jl +++ b/test/categorical_algebra/CSets.jl @@ -1,7 +1,6 @@ module TestCSets using Test -using GATlab using Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra @present SchDDS(FreeSchema) begin diff --git a/test/categorical_algebra/CatElements.jl b/test/categorical_algebra/CatElements.jl index edbf2480a..16ede5a11 100644 --- a/test/categorical_algebra/CatElements.jl +++ b/test/categorical_algebra/CatElements.jl @@ -1,6 +1,6 @@ module TestCatElements using Test -using GATlab + using Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra arr = path_graph(Graph, 2) diff --git a/test/categorical_algebra/Categories.jl b/test/categorical_algebra/Categories.jl index bbf464e8c..33107987d 100644 --- a/test/categorical_algebra/Categories.jl +++ b/test/categorical_algebra/Categories.jl @@ -1,7 +1,6 @@ module TestCategories using Test -using GATlab using Catlab.Theories using Catlab.CategoricalAlgebra diff --git a/test/categorical_algebra/Chase.jl b/test/categorical_algebra/Chase.jl index de9e0e00c..544b71c99 100644 --- a/test/categorical_algebra/Chase.jl +++ b/test/categorical_algebra/Chase.jl @@ -1,7 +1,6 @@ module TestChase using Test -using GATlab using Catlab.Theories, Catlab.CategoricalAlgebra, Catlab.Graphs using Catlab.CategoricalAlgebra.Chase: egd, tgd, crel_type, pres_to_eds, from_c_rel, collage diff --git a/test/categorical_algebra/DataMigrations.jl b/test/categorical_algebra/DataMigrations.jl index 671d23b20..e5f1f09be 100644 --- a/test/categorical_algebra/DataMigrations.jl +++ b/test/categorical_algebra/DataMigrations.jl @@ -1,7 +1,7 @@ module TestDataMigrations using Test -using GATlab, Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra +using Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra using Catlab.Programs.DiagrammaticPrograms @present SchSet(FreeSchema) begin diff --git a/test/categorical_algebra/FinCats.jl b/test/categorical_algebra/FinCats.jl index ed8e28458..f95d91f93 100644 --- a/test/categorical_algebra/FinCats.jl +++ b/test/categorical_algebra/FinCats.jl @@ -1,7 +1,6 @@ module TestFinCats using Test -using GATlab using Catlab.Theories, Catlab.CategoricalAlgebra, Catlab.Graphs # Categories on graphs diff --git a/test/categorical_algebra/FinSets.jl b/test/categorical_algebra/FinSets.jl index e2d8d0589..e5decf187 100644 --- a/test/categorical_algebra/FinSets.jl +++ b/test/categorical_algebra/FinSets.jl @@ -1,7 +1,6 @@ module TestFinSets using Test -using GATlab using Catlab.Theories, Catlab.CategoricalAlgebra using Catlab.CategoricalAlgebra.FinSets: VarSet diff --git a/test/categorical_algebra/FunctorialDataMigrations.jl b/test/categorical_algebra/FunctorialDataMigrations.jl index a652b0c83..3ed85b741 100644 --- a/test/categorical_algebra/FunctorialDataMigrations.jl +++ b/test/categorical_algebra/FunctorialDataMigrations.jl @@ -1,7 +1,6 @@ module TestFunctorialDataMigrations using Test -using GATlab using Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra @present SchSet(FreeSchema) begin diff --git a/test/categorical_algebra/StructuredCospans.jl b/test/categorical_algebra/StructuredCospans.jl index af58ca16d..a7e7aeec5 100644 --- a/test/categorical_algebra/StructuredCospans.jl +++ b/test/categorical_algebra/StructuredCospans.jl @@ -1,7 +1,6 @@ module TestStructuredCospans using Test -using GATlab using Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra # Structured cospans of C-sets diff --git a/test/graphics/GraphvizCategories.jl b/test/graphics/GraphvizCategories.jl index 90b1834bf..cf6521227 100644 --- a/test/graphics/GraphvizCategories.jl +++ b/test/graphics/GraphvizCategories.jl @@ -1,7 +1,6 @@ module TestGraphvizCategories using Test -using GATlab using Catlab.Theories, Catlab.CategoricalAlgebra, Catlab.Graphs using Catlab.Graphics.GraphvizCategories using Catlab.Graphics: Graphviz diff --git a/test/programs/GenerateJuliaPrograms.jl b/test/programs/GenerateJuliaPrograms.jl index a1a553b40..d1b94cf34 100644 --- a/test/programs/GenerateJuliaPrograms.jl +++ b/test/programs/GenerateJuliaPrograms.jl @@ -1,8 +1,6 @@ module TestGenerateJuliaPrograms - using Test -using GATlab using Catlab.Theories using Catlab.Programs.GenerateJuliaPrograms diff --git a/test/programs/ParseJuliaPrograms.jl b/test/programs/ParseJuliaPrograms.jl index 1d7a8188b..09ba68c88 100644 --- a/test/programs/ParseJuliaPrograms.jl +++ b/test/programs/ParseJuliaPrograms.jl @@ -1,8 +1,6 @@ module TestParseJuliaPrograms - using Test -using GATlab using Catlab.Theories, Catlab.WiringDiagrams using Catlab.Programs using Catlab.Programs.ParseJuliaPrograms: normalize_arguments diff --git a/test/theories/Theories.jl b/test/theories/Theories.jl index ec0b4eafc..9e30dbd99 100644 --- a/test/theories/Theories.jl +++ b/test/theories/Theories.jl @@ -1,7 +1,6 @@ module TestTheories using Test -using GATlab using Catlab.Theories sexpr(expr::GATExpr) = sprint(show_sexpr, expr)