Skip to content

Commit 9de487d

Browse files
committedFeb 20, 2025
bump wayang to 1.0.0, gradle to latest version
1 parent fd7ab8c commit 9de487d

File tree

8 files changed

+26
-18
lines changed

8 files changed

+26
-18
lines changed
 

‎gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ flinkMlVersion = 2.3.0
3535
flinkStatefunVersion = 3.2.0
3636
groovy3Version = 3.0.21
3737
groovy4Version = 4.0.21
38-
groovy5Version = 5.0.0-alpha-8
38+
groovy5Version = 5.0.0-alpha-12
3939
igniteVersion = 2.16.0
4040
igniteMlVersion = 2.15.0
4141
jacksonVersion = 2.17.1
@@ -51,7 +51,7 @@ opencsvVersion = 5.9
5151
opennlpJdk8Version = 1.9.4
5252
opennlpJdk11Version = 2.2.0
5353
opennlpLatestVersion = 2.3.3
54-
slf4jVersion = 2.0.13
54+
slf4jVersion = 2.0.16
5555
smilePreviousVersion = 3.0.3
5656
smileVersion = 3.1.1
5757
tablesawVersion = 0.43.1

‎gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

‎gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

‎gradlew

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

‎gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

‎subprojects/WhiskeyWayang/build.gradle

+9-8
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,30 @@
1616
apply plugin: 'groovy'
1717

1818
repositories {
19-
mavenLocal() // until next wayang release of ml4all, build latest version and install locally
19+
// mavenLocal() // until next wayang release of ml4all, build latest version and install locally
2020
mavenCentral()
2121
// maven {
22-
// url 'https://repository.apache.org/content/repositories/orgapachewayang-1017'
22+
// url 'https://repository.apache.org/content/repositories/orgapachewayang-1025'
2323
// }
2424
}
2525

2626
ext {
27-
wayangVersion = '0.7.1'
27+
wayangVersion = '1.0.0'
2828
hadoopVersion = '3.4.0'
2929
scalaMajorVersion = '2.12'
30-
sparkVersion = '3.5.1'
30+
sparkVersion = '3.5.4'
3131
}
3232

3333
dependencies {
3434
implementation "org.apache.groovy:groovy:$groovy5Version"
35-
implementation "org.apache.wayang:wayang-api-scala-java_$scalaMajorVersion:$wayangVersion"
35+
implementation "org.apache.wayang:wayang-api-scala-java:$wayangVersion"
3636
implementation "org.apache.wayang:wayang-java:$wayangVersion"
3737
implementation("org.apache.wayang:wayang-ml4all:$wayangVersion") {
3838
exclude(group: 'org.apache.spark', module: 'spark-graphx_2.12')
3939
exclude(group: 'org.apache.spark', module: 'spark-mllib_2.12')
40+
exclude(group: 'org.apache.hadoop')
4041
}
41-
implementation("org.apache.wayang:wayang-spark_$scalaMajorVersion:$wayangVersion") {
42+
implementation("org.apache.wayang:wayang-spark:$wayangVersion") {
4243
transitive = false
4344
}
4445
implementation "com.fasterxml.jackson:jackson-bom:$jacksonVersion"
@@ -83,8 +84,8 @@ FileUtil.baseNames(sourceSets.main.allSource.files).each { name ->
8384
description "Run ${name}.groovy as a JVM application/Groovy script"
8485
classpath = sourceSets.main.runtimeClasspath
8586
mainClass = name
86-
if (JavaVersion.current().java11Compatible) {
87-
jvmArgs ['--add-exports=java.base/sun.nio.ch=ALL-UNNAMED']
87+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
88+
jvmArgs '--add-exports=java.base/sun.nio.ch=ALL-UNNAMED'
8889
}
8990
}
9091
runAll.configure {

‎subprojects/WhiskeyWayang/src/main/groovy/WhiskeyWayang.groovy

+6-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ class SelectNearestCentroid implements ExtendedSerializableFunction<Point, Point
5757
var minDistance = Double.POSITIVE_INFINITY
5858
var nearestCentroidId = -1
5959
for (c in centroids) {
60-
var distance = sqrt(p.pts.indices.collect{ p.pts[it] - c.pts[it] }.sum{ it ** 2 } as double)
60+
var distance = sqrt(p.pts.indices
61+
.collect{ p.pts[it] - c.pts[it] }
62+
.sum{ it ** 2 } as double)
6163
if (distance < minDistance) {
6264
minDistance = distance
6365
nearestCentroidId = c.cluster
@@ -90,7 +92,7 @@ var randomPoint = { (0..<dims).collect { r.nextGaussian() + 2 } as double[] }
9092
var initPts = (1..k).collect(randomPoint)
9193

9294
var context = new WayangContext()
93-
.withPlugin(Java.basicPlugin())
95+
// .withPlugin(Java.basicPlugin())
9496
.withPlugin(Spark.basicPlugin())
9597
var planBuilder = new JavaPlanBuilder(context, "KMeans ($url, k=$k, iterations=$iterations)")
9698

@@ -111,7 +113,7 @@ var finalCentroids = initialCentroids.repeat(iterations, currentCentroids ->
111113

112114
println 'Centroids:'
113115
finalCentroids.each { c ->
114-
println "Cluster $c.cluster: ${c.pts.collect { sprintf '%.2f', it }.join(', ')}"
116+
println "Cluster $c.cluster: ${c.pts.collect('%.2f'::formatted).join(', ')}"
115117
}
116118

117119
println()
@@ -120,7 +122,7 @@ var allocations = pointsData.withIndex()
120122
.collect{ pt, idx -> [allocator.apply(pt).cluster, distilleries[idx]] }
121123
.groupBy{ cluster, ds -> "Cluster $cluster" }
122124
.collectValues{ v -> v.collect{ it[1] } }
123-
.sort{ e1, e2 -> e1.key <=> e2.key }
125+
.sort{ it.key }
124126
allocations.each{ c, ds -> println "$c (${ds.size()} members): ${ds.join(', ')}" }
125127
/*
126128
Centroids:

‎subprojects/WhiskeyWayang/src/main/groovy/WhiskeyWayangML.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var plan = new ML4allPlan(
6565

6666
var model = plan.execute('file:' + url, context)
6767
model.getByKey("centers").eachWithIndex { center, idx ->
68-
var pts = center.collect { sprintf '%.2f', it }.join(', ')
68+
var pts = center.collect('%.2f'::formatted).join(', ')
6969
println "Cluster$idx: $pts"
7070
}
7171

0 commit comments

Comments
 (0)