Skip to content

Commit 767bd2a

Browse files
authored
fix: Stylistic fixes (#366)
* stylistic fixes * stylistic fixes
1 parent 2e1410d commit 767bd2a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/GNNGraphs/query.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ or a vector.
262262
- `g`: A graph.
263263
- `T`: Element type of the returned vector. If `nothing`, is
264264
chosen based on the graph type and will be an integer
265-
if `edge_weight=false`. Default `nothing`.
266-
- `dir`: For `dir=:out` the degree of a node is counted based on the outgoing edges.
267-
For `dir=:in`, the ingoing edges are used. If `dir=:both` we have the sum of the two.
265+
if `edge_weight = false`. Default `nothing`.
266+
- `dir`: For `dir = :out` the degree of a node is counted based on the outgoing edges.
267+
For `dir = :in`, the ingoing edges are used. If `dir = :both` we have the sum of the two.
268268
- `edge_weight`: If `true` and the graph contains weighted edges, the degree will
269269
be weighted. Set to `false` instead to just count the number of
270270
outgoing/ingoing edges.
@@ -326,20 +326,20 @@ given `edge_type`.
326326
- `edge_type`: A tuple of symbols `(source_t, edge_t, target_t)` representing the edge type.
327327
- `T`: Element type of the returned vector. If `nothing`, is
328328
chosen based on the graph type. Default `nothing`.
329-
- `dir`: For `dir=:out` the degree of a node is counted based on the outgoing edges.
329+
- `dir`: For `dir = :out` the degree of a node is counted based on the outgoing edges.
330330
For `dir = :in`, the ingoing edges are used. If `dir = :both` we have the sum of the two.
331331
Default `dir = :out`.
332332
333333
"""
334-
function Graphs.degree(g::GNNHeteroGraph, edge::Tuple{Symbol, Symbol, Symbol},
334+
function Graphs.degree(g::GNNHeteroGraph, edge::EType,
335335
T::TT = nothing; dir = :out) where {
336336
TT <: Union{Nothing, Type{<:Number}}}
337337

338338
s, t = edge_index(g, edge)
339339

340340
T = isnothing(T) ? eltype(s) : T
341341

342-
n_type = dir == :in ? g.ntypes[2] : g.ntypes[1]
342+
n_type = dir == :in ? g.ntypes[2] : g.ntypes[1]
343343

344344
return _degree((s, t), T, dir, nothing, g.num_nodes[n_type])
345345
end
@@ -407,7 +407,7 @@ end
407407
has_isolated_nodes(g::GNNGraph; dir=:out)
408408
409409
Return true if the graph `g` contains nodes with out-degree (if `dir=:out`)
410-
or in-degree (if `dir=:in`) equal to zero.
410+
or in-degree (if `dir = :in`) equal to zero.
411411
"""
412412
function has_isolated_nodes(g::GNNGraph; dir = :out)
413413
return any(iszero, degree(g; dir))

0 commit comments

Comments
 (0)