Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounds check before assigning C-set subpart #204

Merged
merged 2 commits into from
Jul 17, 2020

Conversation

epatters
Copy link
Member

@epatters epatters commented Jul 16, 2020

The bare minimum fix for #199. It does not add support for rolling back C-set "transactions" but it does at least ensure that the internal state is consistent. For now, this is all I plan to do about this problem.

julia> using Catlab.CategoricalAlgebra.Graphs

julia> g = Graph();

julia> add_vertices!(g, 3)
1:3

julia> add_edge!(g, 1, 4)
ERROR: AssertionError: 0 <= subpart <= cset.nparts.V
[SNIP]

julia> src(g)
1-element Array{Int64,1}:
 1

julia> tgt(g)
1-element Array{Int64,1}:
 0

@epatters epatters added the bug label Jul 16, 2020
@epatters epatters requested review from jpfairbanks and removed request for jpfairbanks July 16, 2020 05:26
@epatters epatters merged commit 0f54542 into AlgebraicJulia:master Jul 17, 2020
@epatters epatters deleted the cset-bounds-check branch July 17, 2020 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant