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

Redesign GenericNamedGraph type #73

Merged
merged 16 commits into from
Apr 26, 2024
Merged

Redesign GenericNamedGraph type #73

merged 16 commits into from
Apr 26, 2024

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Apr 24, 2024

Closes #70.

The new design is:

  • vertices(::GenericNamedGraph) returns an I::OrderedIndices object. Iterating over those returns the vertices in the order corresponding to the underlying simple graph. Additionally, I::OrderedIndices stores a hash map so it has fast vertex lookup, and has positional indexing with syntax inspired by OrdinalIndexing.jl as I[4th] to get the 4th index/element of the set. That is needed since it is an AbstractIndices subtype based on the AbstractIndices interface of Dictionaries.jl, where the interface is that indexing into AbstractIndices maps the index back to itself if it is an element of the set.
  • position_graph(::GenericNamedGraph) outputs the underlying simple graph of the named graph.
  • ordered_vertices(::GenericNamedGraph) outputs an ordered list of the (named) vertices that can be indexed by integer positions to get the corresponding vertex.
  • vertex_positions(::GenericNamedGraph) outputs a dictionary that maps from a (named) vertex to the position of that vertex.

src/abstractnamedgraph.jl Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 83.37731% with 63 lines in your changes are missing coverage. Please review.

Project coverage is 82.75%. Comparing base (254e4cd) to head (dbb6c70).
Report is 4 commits behind head on main.

Files Patch % Lines
src/abstractnamedgraph.jl 79.36% 13 Missing ⚠️
src/lib/OrderedDictionaries/src/ordinalindexing.jl 29.41% 12 Missing ⚠️
src/lib/OrdinalIndexing/src/OrdinalIndexing.jl 80.95% 12 Missing ⚠️
...c/lib/OrderedDictionaries/src/ordereddictionary.jl 61.53% 10 Missing ⚠️
.../PartitionedGraphs/src/abstractpartitionedgraph.jl 66.66% 4 Missing ⚠️
src/namedgraph.jl 92.00% 4 Missing ⚠️
src/lib/OrderedDictionaries/src/orderedindices.jl 94.11% 3 Missing ⚠️
src/lib/GraphsExtensions/src/abstracttrees.jl 83.33% 2 Missing ⚠️
src/lib/OrdinalIndexing/test/runtests.jl 95.55% 2 Missing ⚠️
src/shortestpaths.jl 90.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
+ Coverage   78.82%   82.75%   +3.93%     
==========================================
  Files          34       44      +10     
  Lines        1190     1508     +318     
==========================================
+ Hits          938     1248     +310     
- Misses        252      260       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtfishman mtfishman changed the title [WIP] Redesign GenericNamedGraph type Redesign GenericNamedGraph type Apr 24, 2024
@mtfishman mtfishman marked this pull request as ready for review April 24, 2024 20:22
src/namedgraph.jl Show resolved Hide resolved
src/namedgraph.jl Outdated Show resolved Hide resolved
@mtfishman mtfishman merged commit b8fd114 into main Apr 26, 2024
8 of 9 checks passed
@mtfishman mtfishman deleted the ordinal_graph branch April 26, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the design of GenericNamedGraph type
2 participants