You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- this creates the baselines from the graphs listed in that file
34
-
- runs the setup script to make sure the graph is created and data is loaded
32
+
- runs the setup script to make sure the graphs are created and data is loaded
33
+
- runs `test/create_baseline.py`
34
+
- this creates the baselines for the algorithm types listed in that file
35
35
- runs the tests with pytest
36
36
37
37
## Directory layout
38
38
39
-
Data: stores the satic data for creating graphs, and algorithm baseline results.
39
+
`data`: stores the satic data for creating graphs, and algorithm baseline results.
40
40
41
41
- CSV files under `data/[heterogeneous_edges, unweighted_edges, weighted_edges]` store the adjacency information for creating graphs. The baselines for algorithms are made from these graphs
42
42
- For example `data/weighted_edges/line_edges.csv` stores the edges and weights to create a weighted, line graph.
43
43
- JSON files under `data/baseline` store the baseline results for a given algorithm on a given graph type.
44
44
- For example `data/baseline/centrality/pagerank/Line_Directed.json` stores the baseline results for pagerank on a directed line graph
45
45
46
+
Some data (like the Cora graph) comes from [pyTigerGraph Datasets](https://docs.tigergraph.com/pytigergraph/current/datasets/datasets_object), so it will not be in the this path.
47
+
46
48
test:
47
49
48
50
- setup.py: creates the graph, loads the data and installs the queries from pyTG's featurizer. Any new/custom queries need to be manually installed
51
+
- create_baseline.py: creates the baselines the algorithms will be compared to.
49
52
- test<algo_family>.py: houses the testing code for each family of algorithms
50
53
51
54
```
@@ -56,25 +59,28 @@ test:
56
59
│ │ │ └── <GraphType>.json
57
60
│ ├── <edge_family>
58
61
│ │ └── <graph_type>.csv
59
-
│ └── create_baseline.py
60
62
├── requirements.txt
61
63
├── run.sh
62
64
├── test
63
65
│ ├── pyrightconfig.json
64
66
│ ├── setup.py
67
+
│ ├── baseline/
68
+
│ │ ├── algos/
69
+
│ │ │ └── <baseline algorithms>.py
70
+
│ │ └── <funcs for running baseline generation by algo family>.py
65
71
│ ├── test_centrality.py
66
72
│ ├── test_community.py
67
73
│ ├── test_path_finding.py
68
-
│ ├── test_topological_link_prediction.py
74
+
│ ├── ...
69
75
│ └── util.py
70
76
```
71
77
72
78
## Adding tests
73
79
74
-
Start with creating the baseline. Add a section to `create_baseline.py` that creates a baseline for all the necessary graph types for your algorithm. The output of the baseline should be written to
75
-
the correct baseline path (see above [layout](#directory-layout)).
80
+
Start with creating the baseline. Add a method call to `create_baseline.py` that creates a baseline for all the necessary graph types for your algorithm. The output of the baseline should be written to
81
+
the correct path in `data/baseline` (see above [layout](#directory-layout)).
76
82
77
-
If you're adding a new algorithm, add a test method for it to the algorithm family that it belongs to (i.e., community algorigthms go in community.py). The first test method in `test/test_centrality.py`
83
+
If you're adding a new algorithm, add a test method to the algorithm family that it belongs to (i.e., community algorigthms go in community.py). The first test method in `test/test_centrality.py`
0 commit comments