From d69aab0168e033d35e8209eaf6b27b4d937a08b6 Mon Sep 17 00:00:00 2001 From: pippellia-btc Date: Thu, 29 May 2025 14:52:09 +0200 Subject: [PATCH] package-level comments --- pkg/pagerank/pagerank.go | 2 ++ pkg/redb/graph.go | 2 ++ pkg/walks/walks.go | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/pagerank/pagerank.go b/pkg/pagerank/pagerank.go index 36f17fb..59ee957 100644 --- a/pkg/pagerank/pagerank.go +++ b/pkg/pagerank/pagerank.go @@ -1,3 +1,5 @@ +// The pagerank package uses the random walks to compute graph algorithms like +// global and personalized pageranks. package pagerank import ( diff --git a/pkg/redb/graph.go b/pkg/redb/graph.go index 7c41d19..b0096cf 100644 --- a/pkg/redb/graph.go +++ b/pkg/redb/graph.go @@ -1,3 +1,5 @@ +// The package redb defines the redis implementation of the database, which stores +// graph relationships (e.g. follows) as well as random walks. package redb import ( diff --git a/pkg/walks/walks.go b/pkg/walks/walks.go index 4d5a329..cb58ab5 100644 --- a/pkg/walks/walks.go +++ b/pkg/walks/walks.go @@ -1,3 +1,4 @@ +// The walks package is responsible for defining, generating, removing and updating random walks. package walks import ( @@ -13,7 +14,7 @@ var ( Alpha = 0.85 // the dampening factor N = 100 // the walks per node - ErrInvalidRemoval = errors.New(fmt.Sprintf("the walks to be removed are different than the expected number %d", N)) + ErrInvalidRemoval = errors.New("the walks to be removed are different than the expected number (100)") ) // ID represent how walks are identified in the storage layer