Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
02d2cf8
Finished implementing v1!
espottesmith Aug 13, 2025
07c028b
Update docstrings
espottesmith Aug 13, 2025
915feb2
Docstrings
espottesmith Aug 13, 2025
fab3dac
Get docstringed!
espottesmith Aug 13, 2025
6fa874b
Merge branch 'main' into docs_and_tests
espottesmith Aug 13, 2025
48f6315
Merge branch 'main' into docs_and_tests
espottesmith Aug 13, 2025
1d8526d
Merge branch 'main' into docs_and_tests
espottesmith Aug 13, 2025
1740223
Merge branch 'main' into docs_and_tests
espottesmith Aug 14, 2025
a80aa4c
Just catching up
espottesmith Sep 2, 2025
38106c2
New docstrings in hypergraphs.jl
espottesmith Sep 2, 2025
e5859bd
Docstrings are done (for now)
espottesmith Sep 2, 2025
004bdc1
Minor work on tests
espottesmith Sep 4, 2025
f5d0044
WIP - adding utility functions for common datasets
espottesmith Sep 9, 2025
68f1452
Splitting progress
espottesmith Sep 9, 2025
20726c0
Hyperedge splitting
espottesmith Sep 9, 2025
1f9e4f4
Initial draft of splitting by v/he/hg for undirected hypergraphs done
espottesmith Sep 9, 2025
9e6f263
Incremental progress
espottesmith Sep 9, 2025
2bf8e42
Almost there w/ first draft of splitting
espottesmith Sep 9, 2025
cd37209
Hyperedge splitting for directed hypergraphs
espottesmith Sep 10, 2025
881ad18
Aaaaand done. Now just the docs and tests....
espottesmith Sep 10, 2025
f0406f6
Docs for main splitting functions
espottesmith Sep 10, 2025
06d3c5f
Docs done
espottesmith Sep 10, 2025
28ef277
Little refactor before I dive into tests
espottesmith Sep 10, 2025
6a8861a
Very prelim test scaffold (need to actually write)
espottesmith Sep 10, 2025
5af8208
Merge branch 'datasets' into docs_and_tests
espottesmith Sep 10, 2025
a3e27bd
Undirected vertex splitting - tests pass (now just need to test random)
espottesmith Sep 11, 2025
5062931
Minor test refactor
espottesmith Sep 11, 2025
a34f51a
A solid round of bugfixes
espottesmith Sep 11, 2025
ccfb68b
Tests pass hyperedge splitting
espottesmith Sep 12, 2025
0d68ddf
...aaaaand hypergraphs. Now just datasets until I'm ready-ish to merge
espottesmith Sep 12, 2025
ddd240d
Tests pass
espottesmith Sep 12, 2025
8ae4240
Docs
espottesmith Sep 12, 2025
be3bb08
Attempt at auto-downloading datasets
espottesmith Sep 12, 2025
32f1dfa
Resolve merge issue
espottesmith Sep 12, 2025
f135938
Merge remote-tracking branch 'coreacter/main' into datasets
espottesmith Sep 12, 2025
d82728d
Bash syntax issue?
espottesmith Sep 15, 2025
08f7628
Still an issue with the environment
espottesmith Sep 15, 2025
c970a6c
import silliness
espottesmith Sep 15, 2025
059bb47
Silly me, I just realized that I only implemented tests for undirected
espottesmith Sep 15, 2025
bc414cb
NOW we're ready for action
espottesmith Sep 15, 2025
898f765
One last fix?
espottesmith Sep 15, 2025
7d0fc5e
Documentation
espottesmith Sep 16, 2025
30c7a13
Merge branch 'datasets' into docs_and_tests
espottesmith Sep 16, 2025
1807b24
Update to CompatHelper workflow; currently having permissions issues
espottesmith Sep 17, 2025
3549c32
Random tests
espottesmith Sep 17, 2025
56d9dc0
Documentation and prep for query tests
espottesmith Sep 17, 2025
6c3ff9e
More missing docs
espottesmith Sep 17, 2025
2c0675e
Bunch of small fixes and small tests; still very much WIP
espottesmith Sep 17, 2025
49bb7ff
Tests pass for query for UNDIRECTED hypergraphs only
espottesmith Sep 17, 2025
936c4e6
Version issue
espottesmith Sep 17, 2025
56c47ca
CI issues
espottesmith Sep 17, 2025
3422377
Another CI tweak
espottesmith Sep 17, 2025
7bb39b7
Conda issue...
espottesmith Sep 17, 2025
3674b2d
Damn PyCall
espottesmith Sep 17, 2025
adaab20
Now trying not to use Conda at all
espottesmith Sep 17, 2025
b13b352
One more try...
espottesmith Sep 17, 2025
6aabeef
CI syntax fix
espottesmith Sep 17, 2025
e3bf67b
Now the issue is matplotlib again. Gosh dangit
espottesmith Sep 18, 2025
11fe772
Some preliminary tests involving directed hypergraphs for query.jl
espottesmith Sep 18, 2025
3e076bc
Come on, openssl...
espottesmith Sep 18, 2025
bbeb7ab
Trying swapping the order
espottesmith Sep 18, 2025
0d057eb
SSL version
espottesmith Sep 18, 2025
cf10521
SSL version, again
espottesmith Sep 18, 2025
3b15bfd
why, oh why, is this my fate?
espottesmith Sep 18, 2025
a26d3b7
Wild swing
espottesmith Sep 19, 2025
2f58816
Bugfix in tests; and more tests
espottesmith Sep 19, 2025
c7c18b0
Done with it. Done with the datasets. That's split off now in
espottesmith Sep 19, 2025
f7e82ea
Docs issue with JLL again
espottesmith Sep 21, 2025
73e0fc5
Tweak
espottesmith Sep 21, 2025
e601124
AHHHHHHHHH
espottesmith Sep 21, 2025
6fb0dfb
Revert
espottesmith Sep 21, 2025
500d75f
Query tests done for dihypergraph as well; phew!
espottesmith Sep 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- ubuntu-latest
arch:
- x64
env:
DATADEPS_ALWAYS_ACCEPT: true
LD_LIBRARY_PATH: ""
steps:
- name: Install matplotlib
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y python3-matplotlib; fi
Expand All @@ -40,6 +43,13 @@ jobs:
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: Configure test environment
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.add(name="OpenSSL_jll", version="3")
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
Expand All @@ -54,6 +64,8 @@ jobs:
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
contents: write
statuses: write
env:
LD_LIBRARY_PATH: ""
steps:
- name: Install matplotlib
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y python3-matplotlib; fi
Expand All @@ -65,14 +77,14 @@ jobs:
arch: x64
os: ubuntu-latest
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: Configure doc environment
shell: julia --project=docs --color=yes {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.add(name="OpenSSL_jll", version="3.0")
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
36 changes: 32 additions & 4 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,42 @@ on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: CompatHelper.main()
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InvertedIndices = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Expand All @@ -22,7 +23,8 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = ">= 1.10.0"
LinearAlgebra = ">= 1.10.0"
Reactant = ">= 0.2.0"
SimpleDirectedHypergraphs = "0.1.0"
SimpleHypergraphs = "0.3.0"
SimpleDirectedHypergraphs = "0.1.0"
julia = ">= 1.10.0"
23 changes: 14 additions & 9 deletions src/HyperGraphNeuralNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module HyperGraphNeuralNetworks
using Random
using DataStructures: counter
using StatsBase: FrequencyWeights, sample
using LinearAlgebra
using InvertedIndices
using Graphs
using GNNGraphs
import GNNGraphs: getn, getdata, normalize_graphdata, cat_features, shortsummary
using MLUtils
using InvertedIndices
using SimpleHypergraphs
using SimpleDirectedHypergraphs

Expand All @@ -27,22 +28,26 @@ include("core/query.jl")

export hyperedge_index, get_hyperedge_weight, get_hyperedge_weights
export has_vertex, vertices, isolated_vertices
export degree, indegree, outdegree
export all_neighbors, in_neighbors, out_neighbors, hyperedge_neighbors
export incidence_matrix, complex_incidence_matrix, hyperedge_weight_matrix, vertex_weight_matrix
export normalized_laplacian
export hypergraph_ids, has_self_loops, has_multi_hyperedges
export hyperedge_neighbors
export hyperedge_weight_matrix, hyperedge_degree_matrix, vertex_weight_matrix, vertex_degree_matrix
export complex_incidence_matrix, normalized_laplacian_matrix
export hypergraph_ids, has_multi_hyperedges

include("core/transform.jl")

export add_self_loops, remove_self_loops, remove_multi_hyperedges
export rewire_hyperedges, to_undirected
export combine_hypergraphs, get_hypergraph, negative_sample
export random_split_vertices, random_split_hyperedges
export combine_hypergraphs, get_hypergraph
export AbstractNegativeSamplingStrategy, UniformSample, SizedSample, MotifSample, CliqueSample, negative_sample_hyperedge

include("core/split.jl")

export split_vertices, split_hyperedges, split_hypergraphs
export random_split_vertices, random_split_hyperedges, random_split_hypergraphs

include("core/utils.jl")

export check_num_vertices, check_num_hyperedges
export normalize_graphdata

end
end
18 changes: 9 additions & 9 deletions src/core/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
kws...
) where {H <: AbstractHGNNDiHypergraph}

