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

AlgebraicGeometry: added graph_curve(::Graph) #4452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

YueRen
Copy link
Member

@YueRen YueRen commented Jan 11, 2025

The final pull request of the Durham Workshop. Requires #4450, so I will rebase + undraft it once #4450 is merged.

@YueRen YueRen marked this pull request as draft January 11, 2025 12:43
@YueRen YueRen force-pushed the yr/graphCurve branch 3 times, most recently from 8477178 to 181aca5 Compare January 13, 2025 11:48
@YueRen YueRen marked this pull request as ready for review January 13, 2025 11:52
@YueRen
Copy link
Member Author

YueRen commented Jan 13, 2025

I've rebased the changes now that #4450 is merged.

@benlorenz: I also had to add an Base.keys(::EdgeIterator) to the combinatorics part to make edges(::Graph) work with findall, e.g.,

G = vertex_edge_graph(simplex(3))
findall(edge->(1 in edge),edges(G))

Let me know if there are any objections. (I normally try to have separate pull-requests for separate areas, but was too lazy to make this one-line change)

@benlorenz
Copy link
Member

Adding keys would imply that eit[i] should work but that is not the case and would be difficult to make work. Also the length (and thus the new keys function) will change during iteration since the EdgeIterator is stateful.

julia> eit = edges(g)
Oscar.EdgeIterator(Polymake.LibPolymake.GraphEdgeIteratorAllocated{Undirected}(Ptr{Nothing} @0x000000003f407670), 6)

julia> length(eit)
6

julia> iterate(eit)
(Edge(2, 1), 2)

julia> iterate(eit)
(Edge(3, 1), 2)

julia> length(eit)
4

julia> collect(eit)
4-element Vector{Edge}:
 Edge(3, 2)
 Edge(4, 1)
 Edge(4, 2)
 Edge(4, 3)

@YueRen
Copy link
Member Author

YueRen commented Jan 13, 2025

Adding keys would imply that eit[i] should work but that is not the case and would be difficult to make work. Also the length (and thus the new keys function) will change during iteration since the EdgeIterator is stateful.

Okay, I will remove Base.keys(::EdgeIterators) then and use collect(edges(G)) in findall.

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.41%. Comparing base (7219bae) to head (50280d3).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4452   +/-   ##
=======================================
  Coverage   84.41%   84.41%           
=======================================
  Files         668      669    +1     
  Lines       88441    88457   +16     
=======================================
+ Hits        74656    74672   +16     
  Misses      13785    13785           
Files with missing lines Coverage Δ
src/AlgebraicGeometry/Curves/GraphCurve.jl 100.00% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants