Skip to content

Commit

Permalink
Merge pull request #174 from AlgebraicJulia/cm/docs
Browse files Browse the repository at this point in the history
Fixed autodocs
  • Loading branch information
KevinDCarlson authored Dec 18, 2024
2 parents 05427d5 + a1f10df commit 8c4c3b6
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 46 deletions.
16 changes: 16 additions & 0 deletions .buildkite/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

pwd; hostname; date

if [ $# -ne 1 ]; then
echo "Usage: $0 VERSION"
echo "Example: $0 1.10.0"
exit 1
fi

VERSION=$1

module load julia/$VERSION

echo "Building documentation..."
julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.status(); Pkg.instantiate(); include("docs/make.jl")'
23 changes: 3 additions & 20 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
env:
JULIA_VERSION: "1.10.2"
GATAS_HOME: "~/.gatas/buildkite/agents/$BUILDKITE_AGENT_NAME"

steps:

- label: ":hammer: Build Project"
env:
JULIA_DEPOT_PATH: "$GATAS_HOME"
commands:
- "module load julia"
- "julia --project=docs --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()'"

- wait

- label: ":scroll: Build docs and run tests"
env:
JULIA_DEPOT_PATH: "$GATAS_HOME"
JULIA_PROJECT: "docs/"
command:
- "srun --cpus-per-task=16 --mem=64G --time=1:00:00 --output=.buildkite/build_%j.log --unbuffered .buildkite/jobscript.sh"
- label: ":arrow_down: Load AlgebraicJulia pipeline"
command: |
curl -s https://raw.githubusercontent.com/AlgebraicJulia/.github/main/buildkite/pipeline.yml | buildkite-agent pipeline upload
- wait

15 changes: 15 additions & 0 deletions .buildkite/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
pwd; hostname; date

if [ $# -ne 1 ]; then
echo "Usage: $0 VERSION"
echo "Example: $0 1.10.0"
exit 1
fi

VERSION=$1

module load julia/$VERSION

echo "Running tests..."
julia --project -e "using Pkg; Pkg.status(); Pkg.test()"
2 changes: 0 additions & 2 deletions .github/workflows/julia_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ jobs:
if: github.event_name == 'pull_request' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.action == 'test')
uses: AlgebraicJulia/.github/.github/workflows/julia_ci.yml@main
secrets: inherit
with:
docs: false
CompatHelper:
if: github.event_name == 'schedule'
uses: AlgebraicJulia/.github/.github/workflows/julia_compat.yml@main
Expand Down
4 changes: 3 additions & 1 deletion docs/literate/migrations_intro.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# DataMigrations.jl includes facilities for categorical data migrations.
# # Introduction to Data Migrations

# DataMigrations.jl includes facilities for categorical data migrations.
# We'll start by example, working with some graph schemas from Catlab.

using Catlab, DataMigrations
Expand Down
9 changes: 9 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
```@autodocs
Modules = [DataMigrations]
```

```@autodocs
Modules = [DataMigrations.Migrations]
```

```@autodocs
Modules = [DataMigrations.DiagrammaticPrograms]
Private = false
```
2 changes: 2 additions & 0 deletions src/DataMigrations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ module DataMigrations

using Reexport
export func

include("Migrations.jl")
include("DiagrammaticPrograms.jl")

@reexport using .Migrations
@reexport using .DiagrammaticPrograms

end
45 changes: 22 additions & 23 deletions src/Migrations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ consisting of `shape_map`, `diagram_map`, and `precomposed_diagram`
is whiskered with `X` (except where it's undefined),
and then the functions in `params` are used to fill in the gaps.
See also [`QueryDiagram`](@ref), [`param_compose`](@ref)
See also [`QueryDiagram`](@ref)
"""
struct QueryDiagramHom{T,C<:Cat,F<:FinFunctor<:FinTransformation,D<:Functor{<:FinCat,C},Params<:AbstractDict}<:DiagramHom{T,C}
shape_map::F
Expand Down Expand Up @@ -143,28 +143,6 @@ DiagramHom{T}(f::QueryDiagramHom) where T =
QueryDiagramHom{T}(f.shape_map, f.diagram_map, f.precomposed_diagram,get_params(f))


#Note there's currently no composition of QueryDiagramHoms.

#This and some others can probably be dispatched to just querydiagramhoms?
"""
compose(f::DiagramHom,F::Functor,params[;kw...])
Whisker a partially-defined `DiagramHom` with a
`Functor`, using the dictionary `params` to fill in any gaps.
While [`QueryDiagramHom`](@ref)s have internal `params` for a similar
purpose, it is sometimes necessary to borrow `params` from
a [`QueryDiagram`](@ref) or [`DataMigration`](@ref) containing `f`, which
is the functionality enabled here.
See also: `param_compose`
"""
function compose(f::DiagramHom{T}, F::Functor, params;kw...) where T
whiskered = param_compose(diagram_map(f),F,params)
DiagramHom{T}(shape_map(f), whiskered,
compose(f.precomposed_diagram, F; kw...))
end

"""
param_compose(α,H,params)
Expand Down Expand Up @@ -194,6 +172,27 @@ function param_compose(α::FinTransformation, H::Functor,params)
FinTransformation(new_components,compose(F, H), compose(G, H))
end

#Note there's currently no composition of QueryDiagramHoms.

#This and some others can probably be dispatched to just querydiagramhoms?
"""
compose(f::DiagramHom,F::Functor,params[;kw...])
Whisker a partially-defined `DiagramHom` with a
`Functor`, using the dictionary `params` to fill in any gaps.
While [`QueryDiagramHom`](@ref)s have internal `params` for a similar
purpose, it is sometimes necessary to borrow `params` from
a [`QueryDiagram`](@ref) containing `f`, which
is the functionality enabled here.
"""
function compose(f::DiagramHom{T}, F::Functor, params;kw...) where T
whiskered = param_compose(diagram_map(f),F,params)
DiagramHom{T}(shape_map(f), whiskered,
compose(f.precomposed_diagram, F; kw...))
end


"""
compose(d::QueryDiagram,F::Functor[;kw...])
Expand Down

0 comments on commit 8c4c3b6

Please sign in to comment.