diff --git a/build.gradle.kts b/build.gradle.kts index bf732c893..92379d915 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import space.kscience.gradle.isInDevelopment import space.kscience.gradle.useApache2Licence import space.kscience.gradle.useSPCTeam @@ -77,12 +78,11 @@ ksciencePublish { } github("kmath", "SciProgCentre") space( - "https://maven.pkg.jetbrains.space/spc/p/sci/maven" -// if (isInDevelopment) { -// "https://maven.pkg.jetbrains.space/spc/p/sci/dev" -// } else { -// "https://maven.pkg.jetbrains.space/spc/p/sci/release" -// } + if (isInDevelopment) { + "https://maven.pkg.jetbrains.space/spc/p/sci/dev" + } else { + "https://maven.pkg.jetbrains.space/spc/p/sci/maven" + } ) sonatype() } diff --git a/docs/templates/ARTIFACT-TEMPLATE.md b/docs/templates/ARTIFACT-TEMPLATE.md index 1bac2a8ff..a3e47e693 100644 --- a/docs/templates/ARTIFACT-TEMPLATE.md +++ b/docs/templates/ARTIFACT-TEMPLATE.md @@ -3,10 +3,12 @@ The Maven coordinates of this project are `${group}:${name}:${version}`. **Gradle:** -```gradle +```groovy repositories { maven { url 'https://repo.kotlin.link' } mavenCentral() + // development and snapshot versions + maven { url 'https://maven.pkg.jetbrains.space/spc/p/sci/dev' } } dependencies { @@ -18,6 +20,8 @@ dependencies { repositories { maven("https://repo.kotlin.link") mavenCentral() + // development and snapshot versions + maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev") } dependencies { diff --git a/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/DubinsPose2D.kt b/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/DubinsPose2D.kt index ba001b4a5..5aa8c1455 100644 --- a/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/DubinsPose2D.kt +++ b/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/DubinsPose2D.kt @@ -24,7 +24,7 @@ public class PhaseVector2D( override val bearing: Double get() = atan2(velocity.x, velocity.y) } -internal class Pose2DImpl( +private class DubinsPose2DImpl( override val coordinate: DoubleVector2D, override val bearing: Double, ) : DubinsPose2D, DoubleVector2D by coordinate{ @@ -33,4 +33,4 @@ internal class Pose2DImpl( } -public fun Pose2D(coordinate: DoubleVector2D, theta: Double): DubinsPose2D = Pose2DImpl(coordinate, theta) \ No newline at end of file +public fun DubinsPose2D(coordinate: DoubleVector2D, theta: Double): DubinsPose2D = DubinsPose2DImpl(coordinate, theta) \ No newline at end of file diff --git a/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Trajectory2D.kt b/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Trajectory2D.kt index f1ae20722..3fcf4365d 100644 --- a/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Trajectory2D.kt +++ b/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Trajectory2D.kt @@ -19,12 +19,12 @@ public sealed interface Trajectory2D { * Straight path segment. The order of start and end defines the direction */ public data class StraightTrajectory2D( - internal val start: DoubleVector2D, - internal val end: DoubleVector2D, + public val start: DoubleVector2D, + public val end: DoubleVector2D, ) : Trajectory2D { override val length: Double get() = start.distanceTo(end) - internal val bearing: Double get() = theta(atan2(end.x - start.x, end.y - start.y)) + public val bearing: Double get() = theta(atan2(end.x - start.x, end.y - start.y)) } /** @@ -56,7 +56,7 @@ public data class CircleTrajectory2D( circle.radius * arcLength } - internal val direction: Direction by lazy { + public val direction: Direction by lazy { if (start.y < circle.center.y) { if (start.bearing > PI) Direction.RIGHT else Direction.LEFT } else if (start.y > circle.center.y) { @@ -81,7 +81,7 @@ public data class CircleTrajectory2D( vector: DoubleVector2D, theta: Double, direction: Direction, - ): DubinsPose2D = Pose2D( + ): DubinsPose2D = DubinsPose2D( vector, when (direction) { Direction.LEFT -> theta(theta - PI / 2) diff --git a/kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/dubins/DubinsTests.kt b/kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/dubins/DubinsTests.kt index 8cea22b45..5bbf8c294 100644 --- a/kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/dubins/DubinsTests.kt +++ b/kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/dubins/DubinsTests.kt @@ -19,8 +19,8 @@ class DubinsTests { val straight = StraightTrajectory2D(vector(0.0, 0.0), vector(100.0, 100.0)) val lineP1 = straight.shift(1, 10.0).inverse() - val start = Pose2D(straight.end, straight.bearing) - val end = Pose2D(lineP1.start, lineP1.bearing) + val start = DubinsPose2D(straight.end, straight.bearing) + val end = DubinsPose2D(lineP1.start, lineP1.bearing) val radius = 2.0 val dubins = DubinsPath.all(start, end, radius) @@ -51,8 +51,8 @@ class DubinsTests { assertTrue(path.c.start.equalsFloat(b.end)) } else if (path.b is StraightTrajectory2D) { val b = path.b as StraightTrajectory2D - assertTrue(path.a.end.equalsFloat(Pose2D(b.start, b.bearing))) - assertTrue(path.c.start.equalsFloat(Pose2D(b.end, b.bearing))) + assertTrue(path.a.end.equalsFloat(DubinsPose2D(b.start, b.bearing))) + assertTrue(path.c.start.equalsFloat(DubinsPose2D(b.end, b.bearing))) } } } diff --git a/kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/Math.kt b/kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/math.kt similarity index 100% rename from kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/Math.kt rename to kmath-trajectory/src/commonTest/kotlin/space/kscience/kmath/trajectory/math.kt