Skip to content

Commit 2709d2c

Browse files
committed
Apply default values for centrality endpoints + fix doc strings
1 parent 2238b96 commit 2709d2c

File tree

66 files changed

+997
-992
lines changed

Some content is hidden

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

66 files changed

+997
-992
lines changed

graphdatascience/procedure_surface/api/catalog/catalog_endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def generate(
117117
Number of concurrent threads/processes to use during graph generation.
118118
job_id : str | None, default=None
119119
Unique identifier for the job associated with the graph generation.
120-
sudo : bool | None, default=None
120+
sudo : bool
121121
Override memory estimation limits
122122
log_progress : bool | None, default=None
123123
Whether to log progress during graph generation.

graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def mutate(
1818
sudo: bool | None = None,
1919
log_progress: bool = True,
2020
username: str | None = None,
21-
concurrency: Any | None = None,
22-
write_concurrency: Any | None = None,
23-
job_id: Any | None = None,
21+
concurrency: int | None = None,
22+
write_concurrency: int | None = None,
23+
job_id: str | None = None,
2424
) -> NodeLabelMutateResult:
2525
"""
2626
Attaches the specified node label to the filtered nodes in the graph.
@@ -33,7 +33,7 @@ def mutate(
3333
The node label to write back.
3434
node_filter : str
3535
A Cypher predicate for filtering nodes in the input graph.
36-
sudo : bool | None, default=None
36+
sudo : bool
3737
Override memory estimation limits
3838
log_progress : bool | None, default=None
3939
Whether to log progress
@@ -77,7 +77,7 @@ def write(
7777
The node label to write back.
7878
node_filter : str
7979
A Cypher predicate for filtering nodes in the input graph.
80-
sudo : bool | None, default=None
80+
sudo : bool
8181
Override memory estimation limits
8282
log_progress : bool | None, default=None
8383
Whether to log progress

graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def stream(
3838
The node properties to stream
3939
list_node_labels : boolean | None, default=None
4040
Whether to include node labels in the stream
41-
node_labels : list[str] | None, default=None
41+
node_labels : list[str]
4242
Filter by node labels
4343
concurrency : Any | None, default=None
4444
The number of concurrent threads
45-
sudo : bool | None, default=None
45+
sudo : bool
4646
Override memory estimation limits
4747
log_progress : bool | None, default=None
4848
Whether to log progress
@@ -83,13 +83,13 @@ def write(
8383
node_properties : str | list[str] | dict[str, str]
8484
The node properties to write.
8585
If a dictionary is provided, the keys are the property names and the values are the aliases that will be used as the property name in the database.
86-
node_labels : list[str] | None, default=None
86+
node_labels : list[str]
8787
Filter by node labels
8888
concurrency : Any | None, default=None
8989
The number of concurrent threads
9090
write_concurrency : Any | None, default=None
9191
The number of concurrent threads used for writing
92-
sudo : bool | None, default=None
92+
sudo : bool
9393
Override memory estimation limits
9494
log_progress : bool | None, default=None
9595
Whether to log progress

graphdatascience/procedure_surface/api/catalog/relationships_endpoints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def stream(
3939
The relationship properties to stream. If not specified, no properties will be streamed.
4040
concurrency : Any | None, default=None
4141
The number of concurrent threads
42-
sudo : bool | None, default=None
42+
sudo : bool
4343
Override memory estimation limits
4444
log_progress : bool | None, default=None
4545
Whether to log progress
@@ -81,7 +81,7 @@ def write(
8181
The number of concurrent threads
8282
write_concurrency : Any | None, default=None
8383
The number of concurrent threads used for writing
84-
sudo : bool | None, default=None
84+
sudo : bool
8585
Override memory estimation limits
8686
log_progress : bool | None, default=None
8787
Whether to log progress
@@ -146,7 +146,7 @@ def index_inverse(
146146
The relationship types to create the inverse index for
147147
concurrency : Any | None, default=None
148148
The number of concurrent threads
149-
sudo : bool | None, default=None
149+
sudo : bool
150150
Override memory estimation limits
151151
log_progress : bool | None, default=None
152152
Whether to log progress
@@ -192,7 +192,7 @@ def to_undirected(
192192
A dictionary can be provided to specify property specific aggregations.
193193
concurrency : Any | None, default=None
194194
The number of concurrent threads
195-
sudo : bool | None, default=None
195+
sudo : bool
196196
Override memory estimation limits
197197
log_progress : bool | None, default=None
198198
Whether to log progress

graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ def mutate(
1818
G: GraphV2,
1919
mutate_property: str,
2020
*,
21-
damping_factor: float | None = None,
22-
tolerance: float | None = None,
23-
max_iterations: int | None = None,
24-
scaler: Any | None = None,
21+
damping_factor: float = 0.85,
22+
tolerance: float = 1.0e-7,
23+
max_iterations: int = 20,
24+
scaler: Any = "NONE",
2525
relationship_types: list[str] = ALL_TYPES,
2626
node_labels: list[str] = ALL_LABELS,
27-
sudo: bool | None = None,
27+
sudo: bool = False,
2828
log_progress: bool = True,
2929
username: str | None = None,
3030
concurrency: Any | None = None,
@@ -45,19 +45,19 @@ def mutate(
4545
The graph to run the algorithm on
4646
mutate_property : str
4747
Name of the node property to store the results in.
48-
damping_factor : float | None, default=None
48+
damping_factor : float
4949
Probability of a jump to a random node.
50-
tolerance : float | None, default=None
50+
tolerance : float
5151
Minimum change in scores between iterations.
52-
max_iterations : int | None, default=None
52+
max_iterations : int
5353
Maximum number of iterations to run.
54-
scaler : Any | None, default=None
54+
scaler : Any
5555
Name of the scaler applied on the resulting scores.
56-
relationship_types : list[str] | None, default=None
56+
relationship_types : list[str]
5757
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
58-
node_labels : list[str] | None, default=None
58+
node_labels : list[str]
5959
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
60-
sudo : bool | None, default=None
60+
sudo : bool
6161
Disable the memory guard.
6262
log_progress : bool | None, default=None
6363
Display progress logging.
@@ -83,13 +83,13 @@ def stats(
8383
self,
8484
G: GraphV2,
8585
*,
86-
damping_factor: float | None = None,
87-
tolerance: float | None = None,
88-
max_iterations: int | None = None,
89-
scaler: Any | None = None,
86+
damping_factor: float = 0.85,
87+
tolerance: float = 1.0e-7,
88+
max_iterations: int = 20,
89+
scaler: Any = "NONE",
9090
relationship_types: list[str] = ALL_TYPES,
9191
node_labels: list[str] = ALL_LABELS,
92-
sudo: bool | None = None,
92+
sudo: bool = False,
9393
log_progress: bool = True,
9494
username: str | None = None,
9595
concurrency: Any | None = None,
@@ -108,19 +108,19 @@ def stats(
108108
----------
109109
G : GraphV2
110110
The graph to run the algorithm on
111-
damping_factor : float | None, default=None
111+
damping_factor : float
112112
Probability of a jump to a random node.
113-
tolerance : float | None, default=None
113+
tolerance : float
114114
Minimum change in scores between iterations.
115-
max_iterations : int | None, default=None
115+
max_iterations : int
116116
Maximum number of iterations to run.
117-
scaler : Any | None, default=None
117+
scaler : Any
118118
Name of the scaler applied on the resulting scores.
119-
relationship_types : list[str] | None, default=None
119+
relationship_types : list[str]
120120
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
121-
node_labels : list[str] | None, default=None
121+
node_labels : list[str]
122122
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
123-
sudo : bool | None, default=None
123+
sudo : bool
124124
Disable the memory guard.
125125
log_progress : bool | None, default=None
126126
Display progress logging.
@@ -146,13 +146,13 @@ def stream(
146146
self,
147147
G: GraphV2,
148148
*,
149-
damping_factor: float | None = None,
150-
tolerance: float | None = None,
151-
max_iterations: int | None = None,
152-
scaler: Any | None = None,
149+
damping_factor: float = 0.85,
150+
tolerance: float = 1.0e-7,
151+
max_iterations: int = 20,
152+
scaler: Any = "NONE",
153153
relationship_types: list[str] = ALL_TYPES,
154154
node_labels: list[str] = ALL_LABELS,
155-
sudo: bool | None = None,
155+
sudo: bool = False,
156156
log_progress: bool = True,
157157
username: str | None = None,
158158
concurrency: Any | None = None,
@@ -167,21 +167,21 @@ def stream(
167167
----------
168168
G : GraphV2
169169
The graph to run the algorithm on
170-
damping_factor : float | None, default=None
170+
damping_factor : float
171171
The damping factor controls the probability of a random jump to a random node
172-
tolerance : float | None, default=None
172+
tolerance : float
173173
Minimum change in scores between iterations
174-
max_iterations : int | None, default=None
174+
max_iterations : int
175175
The maximum number of iterations to run
176-
scaler : Any | None, default=None
176+
scaler : Any
177177
Configuration for scaling the scores
178-
relationship_types : list[str] | None, default=None
178+
relationship_types : list[str]
179179
The relationships types used to select relationships for this algorithm run
180-
node_labels : list[str] | None, default=None
180+
node_labels : list[str]
181181
The node labels used to select nodes for this algorithm run
182-
sudo : bool | None, default=None
182+
sudo : bool
183183
Override memory estimation limits
184-
log_progress : bool | None, default=None
184+
log_progress : bool
185185
Whether to log progress
186186
username : str | None, default=None
187187
The username to attribute the procedure run to
@@ -206,13 +206,13 @@ def write(
206206
G: GraphV2,
207207
write_property: str,
208208
*,
209-
damping_factor: float | None = None,
210-
tolerance: float | None = None,
211-
max_iterations: int | None = None,
212-
scaler: Any | None = None,
209+
damping_factor: float = 0.85,
210+
tolerance: float = 1.0e-7,
211+
max_iterations: int = 20,
212+
scaler: Any = "NONE",
213213
relationship_types: list[str] = ALL_TYPES,
214214
node_labels: list[str] = ALL_LABELS,
215-
sudo: bool | None = None,
215+
sudo: bool = False,
216216
log_progress: bool = True,
217217
username: str | None = None,
218218
concurrency: Any | None = None,
@@ -234,19 +234,19 @@ def write(
234234
The graph to run the algorithm on
235235
write_property : str
236236
The property name to write the ArticleRank score for each node
237-
damping_factor : float | None, default=None
237+
damping_factor : float
238238
Probability of a jump to a random node.
239-
tolerance : float | None, default=None
239+
tolerance : float
240240
Minimum change in scores between iterations.
241-
max_iterations : int | None, default=None
241+
max_iterations : int
242242
Maximum number of iterations to run.
243-
scaler : Any | None, default=None
243+
scaler : Any
244244
Name of the scaler applied on the resulting scores.
245-
relationship_types : list[str] | None, default=None
245+
relationship_types : list[str]
246246
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
247-
node_labels : list[str] | None, default=None
247+
node_labels : list[str]
248248
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
249-
sudo : bool | None, default=None
249+
sudo : bool
250250
Disable the memory guard.
251251
log_progress : bool | None, default=None
252252
Display progress logging.
@@ -274,10 +274,10 @@ def estimate(
274274
self,
275275
G: GraphV2 | dict[str, Any],
276276
*,
277-
damping_factor: float | None = None,
278-
tolerance: float | None = None,
279-
max_iterations: int | None = None,
280-
scaler: Any | None = None,
277+
damping_factor: float = 0.85,
278+
tolerance: float = 1.0e-7,
279+
max_iterations: int = 20,
280+
scaler: Any = "NONE",
281281
relationship_types: list[str] = ALL_TYPES,
282282
node_labels: list[str] = ALL_LABELS,
283283
concurrency: Any | None = None,
@@ -291,17 +291,17 @@ def estimate(
291291
----------
292292
G : GraphV2 | dict[str, Any]
293293
The graph to run the algorithm on or a dictionary representing the graph.
294-
damping_factor : float | None, default=None
294+
damping_factor : float
295295
The damping factor controls the probability of a random jump to a random node
296-
tolerance : float | None, default=None
296+
tolerance : float
297297
Minimum change in scores between iterations
298-
max_iterations : int | None, default=None
298+
max_iterations : int
299299
The maximum number of iterations to run
300-
scaler : Any | None, default=None
300+
scaler : Any
301301
Configuration for scaling the scores
302-
relationship_types : list[str] | None, default=None
302+
relationship_types : list[str]
303303
The relationships types used to select relationships for this algorithm run
304-
node_labels : list[str] | None, default=None
304+
node_labels : list[str]
305305
The node labels used to select nodes for this algorithm run
306306
concurrency : Any | None, default=None
307307
The number of concurrent threads

0 commit comments

Comments
 (0)