Skip to content

Commit b5f85a6

Browse files
authored
Merge pull request #514 from SciProgCentre/dev
0.3.1
2 parents debcef4 + 13d6ea2 commit b5f85a6

File tree

224 files changed

+1525
-608
lines changed

Some content is hidden

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

224 files changed

+1525
-608
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ out/
44

55
.idea/
66
.vscode/
7+
.fleet/
78

89

910
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)

.space.kts

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
import kotlin.io.path.readText
2+
3+
val projectName = "kmath"
4+
15
job("Build") {
2-
gradlew("openjdk:11", "build")
6+
//Perform only jvm tests
7+
gradlew("spc.registry.jetbrains.space/p/sci/containers/kotlin-ci:1.0.3", "test", "jvmTest")
8+
}
9+
10+
job("Publish") {
11+
startOn {
12+
gitPush { enabled = false }
13+
}
14+
container("spc.registry.jetbrains.space/p/sci/containers/kotlin-ci:1.0.3") {
15+
env["SPACE_USER"] = "{{ project:space_user }}"
16+
env["SPACE_TOKEN"] = "{{ project:space_token }}"
17+
kotlinScript { api ->
18+
19+
val spaceUser = System.getenv("SPACE_USER")
20+
val spaceToken = System.getenv("SPACE_TOKEN")
21+
22+
// write the version to the build directory
23+
api.gradlew("version")
24+
25+
//read the version from build file
26+
val version = java.nio.file.Path.of("build/project-version.txt").readText()
27+
28+
val revisionSuffix = if (version.endsWith("SNAPSHOT")) {
29+
"-" + api.gitRevision().take(7)
30+
} else {
31+
""
32+
}
33+
34+
api.space().projects.automation.deployments.start(
35+
project = api.projectIdentifier(),
36+
targetIdentifier = TargetIdentifier.Key(projectName),
37+
version = version+revisionSuffix,
38+
// automatically update deployment status based on the status of a job
39+
syncWithAutomationJob = true
40+
)
41+
api.gradlew(
42+
"publishAllPublicationsToSpaceRepository",
43+
"-Ppublishing.space.user=\"$spaceUser\"",
44+
"-Ppublishing.space.token=\"$spaceToken\"",
45+
)
46+
}
47+
}
348
}

CHANGELOG.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,47 @@
11
# KMath
22

