AlgebraicJulia / AlgebraicJulia/ACSets.jl

Need to be able to form `Open` versions of `InterType` acsets

Đang mở
#89 0 bình luận 0 reaction 1 người được giao Được @olynch nhận Xem trên GitHub
enhancement
Ngôn ngữ chính
Julia
Star
36
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

It would be good to be able to form open versions of `intertype` acsets. Currently, using the output constructors from `OpenACSetTypes` doesn't appear to work, as in the weighted graphs example below. (Note that `OpenCSetTypes` does appear to work for plain graphs.)

The following example for weighted graphs (which uses the `wgraph.it` file from the tests) errors:
```
using ACSets.InterTypes
@intertypes "wgraph.it" module wgraph end
using .wgraph
OpenITWGraphOb, OpenITWGraph = OpenACSetTypes(wgraph.WeightedGraph, :V)
g0′ = wgraph.EDWeightedGraph()
add_parts!(g0′, :V, 2)
add_part!(g0′, :E, src=1, tgt=2, weight=wgraph.EdgeData(:mass, 5))
g′ = OpenITWGraph{UInt64}(g0′, FinFunction([1],2), FinFunction([2],2))
```
The error is:
```
g′ = OpenITWGraph{UInt64}(g0′, FinFunction([1],2), FinFunction([2],2))
ERROR: MethodError: no method matching coerce_attrvar_component(::Symbol, ::UnitRange{Int64}, ::TypeSet{UInt64}, ::TypeSet{Main.wgraph.EdgeData}, ::Int64, ::Int64)

Closest candidates are:
coerce_attrvar_component(::Symbol, ::AbstractVector, ::TypeSet{T}, ::TypeSet{T}, ::Int64, ::Int64) where T
@ Catlab ~/.julia/packages/Catlab/ARIR5/src/categorical_algebra/CSets.jl:452
coerce_attrvar_component(::Symbol, ::LooseVarFunction, ::TypeSet{T}, ::TypeSet{T′}, ::Int64, ::Int64) where {T, T′}
@ Catlab ~/.julia/packages/Catlab/ARIR5/src/categorical_algebra/CSets.jl:468
coerce_attrvar_component(::Symbol, ::Function, ::TypeSet{T}, ::TypeSet{T′}, ::Int64, ::Int64) where {T, T′}
@ Catlab ~/.julia/packages/Catlab/ARIR5/src/categorical_algebra/CSets.jl:480
...
```

For comparison, the non-`intertype` version (obviously) works.
```
using Catlab.GATs, Catlab.Theories, Catlab.Graphs, Catlab.CategoricalAlgebra
const OpenWeightedGraphOb, OpenWeightedGraph = OpenACSetTypes(WeightedGraph, :V)
g0 = WeightedGraph{Float64}(2)
add_edge!(g0, 1, 2, weight=1.5)
g = OpenWeightedGraph{Float64}(g0, FinFunction([1],2), FinFunction([2],2))
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.