Skip to content

Commit 3503663

Browse files
committed
Fix default concurreny document and write triangle test
1 parent a081a70 commit 3503663

File tree

8 files changed

+38
-58
lines changed

8 files changed

+38
-58
lines changed

graphdatascience/procedure_surface/api/community/clique_counting_endpoints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def mutate(
3333
The graph to run the algorithm on
3434
mutate_property : str
3535
The property name to store the clique counts for each node
36-
concurrency : Optional[int], default=4
36+
concurrency : Optional[int], default=None
3737
The number of concurrent threads
3838
job_id : Optional[str], default=None
3939
An identifier for the job
@@ -74,7 +74,7 @@ def stats(
7474
----------
7575
G : GraphV2
7676
The graph to run the algorithm on
77-
concurrency : Optional[int], default=4
77+
concurrency : Optional[int], default=None
7878
The number of concurrent threads
7979
job_id : Optional[str], default=None
8080
An identifier for the job
@@ -115,7 +115,7 @@ def stream(
115115
----------
116116
G : GraphV2
117117
The graph to run the algorithm on
118-
concurrency : Optional[int], default=4
118+
concurrency : Optional[int], default=None
119119
The number of concurrent threads
120120
job_id : Optional[str], default=None
121121
An identifier for the job
@@ -160,7 +160,7 @@ def write(
160160
The graph to run the algorithm on
161161
write_property : str
162162
The property name to write the clique counts to
163-
concurrency : Optional[int], default=4
163+
concurrency : Optional[int], default=None
164164
The number of concurrent threads
165165
job_id : Optional[str], default=None
166166
An identifier for the job
@@ -199,7 +199,7 @@ def estimate(
199199
----------
200200
G : Union[GraphV2, dict[str, Any]]
201201
The graph or graph configuration to estimate for
202-
concurrency : Optional[int], default=4
202+
concurrency : Optional[int], default=None
203203
The number of concurrent threads
204204
node_labels : Optional[List[str]], default=None
205205
The node labels used to select nodes for this algorithm run

graphdatascience/procedure_surface/api/community/kmeans_endpoints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def mutate(
4747
The property name to store the community ID for each node
4848
compute_silhouette : Optional[bool], default=False
4949
Whether to compute silhouette coefficient
50-
concurrency : Optional[int], default=4
50+
concurrency : Optional[int], default=None
5151
The number of concurrent threads
5252
delta_threshold : Optional[float], default=0.05
5353
The convergence threshold for the algorithm
@@ -116,7 +116,7 @@ def stats(
116116
The node property to use for clustering
117117
compute_silhouette : Optional[bool], default=False
118118
Whether to compute silhouette coefficient
119-
concurrency : Optional[int], default=4
119+
concurrency : Optional[int], default=None
120120
The number of concurrent threads
121121
delta_threshold : Optional[float], default=0.05
122122
The convergence threshold for the algorithm
@@ -185,7 +185,7 @@ def stream(
185185
The node property to use for clustering
186186
compute_silhouette : Optional[bool], default=False
187187
Whether to compute silhouette coefficient
188-
concurrency : Optional[int], default=4
188+
concurrency : Optional[int], default=None
189189
The number of concurrent threads
190190
delta_threshold : Optional[float], default=0.05
191191
The convergence threshold for the algorithm
@@ -258,7 +258,7 @@ def write(
258258
The property name to write the community IDs to
259259
compute_silhouette : Optional[bool], default=False
260260
Whether to compute silhouette coefficient
261-
concurrency : Optional[int], default=4
261+
concurrency : Optional[int], default=None
262262
The number of concurrent threads
263263
delta_threshold : Optional[float], default=0.05
264264
The convergence threshold for the algorithm
@@ -325,7 +325,7 @@ def estimate(
325325
The node property to use for clustering
326326
compute_silhouette : Optional[bool], default=False
327327
Whether to compute silhouette coefficient
328-
concurrency : Optional[int], default=4
328+
concurrency : Optional[int], default=None
329329
The number of concurrent threads
330330
delta_threshold : Optional[float], default=0.05
331331
The convergence threshold for the algorithm

graphdatascience/procedure_surface/api/community/labelpropagation_endpoints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def mutate(
3939
The graph to run the algorithm on
4040
mutate_property : str
4141
The property name to store the community ID for each node
42-
concurrency : Optional[int], default=4
42+
concurrency : Optional[int], default=None
4343
The number of concurrent threads
4444
consecutive_ids : Optional[bool], default=False
4545
Whether to use consecutive community IDs starting from 0
@@ -96,7 +96,7 @@ def stats(
9696
----------
9797
G : GraphV2
9898
The graph to run the algorithm on
99-
concurrency : Optional[int], default=4
99+
concurrency : Optional[int], default=None
100100
The number of concurrent threads
101101
consecutive_ids : Optional[bool], default=False
102102
Whether to use consecutive community IDs starting from 0
@@ -154,7 +154,7 @@ def stream(
154154
----------
155155
G : GraphV2
156156
The graph to run the algorithm on
157-
concurrency : Optional[int], default=4
157+
concurrency : Optional[int], default=None
158158
The number of concurrent threads
159159
consecutive_ids : Optional[bool], default=False
160160
Whether to use consecutive community IDs starting from 0
@@ -218,7 +218,7 @@ def write(
218218
The graph to run the algorithm on
219219
write_property : str
220220
The property name to write the community IDs to
221-
concurrency : Optional[int], default=4
221+
concurrency : Optional[int], default=None
222222
The number of concurrent threads
223223
consecutive_ids : Optional[bool], default=False
224224
Whether to use consecutive community IDs starting from 0
@@ -275,7 +275,7 @@ def estimate(
275275
----------
276276
G : Union[GraphV2, dict[str, Any]]
277277
The graph or graph configuration to estimate for
278-
concurrency : Optional[int], default=4
278+
concurrency : Optional[int], default=None
279279
The number of concurrent threads
280280
consecutive_ids : Optional[bool], default=False
281281
Whether to use consecutive community IDs starting from 0

graphdatascience/procedure_surface/api/community/leiden_endpoints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def mutate(
4343
The graph to run the algorithm on
4444
mutate_property : str
4545
The property name to store the community ID for each node
46-
concurrency : Optional[int], default=4
46+
concurrency : Optional[int], default=None
4747
The number of concurrent threads
4848
consecutive_ids : Optional[bool], default=False
4949
Whether to use consecutive community IDs
@@ -111,7 +111,7 @@ def stats(
111111
----------
112112
G : GraphV2
113113
The graph to run the algorithm on
114-
concurrency : Optional[int], default=4
114+
concurrency : Optional[int], default=None
115115
The number of concurrent threads
116116
consecutive_ids : Optional[bool], default=False
117117
Whether to use consecutive community IDs
@@ -180,7 +180,7 @@ def stream(
180180
----------
181181
G : GraphV2
182182
The graph to run the algorithm on
183-
concurrency : Optional[int], default=4
183+
concurrency : Optional[int], default=None
184184
The number of concurrent threads
185185
consecutive_ids : Optional[bool], default=False
186186
Whether to use consecutive community IDs
@@ -255,7 +255,7 @@ def write(
255255
The graph to run the algorithm on
256256
write_property : str
257257
The property name to write the community ID to
258-
concurrency : Optional[int], default=4
258+
concurrency : Optional[int], default=None
259259
The number of concurrent threads
260260
consecutive_ids : Optional[bool], default=False
261261
Whether to use consecutive community IDs
@@ -323,7 +323,7 @@ def estimate(
323323
----------
324324
G : Union[GraphV2, dict[str, Any]]
325325
The graph to estimate for
326-
concurrency : Optional[int], default=4
326+
concurrency : Optional[int], default=None
327327
The number of concurrent threads
328328
consecutive_ids : Optional[bool], default=False
329329
Whether to use consecutive community IDs

graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ def mutate(
3535
3636
The Approximate Maximum k-cut algorithm is a community detection algorithm that partitions a graph into k communities
3737
such that the sum of weights of edges between different communities is maximized. It uses a
38-
variable neighborhood search (VNS) approach to find high-quality cuts. Parameters
38+
variable neighborhood search (VNS) approach to find high-quality cuts.
39+
40+
Parameters
3941
----------
4042
G : GraphV2
4143
The graph to run the algorithm on
4244
mutate_property : str
4345
The property name to store the community ID for each node
44-
concurrency : Optional[int], default=4
46+
concurrency : Optional[int], default=None
4547
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
4648
iterations : Optional[int], default=8
4749
The number of iterations the algorithm runs. More iterations may lead to better results but
@@ -105,7 +107,7 @@ def stream(
105107
----------
106108
G : GraphV2
107109
The graph to run the algorithm on
108-
concurrency : Optional[int], default=4
110+
concurrency : Optional[int], default=None
109111
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
110112
iterations : Optional[int], default=8
111113
The number of iterations the algorithm runs. More iterations may lead to better results but
@@ -168,7 +170,7 @@ def estimate(
168170
----------
169171
G : Union[GraphV2, dict[str, Any]]
170172
The graph to estimate for, or a graph configuration dictionary
171-
concurrency : Optional[int], default=4
173+
concurrency : Optional[int], default=None
172174
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
173175
iterations : Optional[int], default=8
174176
The number of iterations the algorithm runs

graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def mutate(
3838
The graph to run the algorithm on
3939
mutate_property : str
4040
The property name to store the triangle count for each node
41-
concurrency : Optional[int], default=4
41+
concurrency : Optional[int], default=None
4242
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
4343
job_id : Optional[str], default=None
4444
An identifier for the job that can be used to cancel or monitor progress
@@ -92,7 +92,7 @@ def stats(
9292
----------
9393
G : GraphV2
9494
The graph to run the algorithm on
95-
concurrency : Optional[int], default=4
95+
concurrency : Optional[int], default=None
9696
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
9797
job_id : Optional[str], default=None
9898
An identifier for the job that can be used to cancel or monitor progress
@@ -146,7 +146,7 @@ def stream(
146146
----------
147147
G : GraphV2
148148
The graph to run the algorithm on
149-
concurrency : Optional[int], default=4
149+
concurrency : Optional[int], default=None
150150
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
151151
job_id : Optional[str], default=None
152152
An identifier for the job that can be used to cancel or monitor progress
@@ -206,7 +206,7 @@ def write(
206206
The graph to run the algorithm on
207207
write_property : str
208208
The property name to store the triangle count for each node in the database
209-
concurrency : Optional[int], default=4
209+
concurrency : Optional[int], default=None
210210
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
211211
job_id : Optional[str], default=None
212212
An identifier for the job that can be used to cancel or monitor progress
@@ -258,7 +258,7 @@ def estimate(
258258
----------
259259
G : Union[GraphV2, dict[str, Any]]
260260
The graph to estimate for, or a graph configuration dictionary
261-
concurrency : Optional[int], default=4
261+
concurrency : Optional[int], default=None
262262
The number of concurrent threads. Setting this to 1 will run the algorithm single-threaded.
263263
label_filter : Optional[List[str]], default=None
264264
Filter triangles by node labels. Only triangles where all nodes have one of the specified

graphdatascience/procedure_surface/arrow/local_clustering_coefficient_arrow_endpoints.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# Copyright (c) "Neo4j"
2-
# Neo4j Sweden AB [http://neo4j.com]
3-
#
4-
# This file is part of Neo4j.
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
181
from typing import List, Optional
192

203
import pandas as pd

graphdatascience/tests/integrationV2/procedure_surface/arrow/test_triangle_count_arrow_endpoints.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,6 @@ def triangle_count_endpoints(
6060
yield TriangleCountArrowEndpoints(arrow_client, show_progress=False)
6161

6262

63-
@pytest.fixture
64-
def triangle_count_endpoints_with_write_back(
65-
arrow_client: AuthenticatedArrowClient, query_runner: QueryRunner
66-
) -> Generator[TriangleCountArrowEndpoints, None, None]:
67-
yield TriangleCountArrowEndpoints(
68-
arrow_client, write_back_client=RemoteWriteBackClient(arrow_client, query_runner), show_progress=False
69-
)
70-
71-
7263
def test_triangle_count_stats(triangle_count_endpoints: TriangleCountArrowEndpoints, sample_graph: GraphV2) -> None:
7364
"""Test Triangle Count stats operation via Arrow."""
7465
result = triangle_count_endpoints.stats(G=sample_graph)
@@ -109,11 +100,15 @@ def test_triangle_count_mutate(triangle_count_endpoints: TriangleCountArrowEndpo
109100
assert result.node_count == 6
110101

111102

103+
@pytest.mark.db_integration
112104
def test_triangle_count_write(
113-
triangle_count_endpoints_with_write_back: TriangleCountArrowEndpoints, db_graph: GraphV2
105+
arrow_client: AuthenticatedArrowClient, query_runner: QueryRunner, db_graph: GraphV2
114106
) -> None:
115-
"""Test Triangle Count write operation via Arrow."""
116-
result = triangle_count_endpoints_with_write_back.write(
107+
"""Test Triangle Count write operation."""
108+
endpoints = TriangleCountArrowEndpoints(
109+
arrow_client, RemoteWriteBackClient(arrow_client, query_runner), show_progress=True
110+
)
111+
result = endpoints.write(
117112
G=db_graph,
118113
write_property="triangle_count_write",
119114
)

0 commit comments

Comments
 (0)