Skip to content

Commit 8256089

Browse files
Feature/dev 872 Refactored Docs to scaladoc (#388)
* up to row remove do not document * remove annoying {s} * check in before home time, done apis, skipped algos on query * refractor doc * client and sender done * anything that had a doc in core has been converted * put back {s} into algorithms * addded build sbt support and move files, but where are my files going? why sphinx not liking the same names... urg * linked scala doc but need to fix references * fix scaladoc role for linking to documentation * add {scaladoc} rule to docs * fixed python client * fix links to methods * fixed some warnings and headers * forgot to do graph algorithm * added environment Co-authored-by: Lucas Jeub <[email protected]>
1 parent b506e98 commit 8256089

File tree

124 files changed

+1511
-2233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1511
-2233
lines changed

.environment.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: py39
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- ca-certificates=2021.10.8=h033912b_0
7+
- certifi=2021.10.8=py39h6e9494a_2
8+
- libcxx=12.0.0=h2f01273_0
9+
- libffi=3.3=hb1e8313_2
10+
- ncurses=6.3=hca72f7f_2
11+
- openjdk=11.0.9.1=hcf210ce_1
12+
- openssl=1.1.1o=hfe4f2af_0
13+
- pip=21.2.4=py39hecd8cb5_0
14+
- python=3.9.12=hdfd78df_0
15+
- python_abi=3.9=2_cp39
16+
- readline=8.1.2=hca72f7f_1
17+
- sbt=1.6.2=hd8ed1ab_0
18+
- setuptools=61.2.0=py39hecd8cb5_0
19+
- sqlite=3.38.3=h707629a_0
20+
- tk=8.6.11=h3fd3227_1
21+
- tzdata=2022a=hda174b7_0
22+
- wheel=0.37.1=pyhd3eb1b0_0
23+
- xz=5.2.5=hca72f7f_1
24+
- zlib=1.2.12=h4dc903c_2
25+
- pip:
26+
- alabaster==0.7.12
27+
- babel==2.10.1
28+
- charset-normalizer==2.0.12
29+
- docutils==0.17.1
30+
- idna==3.3
31+
- imagesize==1.3.0
32+
- importlib-metadata==4.11.3
33+
- jinja2==3.1.2
34+
- markdown-it-py==2.1.0
35+
- markupsafe==2.1.1
36+
- mdit-py-plugins==0.3.0
37+
- mdurl==0.1.1
38+
- myst-parser==0.17.2
39+
- packaging==21.3
40+
- pygments==2.12.0
41+
- pyparsing==3.0.8
42+
- pytz==2022.1
43+
- pyyaml==6.0
44+
- requests==2.27.1
45+
- snowballstemmer==2.2.0
46+
- sphinx==4.5.0
47+
- sphinx-rtd-theme==1.0.0
48+
- sphinxcontrib-applehelp==1.0.2
49+
- sphinxcontrib-devhelp==1.0.2
50+
- sphinxcontrib-htmlhelp==2.0.0
51+
- sphinxcontrib-jsmath==1.0.1
52+
- sphinxcontrib-qthelp==1.0.3
53+
- sphinxcontrib-serializinghtml==1.1.5
54+
- typing-extensions==4.2.0
55+
- urllib3==1.26.9
56+
- zipp==3.8.0
57+
prefix: /Users/haaroony/opt/anaconda3/envs/py39

.readthedocs.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ build:
1111
tools:
1212
python: "3.9"
1313

14+
conda:
15+
environment: .environment.yml
16+
1417
# Build documentation in the docs/ directory with Sphinx
1518
sphinx:
1619
configuration: docs/source/conf.py
1720

18-
# Optionally declare the Python requirements required to build your docs
19-
python:
20-
install:
21-
- requirements: docs/requirements.txt

build.sbt

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ lazy val core = (project in file("core"))
6262
.settings(
6363
name := "core",
6464
assembly / test := {},
65+
Compile / doc / scalacOptions := Seq("-skip-packages", "com.raphtory.algorithms.generic:com.raphtory.algorithms.temporal", "-private"),
6566
assemblySettings,
6667
defaultSettings,
6768
libraryDependencies ++= Seq(
@@ -171,3 +172,6 @@ Test / parallelExecution := false
171172
Global / concurrentRestrictions := Seq(
172173
Tags.limit(Tags.Test, 1)
173174
)
175+
176+
// Scaladocs parameters
177+
// doc / scalacOptions ++= Seq("-skip-packages", "com.raphtory.algorithms.generic:com.raphtory.algorithms.temporal", "-private")
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
package com.raphtory.algorithms.api
22

3-
/**
4-
* {s}`Accumulator[T]`
5-
* : Public accumulator interface
6-
*
7-
* ## Methods
8-
*
9-
* {s}`+= (newValue: T): Unit`
10-
* : add new value to accumulator
11-
*
12-
* {s}`value: T`
13-
* : get last accumulated value
14-
*
15-
* ```{seealso}
16-
* [](com.raphtory.algorithms.api.GraphState)
17-
* ```
18-
*/
3+
/** Abstract class for the Accumulator interface.
4+
* See also com.raphtory.algorithms.api.GraphState */
195
abstract class Accumulator[T] {
6+
7+
/** Add new value to accumulator */
208
def value: T
219

10+
/** Get last accumulated value */
2211
def +=(newValue: T): Unit
2312
}
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
package com.raphtory.algorithms.api
22

3-
/**
4-
* {s}`Chain(algorithms: GraphAlgorithm*)`
5-
* : Run algorithms in sequence with shared graph state
3+
/** Run algorithms in sequence with shared graph state,
64
*
7-
* ## Parameters
5+
* @see
6+
* [[com.raphtory.algorithms.api.GraphAlgorithm]],
7+
* [[com.raphtory.algorithms.api.GraphPerspective]],
8+
* [[com.raphtory.algorithms.api.Table]]
89
*
9-
* {s}`algorithms: GraphAlgorithm*`
10-
* : List of algorithms to run
11-
*
12-
* ## Class Signature
13-
*
14-
* {s}`Chain(algorithms: Seq[GraphAlgorithm]) extends GraphAlgorithm`
15-
*
16-
* ## Methods
17-
*
18-
* {s}`apply(graph: GraphPerspective): GraphPerspective`
19-
* : Apply each algorithm to the graph in sequence, clearing messages in-between.
20-
* This means that while the next algorithm has access to all the graph state set by previous algorithms,
21-
* it does not receive messages sent by the previous algorithm.
22-
*
23-
* {s}`tabularise(graph: GraphPerspective): Table`
24-
* : Uses the `tabularise` method of the last algorithm in the chain to return results (if {s}`algorithms`
25-
* is empty, it returns an empty table).
26-
*
27-
* {s}`->(graphAlgorithm: GraphAlgorithm): Chain`
28-
* : Append a new graph algorithm to the chain.
29-
*
30-
* ```{seealso}
31-
* [](com.raphtory.algorithms.api.GraphAlgorithm), [](com.raphtory.algorithms.api.GraphPerspective),
32-
* [](com.raphtory.algorithms.api.Table)
33-
* ```
34-
*/
10+
* @param algorithms Sequence of GraphAlgorithm(s) to run
11+
* */
3512
class Chain(algorithms: Seq[GraphAlgorithm]) extends GraphAlgorithm {
3613

14+
/** Apply each algorithm to the graph in sequence, clearing messages in-between.
15+
* This means that while the next algorithm has access to all the graph state set by previous algorithms,
16+
* it does not receive messages sent by the previous algorithm.
17+
*
18+
* @param graph The graph perspective to apply the algorithm to
19+
* @return a new GraphPerspective that has been modified with the algorithm
20+
* */
3721
override def apply(graph: GraphPerspective): GraphPerspective = {
3822
var gp = graph
3923
if (algorithms.nonEmpty)
@@ -42,16 +26,36 @@ class Chain(algorithms: Seq[GraphAlgorithm]) extends GraphAlgorithm {
4226
gp
4327
}
4428

29+
/** Uses the `tabularise` method of the last algorithm in the chain to return results (if algorithms
30+
* is empty, it returns an empty table).
31+
*
32+
* @param graph The graph perspective to apply the algorithm to
33+
* @return Returns a Table with the results, if empty returns an empty table
34+
*/
4535
override def tabularise(graph: GraphPerspective): Table =
4636
if (algorithms.nonEmpty)
4737
algorithms.last.tabularise(graph)
4838
else
4939
super.tabularise(graph)
5040

41+
/** Append a new graph algorithm to the chain.
42+
*
43+
* @param graphAlgorithm the graph algorithm to apply to the chain
44+
* @return The chain with the added algorithm
45+
*/
5146
override def ->(graphAlgorithm: GraphAlgorithm): Chain =
5247
Chain(algorithms :+ graphAlgorithm: _*)
5348
}
5449

50+
/** Factory for [[com.raphtory.algorithms.api.Chain]] objects */
5551
object Chain {
52+
53+
/** Apply each algorithm to the chain in sequence, clearing messages in-between.
54+
* This means that while the next algorithm has access to all the graph state set by previous algorithms,
55+
* it does not receive messages sent by the previous algorithm.
56+
*
57+
* @param algorithms The graph algorithms to apply
58+
* @return a new Chain that has been modified with the algorithms
59+
* */
5660
def apply(algorithms: GraphAlgorithm*) = new Chain(algorithms)
5761
}

core/src/main/scala/com/raphtory/algorithms/api/DefaultGraphOperations.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.raphtory.graph.visitor.PropertyMergeStrategy.PropertyMerge
77
import com.raphtory.graph.visitor.Vertex
88

99
/**
10-
* @DoNotDocument
10+
* @note DoNotDocument
1111
*/
1212
abstract class DefaultGraphOperations[G <: GraphOperations[G]](
1313
private[api] val query: Query,

core/src/main/scala/com/raphtory/algorithms/api/DeployedTemporalGraph.scala

+7-12
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,12 @@ import com.raphtory.client.QuerySender
44
import com.raphtory.components.querymanager.Query
55
import com.typesafe.config.Config
66

7-
/**
8-
* {s}`DeployedTemporalGraph`
9-
* : Root class for local deployments of the analysis API
7+
/** Root class for local deployments of the analysis API
108
*
11-
* A {s}`DeployedTemporalGraph` is a {s}`TemporalGraph`
9+
* A DeployedTemporalGraph is a TemporalGraph
1210
* with a deployment object attached to it that allows to stop it.
1311
*
14-
* ## Methods
15-
*
16-
* {s}`deployment: Deployment`
17-
* : Access to the deployment to allow stopping it: {s}`graph.deployment.stop()`.
18-
*
19-
* ```{seealso}
20-
* [](com.raphtory.algorithms.api.TemporalGraph)
21-
* ```
12+
* @see [[com.raphtory.algorithms.api.TemporalGraph]]
2213
*/
2314
private[raphtory] class DeployedTemporalGraph(
2415
query: Query,
@@ -32,6 +23,10 @@ private[raphtory] class DeployedTemporalGraph(
3223
}
3324
private val deploymentRef = new Deployment()
3425

26+
/** Access to the deployment to call functions upon it, e.g. graph.deployment.stop()
27+
*
28+
* @return Deployment reference
29+
* */
3530
def deployment: Deployment = deploymentRef
3631

3732
private[raphtory] def getConfig() = conf

0 commit comments

Comments
 (0)