CarloLucibello / GraphNeuralNetworks.jl

Graph Neural Networks in Julia
https://carlolucibello.github.io/GraphNeuralNetworks.jl/dev/
MIT License
210 stars 47 forks source link

Fixes and more tests in `remove_nodes` function #424

Closed rbSparky closed 3 months ago

rbSparky commented 3 months ago

I tested a little more and there are some errors to be fixed, I will fix those here I missed these in the last PR

I'll also add more tests to make sure all cases are covered

rbSparky commented 3 months ago

needed to add these checks to check bounds

    function find_edges_to_remove(nodes, nodes_to_remove)
        return findall(node_id -> begin
            idx = searchsortedlast(nodes_to_remove, node_id)
            idx >= 1 && idx <= length(nodes_to_remove) && nodes_to_remove[idx] == node_id
        end, nodes)
    end
CarloLucibello commented 3 months ago

You can add a test that was failing before this PR

rbSparky commented 3 months ago

You can add a test that was failing before this PR

Done, and made the fixes Added the test that previously failed and the fixed code