Generate a *random* undirected hypergraph (in the style of Erdős–Rényi random graphs) without any structural
Generate a *random* hypergraph (in the style of Erdős–Rényi random graphs) without any structural
constraints. See `SimpleHypergraphs.random_model`. The user can optionally seed the random number
generator with kwarg `seed`. The default value is -1; if the value is greater than or equal to 0, then `seed` will
be used.
Expand All @@ -30,7 +30,7 @@ function erdos_renyi_hypergraph(
kws...
) where {H <: AbstractHGNNHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

basic = random_model(nVertices, nEdges, Hypergraph)
Expand All @@ -47,7 +47,7 @@ function erdos_renyi_hypergraph(
kws...
) where {H <: AbstractHGNNDiHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

basic = random_model(
Expand Down Expand Up @@ -94,7 +94,7 @@ function random_kuniform_hypergraph(
kws...
) where {H <: AbstractHGNNHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

kuniform = random_kuniform_model(nVertices, nEdges, k, Hypergraph)
Expand All @@ -112,7 +112,7 @@ function random_kuniform_hypergraph(
kws...
) where {H <: AbstractHGNNDiHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

kuniform = random_kuniform_model(
Expand Down Expand Up @@ -159,7 +159,7 @@ function random_dregular_hypergraph(
kws...
) where {H <: AbstractHGNNHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

dregular = random_dregular_model(nVertices, nEdges, d, Hypergraph)
Expand All @@ -177,7 +177,7 @@ function random_dregular_hypergraph(
kws...
) where {H <: AbstractHGNNDiHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

dregular = random_dregular_model(
Expand Down Expand Up @@ -214,11 +214,11 @@ function random_preferential_hypergraph(
HType::Type{HO};
seed::Int = -1,
HTypeStart::Type{HI} = Hypergraph,
hg::HI = random_model(5,5, HI),
hg::HI = random_model(5,5, HTypeStart),
kws...
) where {HI<:AbstractSimpleHypergraph, HO<:AbstractHGNNHypergraph}
if seed >= 0
seed!(seed)
Random.seed!(seed)
end

pref_hg = random_preferential_model(
Expand Down
Loading
Loading