Skip to content

Commit b5bec0e

Browse files
committed
HashGNNConfig is not a proc config
So it should not be annotated or used directly in tests. Instead, we use an actual config in tests (stream config).
1 parent b13c445 commit b5bec0e

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

algo/src/main/java/org/neo4j/gds/embeddings/hashgnn/HashGNNConfig.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.Map;
3030
import java.util.Optional;
3131

32-
@Configuration
3332
interface HashGNNConfig extends AlgoBaseConfig, FeaturePropertiesConfig, RandomSeedConfig {
3433

3534
@Configuration.IntegerRange(min = 1)

algo/src/test/java/org/neo4j/gds/embeddings/hashgnn/DensifyTaskTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void shouldDensify() {
3636
var nodeCount = 3;
3737

3838
var partition = new Partition(0, nodeCount);
39-
var config = HashGNNConfigImpl
39+
var config = HashGNNStreamConfigImpl
4040
.builder()
4141
.featureProperties(List.of("f1", "f2"))
4242
.embeddingDensity(4)

algo/src/test/java/org/neo4j/gds/embeddings/hashgnn/GenerateFeaturesTaskTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void shouldGenerateCorrectNumberOfFeatures() {
5151

5252
var partition = new Partition(0, graph.nodeCount());
5353
var totalFeatureCount = new MutableLong(0);
54-
var config = HashGNNConfigImpl
54+
var config = HashGNNStreamConfigImpl
5555
.builder()
5656
.generateFeatures(Map.of("dimension", embeddingDimension, "densityLevel", densityLevel))
5757
.iterations(1337)

algo/src/test/java/org/neo4j/gds/embeddings/hashgnn/HashGNNConfigTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class HashGNNConfigTest {
3232
@Test
3333
void binarizationConfigCorrectType() {
34-
var config = HashGNNConfigImpl
34+
var config = HashGNNStreamConfigImpl
3535
.builder()
3636
.featureProperties(List.of("x"))
3737
.binarizeFeatures(Map.of("dimension", 100))
@@ -44,7 +44,7 @@ void binarizationConfigCorrectType() {
4444
@Test
4545
void shouldNotAllowGeneratedAndFeatureProperties() {
4646
assertThatThrownBy(() -> {
47-
HashGNNConfigImpl
47+
HashGNNStreamConfigImpl
4848
.builder()
4949
.featureProperties(List.of("x"))
5050
.generateFeatures(Map.of("dimension", 100, "densityLevel", 2))
@@ -57,7 +57,7 @@ void shouldNotAllowGeneratedAndFeatureProperties() {
5757
@Test
5858
void requiresFeaturePropertiesIfNoGeneratedFeatures() {
5959
assertThatThrownBy(() -> {
60-
HashGNNConfigImpl
60+
HashGNNStreamConfigImpl
6161
.builder()
6262
.embeddingDensity(4)
6363
.iterations(100)
@@ -68,7 +68,7 @@ void requiresFeaturePropertiesIfNoGeneratedFeatures() {
6868
@Test
6969
void requiresDensityLevelAtMostDensity() {
7070
assertThatThrownBy(() -> {
71-
HashGNNConfigImpl
71+
HashGNNStreamConfigImpl
7272
.builder()
7373
.embeddingDensity(4)
7474
.generateFeatures(Map.of("dimension", 4, "densityLevel", 5))
@@ -80,7 +80,7 @@ void requiresDensityLevelAtMostDensity() {
8080
@Test
8181
void failsOnInvalidBinarizationKeys() {
8282
assertThatThrownBy(() -> {
83-
new HashGNNConfigImpl(CypherMapWrapper.create(
83+
new HashGNNStreamConfigImpl(CypherMapWrapper.create(
8484
Map.of(
8585
"mutateProperty", "foo",
8686
"featureProperties", List.of("x"),
@@ -97,7 +97,7 @@ void failsOnInvalidBinarizationKeys() {
9797
@Test
9898
void failsOnInvalidGenerateFeaturesKeys() {
9999
assertThatThrownBy(() -> {
100-
new HashGNNConfigImpl(CypherMapWrapper.create(
100+
new HashGNNStreamConfigImpl(CypherMapWrapper.create(
101101
Map.of(
102102
"generateFeatures", Map.of("dimension", 100, "densityElfen", 2),
103103
"embeddingDensity", 4,

algo/src/test/java/org/neo4j/gds/embeddings/hashgnn/HashGNNTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class HashGNNTest {
9797
@Test
9898
void binaryLowNeighborInfluence() {
9999
int embeddingDensity = 4;
100-
var config = HashGNNConfigImpl
100+
var config = HashGNNStreamConfigImpl
101101
.builder()
102102
.featureProperties(List.of("f1", "f2"))
103103
.embeddingDensity(embeddingDensity)
@@ -114,7 +114,7 @@ void binaryLowNeighborInfluence() {
114114

115115
@Test
116116
void binaryHighEmbeddingDensityHighNeighborInfluence() {
117-
var config = HashGNNConfigImpl
117+
var config = HashGNNStreamConfigImpl
118118
.builder()
119119
.featureProperties(List.of("f1", "f2"))
120120
.embeddingDensity(200)
@@ -143,7 +143,7 @@ static Stream<Arguments> determinismParams() {
143143
@ParameterizedTest
144144
@MethodSource("determinismParams")
145145
void shouldBeDeterministic(int concurrency, boolean binarize, boolean dimReduce) {
146-
var configBuilder = HashGNNConfigImpl
146+
var configBuilder = HashGNNStreamConfigImpl
147147
.builder()
148148
.featureProperties(List.of("f1", "f2"))
149149
.embeddingDensity(2)
@@ -177,7 +177,7 @@ void shouldRunOnDoublesAndBeDeterministicEqualNeighborInfluence() {
177177
// not all random seeds will give b a unique feature
178178
// this intends to test that if b has a unique feature before the first iteration, then it also has it after the first iteration
179179
// however we simulate what is before the first iteration by running with neighborInfluence 0
180-
var configBuilder = HashGNNConfigImpl
180+
var configBuilder = HashGNNStreamConfigImpl
181181
.builder()
182182
.featureProperties(List.of("f1", "f2"))
183183
.embeddingDensity(embeddingDensity)
@@ -216,7 +216,7 @@ void shouldRunOnDoublesAndBeDeterministicHighNeighborInfluence() {
216216
int embeddingDensity = 100;
217217
int binarizationDimension = 8;
218218

219-
var configBuilder = HashGNNConfigImpl
219+
var configBuilder = HashGNNStreamConfigImpl
220220
.builder()
221221
.featureProperties(List.of("f1", "f2"))
222222
.embeddingDensity(embeddingDensity)
@@ -251,7 +251,7 @@ void shouldRunOnDoublesAndBeDeterministicHighNeighborInfluence() {
251251
void outputDimensionIsApplied() {
252252
int embeddingDensity = 200;
253253
double avgDegree = binaryGraph.relationshipCount() / (double) binaryGraph.nodeCount();
254-
var config = HashGNNConfigImpl
254+
var config = HashGNNStreamConfigImpl
255255
.builder()
256256
.featureProperties(List.of("f1", "f2"))
257257
.embeddingDensity(embeddingDensity)
@@ -295,7 +295,7 @@ void shouldEstimateMemory(
295295
int concurrency,
296296
long expectedMemory
297297
) {
298-
var config = HashGNNConfigImpl
298+
var config = HashGNNStreamConfigImpl
299299
.builder()
300300
.featureProperties(List.of("f1", "f2"))
301301
.embeddingDensity(embeddingDensity)
@@ -318,7 +318,7 @@ void shouldLogProgress(boolean dense) {
318318

319319
int embeddingDensity = 200;
320320
double avgDegree = g.relationshipCount() / (double) g.nodeCount();
321-
var configBuilder = HashGNNConfigImpl
321+
var configBuilder = HashGNNStreamConfigImpl
322322
.builder()
323323
.featureProperties(List.of("f1", "f2"))
324324
.embeddingDensity(embeddingDensity)
@@ -414,7 +414,7 @@ void shouldBeDeterministicGivenSameOriginalIds() {
414414
var firstGraph = GraphFactory.create(firstIdMap, firstRelationships);
415415
var secondGraph = GraphFactory.create(secondIdMap, secondRelationships);
416416

417-
var config = HashGNNConfigImpl
417+
var config = HashGNNStreamConfigImpl
418418
.builder()
419419
.embeddingDensity(8)
420420
.generateFeatures(Map.of("dimension", embeddingDimension, "densityLevel", 2))

algo/src/test/java/org/neo4j/gds/embeddings/hashgnn/HashTaskTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void shouldHash() {
3636
int NUMBER_OF_RELATIONSHIPS = 3;
3737
int EMBEDDING_DIMENSION = 10;
3838

39-
var config = HashGNNConfigImpl
39+
var config = HashGNNStreamConfigImpl
4040
.builder()
4141
.featureProperties(List.of("f1", "f2"))
4242
.iterations(ITERATIONS)

0 commit comments

Comments
 (0)