3-
## [Unreleased]
3+
## Unreleased
4+
5+
### Added
6+
7+
### Changed
8+
9+
### Deprecated
10+
11+
### Removed
12+
13+
### Fixed
14+
15+
### Security
16+
17+
## 0.3.1 - 2023-04-09
18+
419
### Added
20+
- Wasm support for `memory`, `core`, `complex` and `functions` modules.
521
- Generic builders for `BufferND` and `MutableBufferND`
622
- `NamedMatrix` - matrix with symbol-based indexing
723
- `Expression` with default arguments
824
- Type-aliases for numbers like `Float64`
9-
- 2D optimal trajectory computation in a separate module `kmath-trajectory`
1025
- Autodiff for generic algebra elements in core!
1126
- Algebra now has an obligatory `bufferFactory` (#477).
1227

1328
### Changed
14-
- Trajectory use type-safe angles
29+
- Geometry uses type-safe angles
1530
- Tensor operations switched to prefix notation
1631
- Row-wise and column-wise ND shapes in the core
1732
- Shape is read-only
1833
- Major refactor of tensors (only minor API changes)
19-
- Kotlin 1.7.20
34+
- Kotlin 1.8.20
2035
- `LazyStructure` `deffered` -> `async` to comply with coroutines code style
2136
- Default `dot` operation in tensor algebra no longer support broadcasting. Instead `matmul` operation is added to `DoubleTensorAlgebra`.
2237
- Multik went MPP
2338

24-
### Deprecated
25-
2639
### Removed
2740
- Trajectory moved to https://github.com/SciProgCentre/maps-kt
2841
- Polynomials moved to https://github.com/SciProgCentre/kmath-polynomial
2942

30-
### Fixed
31-
32-
### Security
43+
## 0.3.0
3344

34-
## [0.3.0]
3545
### Added
3646
- `ScaleOperations` interface
3747
- `Field` extends `ScaleOperations`
@@ -56,8 +66,8 @@
5666
- `contentEquals` with tolerance: #364
5767
- Compilation to TeX for MST: #254
5868

59-
6069
### Changed
70+
- Annotations moved to `space.kscience.kmath`
6171
- Exponential operations merged with hyperbolic functions
6272
- Space is replaced by Group. Space is reserved for vector spaces.
6373
- VectorSpace is now a vector space
@@ -89,11 +99,9 @@
8999
- Rework of histograms.
90100
- `UnivariateFunction` -> `Function1D`, `MultivariateFunction` -> `FunctionND`
91101

92-
93102
### Deprecated
94103
- Specialized `DoubleBufferAlgebra`
95104

96-
97105
### Removed
98106
- Nearest in Domain. To be implemented in geometry package.
99107
- Number multiplication and division in main Algebra chain
@@ -104,15 +112,12 @@
104112
- Second generic from DifferentiableExpression
105113
- Algebra elements are completely removed. Use algebra contexts instead.
106114

107-
108115
### Fixed
109116
- Ring inherits RingOperations, not GroupOperations
110117
- Univariate histogram filling
111118

119+
## 0.2.0
112120

113-
### Security
114-
115-
## [0.2.0]
116121
### Added
117122
- `fun` annotation for SAM interfaces in library
118123
- Explicit `public` visibility for all public APIs
@@ -132,7 +137,6 @@
132137
- New `MatrixFeature` interfaces for matrix decompositions
133138
- Basic Quaternion vector support in `kmath-complex`.
134139

135-
136140
### Changed
137141
- Package changed from `scientifik` to `space.kscience`
138142
- Gradle version: 6.6 -> 6.8.2
@@ -157,7 +161,6 @@
157161
- `symbol` method in `Algebra` renamed to `bindSymbol` to avoid ambiguity
158162
- Add `out` projection to `Buffer` generic
159163

160-
161164
### Removed
162165
- `kmath-koma` module because it doesn't support Kotlin 1.4.
163166
- Support of `legacy` JS backend (we will support only IR)
@@ -166,11 +169,11 @@
166169
- `Real` class
167170
- StructureND identity and equals
168171

169-
170172
### Fixed
171173
- `symbol` method in `MstExtendedField` (https://github.com/mipt-npm/kmath/pull/140)
172174

173-
## [0.1.4]
175+
## 0.1.4
176+
174177
### Added
175178
- Functional Expressions API
176179
- Mathematical Syntax Tree, its interpreter and API
@@ -188,7 +191,6 @@
188191
- Full hyperbolic functions support and default implementations within `ExtendedField`
189192
- Norm support for `Complex`
190193

191-
192194
### Changed
193195
- `readAsMemory` now has `throws IOException` in JVM signature.
194196
- Several functions taking functional types were made `inline`.
@@ -200,10 +202,9 @@
200202
- Gradle version: 6.3 -> 6.6
201203
- Moved probability distributions to commons-rng and to `kmath-prob`
202204

203-
204205
### Fixed
205206
- Missing copy method in Memory implementation on JS (https://github.com/mipt-npm/kmath/pull/106)
206207
- D3.dim value in `kmath-dimensions`
207208
- Multiplication in integer rings in `kmath-core` (https://github.com/mipt-npm/kmath/pull/101)
208209
- Commons RNG compatibility (https://github.com/mipt-npm/kmath/issues/93)
209-
- Multiplication of BigInt by scalar
210+
- Multiplication of BigInt by scalar

README.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -214,28 +214,6 @@ One can still use generic algebras though.
214214
>
215215
> **Maturity**: EXPERIMENTAL
216216
217-
### [kmath-polynomial](kmath-polynomial)
218-
>
219-
>
220-
> **Maturity**: PROTOTYPE
221-
>
222-
> **Features:**
223-
> - [polynomial abstraction](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt) : Abstraction for polynomial spaces.
224-
> - [rational function abstraction](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/RationalFunction.kt) : Abstraction for rational functions spaces.
225-
> - ["list" polynomials](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/ListRationalFunction.kt) : List implementation of univariate polynomials.
226-
> - ["list" rational functions](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/ListPolynomial.kt) : List implementation of univariate rational functions.
227-
> - ["list" polynomials and rational functions constructors](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/listConstructors.kt) : Constructors for list polynomials and rational functions.
228-
> - ["list" polynomials and rational functions utilities](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/listUtil.kt) : Utilities for list polynomials and rational functions.
229-
> - ["numbered" polynomials](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/NumberedRationalFunction.kt) : Numbered implementation of multivariate polynomials.
230-
> - ["numbered" rational functions](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/NumberedPolynomial.kt) : Numbered implementation of multivariate rational functions.
231-
> - ["numbered" polynomials and rational functions constructors](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/numberedConstructors.kt) : Constructors for numbered polynomials and rational functions.
232-
> - ["numbered" polynomials and rational functions utilities](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/numberedUtil.kt) : Utilities for numbered polynomials and rational functions.
233-
> - ["labeled" polynomials](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/LabeledRationalFunction.kt) : Labeled implementation of multivariate polynomials.
234-
> - ["labeled" rational functions](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/LabeledPolynomial.kt) : Labeled implementation of multivariate rational functions.
235-
> - ["labeled" polynomials and rational functions constructors](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/labeledConstructors.kt) : Constructors for labeled polynomials and rational functions.
236-
> - ["labeled" polynomials and rational functions utilities](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/labeledUtil.kt) : Utilities for labeled polynomials and rational functions.
237-
238-
239217
### [kmath-stat](kmath-stat)
240218
>
241219
>
@@ -262,11 +240,6 @@ One can still use generic algebras though.
262240
> - [linear algebra operations](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt) : Advanced linear algebra operations like LU decomposition, SVD, etc.
263241
264242

265-
### [kmath-trajectory](kmath-trajectory)
266-
> Path and trajectory optimization
267-
>
268-
> **Maturity**: PROTOTYPE
269-
270243
### [kmath-viktor](kmath-viktor)
271244
>
272245
>
@@ -324,5 +297,4 @@ Gradle `6.0+` is required for multiplatform artifacts.
324297

325298
The project requires a lot of additional work. The most important thing we need is a feedback about what features are
326299
required the most. Feel free to create feature requests. We are also welcome to code contributions, especially in issues
327-
marked with
328-
[waiting for a hero](https://github.com/SciProgCentre/kmath/labels/waiting%20for%20a%20hero) label.
300+
marked with [waiting for a hero](https://github.com/SciProgCentre/kmath/labels/waiting%20for%20a%20hero) label.

benchmarks/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ kotlin {
2929
all {
3030
languageSettings {
3131
progressiveMode = true
32+
optIn("kotlin.contracts.ExperimentalContracts")
33+
optIn("kotlin.ExperimentalUnsignedTypes")
34+
optIn("space.kscience.kmath.UnstableKMathAPI")
3235
}
3336
}
3437

@@ -153,7 +156,7 @@ kotlin.sourceSets.all {
153156
with(languageSettings) {
154157
optIn("kotlin.contracts.ExperimentalContracts")
155158
optIn("kotlin.ExperimentalUnsignedTypes")
156-
optIn("space.kscience.kmath.misc.UnstableKMathAPI")
159+
optIn("space.kscience.kmath.UnstableKMathAPI")
157160
}
158161
}
159162

benchmarks/src/jsMain/kotlin/space/kscience/kmath/benchmarks/ExpressionsInterpretersBenchmark.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import kotlinx.benchmark.Benchmark
99
import kotlinx.benchmark.Blackhole
1010
import kotlinx.benchmark.Scope
1111
import kotlinx.benchmark.State
12+
import space.kscience.kmath.UnstableKMathAPI
1213
import space.kscience.kmath.expressions.*
13-
import space.kscience.kmath.operations.Algebra
1414
import space.kscience.kmath.operations.DoubleField
1515
import space.kscience.kmath.operations.bindSymbol
1616
import space.kscience.kmath.operations.invoke
@@ -94,6 +94,7 @@ class ExpressionsInterpretersBenchmark {
9494
}
9595

9696
private val mst = node.toExpression(DoubleField)
97+
@OptIn(UnstableKMathAPI::class)
9798
private val wasm = node.wasmCompileToExpression(DoubleField)
9899
private val estree = node.estreeCompileToExpression(DoubleField)
99100

benchmarks/src/jvmMain/kotlin/space/kscience/kmath/benchmarks/BigIntBenchmark.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import kotlinx.benchmark.Blackhole
1010
import org.openjdk.jmh.annotations.Benchmark
1111
import org.openjdk.jmh.annotations.Scope
1212
import org.openjdk.jmh.annotations.State
13-
import space.kscience.kmath.misc.UnstableKMathAPI
13+
import space.kscience.kmath.UnstableKMathAPI
1414
import space.kscience.kmath.operations.BigIntField
1515
import space.kscience.kmath.operations.JBigIntegerField
1616
import space.kscience.kmath.operations.invoke

benchmarks/src/jvmMain/kotlin/space/kscience/kmath/benchmarks/NDFieldBenchmark.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import org.jetbrains.kotlinx.multik.api.Multik
1313
import org.jetbrains.kotlinx.multik.api.ones
1414
import org.jetbrains.kotlinx.multik.ndarray.data.DN
1515
import org.jetbrains.kotlinx.multik.ndarray.data.DataType
16-
import space.kscience.kmath.misc.UnsafeKMathAPI
16+
import space.kscience.kmath.UnsafeKMathAPI
1717
import space.kscience.kmath.nd.*
1818
import space.kscience.kmath.nd4j.nd4j
1919
import space.kscience.kmath.operations.DoubleField

build.gradle.kts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ allprojects {
1515
}
1616

1717
group = "space.kscience"
18-
version = "0.3.1-dev-11"
18+
version = "0.3.1"
1919
}
2020

2121
subprojects {
@@ -55,18 +55,6 @@ subprojects {
5555
}
5656
}
5757
}
58-
59-
plugins.withId("org.jetbrains.kotlin.multiplatform") {
60-
configure<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension> {
61-
sourceSets {
62-
val commonTest by getting {
63-
dependencies {
64-
implementation(projects.testUtils)
65-
}
66-
}
67-
}
68-
}
69-
}
7058
}
7159

7260
readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md")
@@ -87,6 +75,6 @@ ksciencePublish {
8775
sonatype()
8876
}
8977

90-
apiValidation.nonPublicMarkers.add("space.kscience.kmath.misc.UnstableKMathAPI")
78+
apiValidation.nonPublicMarkers.add("space.kscience.kmath.UnstableKMathAPI")
9179

9280
val multikVersion by extra("0.2.0")

buildSrc/build.gradle.kts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ plugins {
33
`version-catalog`
44
}
55

6-
java.targetCompatibility = JavaVersion.VERSION_11
7-
86
repositories {
97
mavenLocal()
108
maven("https://repo.kotlin.link")
@@ -26,6 +24,11 @@ dependencies {
2624
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.+")
2725
}
2826

29-
kotlin.sourceSets.all {
30-
languageSettings.optIn("kotlin.OptIn")
27+
kotlin{
28+
jvmToolchain{
29+
languageVersion.set(JavaLanguageVersion.of(11))
30+
}
31+
sourceSets.all {
32+
languageSettings.optIn("kotlin.OptIn")
33+
}
3134
}

0 commit comments

Comments
 (0)