Skip to content

Commit

Permalink
Use @decapode macro
Browse files Browse the repository at this point in the history
  • Loading branch information
lukem12345 authored and mehalter committed Apr 24, 2023
1 parent 28d6eb5 commit d2d5cfb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Decapodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export normalize_unicode, DerivOp, append_dot,
AbstractMeshKey, loadmesh, Icosphere, Rectangle_30x10, Torus_30x10, Point_Map,
Open, OpenSummationDecapodeOb, OpenSummationDecapode, unique_by, unique_by!, oapply,
CartesianPoint, SpherePoint, r, theta, phi, TangentBasis, θhat, ϕhat,
average_rewrite
average_rewrite,
@decapode

normalize_unicode(s::String) = Unicode.normalize(s, compose=true, stable=true, chartransform=Unicode.julia_chartransform)
normalize_unicode(s::Symbol) = Symbol(normalize_unicode(String(s)))
Expand Down
2 changes: 1 addition & 1 deletion src/language.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,6 @@ function SummationDecapode(e::DecaExpr)
return d
end

macro SummationDecapode(e)
macro decapode(e)
:(SummationDecapode(parse_decapode($(Meta.quot(e)))))
end
4 changes: 1 addition & 3 deletions test/composition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ using Catlab.CSetDataStructures
import Decapodes: OpenSummationDecapode, Open, oapply, oapply_rename
# @testset "Composition" begin
# Simplest possible decapode relation.
TrivialExprBody = quote
Trivial = @decapode begin
H::Form0{X}
end

trivalExpr = parse_decapode(TrivialExprBody)
Trivial = SummationDecapode(trivalExpr)
trivial_relation = @relation () begin
trivial(H)
end
Expand Down

0 comments on commit d2d5cfb

Please sign in to comment.