Skip to content

Commit

Permalink
Merge pull request #514 from SciProgCentre/dev
Browse files Browse the repository at this point in the history
0.3.1
  • Loading branch information
SPC-code committed May 12, 2023
2 parents debcef4 + 13d6ea2 commit b5f85a6
Show file tree
Hide file tree
Showing 224 changed files with 1,525 additions and 608 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ out/

.idea/
.vscode/
.fleet/


# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
Expand Down
47 changes: 46 additions & 1 deletion .space.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
import kotlin.io.path.readText

val projectName = "kmath"

job("Build") {
gradlew("openjdk:11", "build")
//Perform only jvm tests
gradlew("spc.registry.jetbrains.space/p/sci/containers/kotlin-ci:1.0.3", "test", "jvmTest")
}

job("Publish") {
startOn {
gitPush { enabled = false }
}
container("spc.registry.jetbrains.space/p/sci/containers/kotlin-ci:1.0.3") {
env["SPACE_USER"] = "{{ project:space_user }}"
env["SPACE_TOKEN"] = "{{ project:space_token }}"
kotlinScript { api ->

val spaceUser = System.getenv("SPACE_USER")
val spaceToken = System.getenv("SPACE_TOKEN")

// write the version to the build directory
api.gradlew("version")

//read the version from build file
val version = java.nio.file.Path.of("build/project-version.txt").readText()

val revisionSuffix = if (version.endsWith("SNAPSHOT")) {
"-" + api.gitRevision().take(7)
} else {
""
}

api.space().projects.automation.deployments.start(
project = api.projectIdentifier(),
targetIdentifier = TargetIdentifier.Key(projectName),
version = version+revisionSuffix,
// automatically update deployment status based on the status of a job
syncWithAutomationJob = true
)
api.gradlew(
"publishAllPublicationsToSpaceRepository",
"-Ppublishing.space.user=\"$spaceUser\"",
"-Ppublishing.space.token=\"$spaceToken\"",
)
}
}
}
49 changes: 25 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# KMath

## [Unreleased]
## Unreleased

### Added

### Changed

### Deprecated

### Removed

### Fixed

### Security

## 0.3.1 - 2023-04-09

### Added
- Wasm support for `memory`, `core`, `complex` and `functions` modules.
- Generic builders for `BufferND` and `MutableBufferND`
- `NamedMatrix` - matrix with symbol-based indexing
- `Expression` with default arguments
- Type-aliases for numbers like `Float64`
- 2D optimal trajectory computation in a separate module `kmath-trajectory`
- Autodiff for generic algebra elements in core!
- Algebra now has an obligatory `bufferFactory` (#477).

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

### Deprecated

### Removed
- Trajectory moved to https://github.com/SciProgCentre/maps-kt
- Polynomials moved to https://github.com/SciProgCentre/kmath-polynomial

### Fixed

### Security
## 0.3.0

## [0.3.0]
### Added
- `ScaleOperations` interface
- `Field` extends `ScaleOperations`
Expand All @@ -56,8 +66,8 @@
- `contentEquals` with tolerance: #364
- Compilation to TeX for MST: #254


### Changed
- Annotations moved to `space.kscience.kmath`
- Exponential operations merged with hyperbolic functions
- Space is replaced by Group. Space is reserved for vector spaces.
- VectorSpace is now a vector space
Expand Down Expand Up @@ -89,11 +99,9 @@
- Rework of histograms.
- `UnivariateFunction` -> `Function1D`, `MultivariateFunction` -> `FunctionND`


### Deprecated
- Specialized `DoubleBufferAlgebra`


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


### Fixed
- Ring inherits RingOperations, not GroupOperations
- Univariate histogram filling

## 0.2.0

### Security

## [0.2.0]
### Added
- `fun` annotation for SAM interfaces in library
- Explicit `public` visibility for all public APIs
Expand All @@ -132,7 +137,6 @@
- New `MatrixFeature` interfaces for matrix decompositions
- Basic Quaternion vector support in `kmath-complex`.


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


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


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

## [0.1.4]
## 0.1.4

### Added
- Functional Expressions API
- Mathematical Syntax Tree, its interpreter and API
Expand All @@ -188,7 +191,6 @@
- Full hyperbolic functions support and default implementations within `ExtendedField`
- Norm support for `Complex`


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


### Fixed
- Missing copy method in Memory implementation on JS (https://github.com/mipt-npm/kmath/pull/106)
- D3.dim value in `kmath-dimensions`
- Multiplication in integer rings in `kmath-core` (https://github.com/mipt-npm/kmath/pull/101)
- Commons RNG compatibility (https://github.com/mipt-npm/kmath/issues/93)
- Multiplication of BigInt by scalar
- Multiplication of BigInt by scalar
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,6 @@ One can still use generic algebras though.
>
> **Maturity**: EXPERIMENTAL
### [kmath-polynomial](kmath-polynomial)
>
>
> **Maturity**: PROTOTYPE
>
> **Features:**
> - [polynomial abstraction](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt) : Abstraction for polynomial spaces.
> - [rational function abstraction](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/RationalFunction.kt) : Abstraction for rational functions spaces.
> - ["list" polynomials](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/ListRationalFunction.kt) : List implementation of univariate polynomials.
> - ["list" rational functions](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/ListPolynomial.kt) : List implementation of univariate rational functions.
> - ["list" polynomials and rational functions constructors](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/listConstructors.kt) : Constructors for list polynomials and rational functions.
> - ["list" polynomials and rational functions utilities](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/listUtil.kt) : Utilities for list polynomials and rational functions.
> - ["numbered" polynomials](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/NumberedRationalFunction.kt) : Numbered implementation of multivariate polynomials.
> - ["numbered" rational functions](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/NumberedPolynomial.kt) : Numbered implementation of multivariate rational functions.
> - ["numbered" polynomials and rational functions constructors](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/numberedConstructors.kt) : Constructors for numbered polynomials and rational functions.
> - ["numbered" polynomials and rational functions utilities](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/numberedUtil.kt) : Utilities for numbered polynomials and rational functions.
> - ["labeled" polynomials](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/LabeledRationalFunction.kt) : Labeled implementation of multivariate polynomials.
> - ["labeled" rational functions](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/LabeledPolynomial.kt) : Labeled implementation of multivariate rational functions.
> - ["labeled" polynomials and rational functions constructors](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/labeledConstructors.kt) : Constructors for labeled polynomials and rational functions.
> - ["labeled" polynomials and rational functions utilities](kmath-polynomial/src/commonMain/kotlin/space/kscience/kmath/functions/labeledUtil.kt) : Utilities for labeled polynomials and rational functions.

### [kmath-stat](kmath-stat)
>
>
Expand All @@ -262,11 +240,6 @@ One can still use generic algebras though.
> - [linear algebra operations](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt) : Advanced linear algebra operations like LU decomposition, SVD, etc.

### [kmath-trajectory](kmath-trajectory)
> Path and trajectory optimization
>
> **Maturity**: PROTOTYPE
### [kmath-viktor](kmath-viktor)
>
>
Expand Down Expand Up @@ -324,5 +297,4 @@ Gradle `6.0+` is required for multiplatform artifacts.

The project requires a lot of additional work. The most important thing we need is a feedback about what features are
required the most. Feel free to create feature requests. We are also welcome to code contributions, especially in issues
marked with
[waiting for a hero](https://github.com/SciProgCentre/kmath/labels/waiting%20for%20a%20hero) label.
marked with [waiting for a hero](https://github.com/SciProgCentre/kmath/labels/waiting%20for%20a%20hero) label.
5 changes: 4 additions & 1 deletion benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ kotlin {
all {
languageSettings {
progressiveMode = true
optIn("kotlin.contracts.ExperimentalContracts")
optIn("kotlin.ExperimentalUnsignedTypes")
optIn("space.kscience.kmath.UnstableKMathAPI")
}
}

Expand Down Expand Up @@ -153,7 +156,7 @@ kotlin.sourceSets.all {
with(languageSettings) {
optIn("kotlin.contracts.ExperimentalContracts")
optIn("kotlin.ExperimentalUnsignedTypes")
optIn("space.kscience.kmath.misc.UnstableKMathAPI")
optIn("space.kscience.kmath.UnstableKMathAPI")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import kotlinx.benchmark.Benchmark
import kotlinx.benchmark.Blackhole
import kotlinx.benchmark.Scope
import kotlinx.benchmark.State
import space.kscience.kmath.UnstableKMathAPI
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.Algebra
import space.kscience.kmath.operations.DoubleField
import space.kscience.kmath.operations.bindSymbol
import space.kscience.kmath.operations.invoke
Expand Down Expand Up @@ -94,6 +94,7 @@ class ExpressionsInterpretersBenchmark {
}

private val mst = node.toExpression(DoubleField)
@OptIn(UnstableKMathAPI::class)
private val wasm = node.wasmCompileToExpression(DoubleField)
private val estree = node.estreeCompileToExpression(DoubleField)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlinx.benchmark.Blackhole
import org.openjdk.jmh.annotations.Benchmark
import org.openjdk.jmh.annotations.Scope
import org.openjdk.jmh.annotations.State
import space.kscience.kmath.misc.UnstableKMathAPI
import space.kscience.kmath.UnstableKMathAPI
import space.kscience.kmath.operations.BigIntField
import space.kscience.kmath.operations.JBigIntegerField
import space.kscience.kmath.operations.invoke
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.jetbrains.kotlinx.multik.api.Multik
import org.jetbrains.kotlinx.multik.api.ones
import org.jetbrains.kotlinx.multik.ndarray.data.DN
import org.jetbrains.kotlinx.multik.ndarray.data.DataType
import space.kscience.kmath.misc.UnsafeKMathAPI
import space.kscience.kmath.UnsafeKMathAPI
import space.kscience.kmath.nd.*
import space.kscience.kmath.nd4j.nd4j
import space.kscience.kmath.operations.DoubleField
Expand Down
16 changes: 2 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ allprojects {
}

group = "space.kscience"
version = "0.3.1-dev-11"
version = "0.3.1"
}

subprojects {
Expand Down Expand Up @@ -55,18 +55,6 @@ subprojects {
}
}
}

plugins.withId("org.jetbrains.kotlin.multiplatform") {
configure<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension> {
sourceSets {
val commonTest by getting {
dependencies {
implementation(projects.testUtils)
}
}
}
}
}
}

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

apiValidation.nonPublicMarkers.add("space.kscience.kmath.misc.UnstableKMathAPI")
apiValidation.nonPublicMarkers.add("space.kscience.kmath.UnstableKMathAPI")

val multikVersion by extra("0.2.0")
11 changes: 7 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
`version-catalog`
}

java.targetCompatibility = JavaVersion.VERSION_11

repositories {
mavenLocal()
maven("https://repo.kotlin.link")
Expand All @@ -26,6 +24,11 @@ dependencies {
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.+")
}

kotlin.sourceSets.all {
languageSettings.optIn("kotlin.OptIn")
kotlin{
jvmToolchain{
languageVersion.set(JavaLanguageVersion.of(11))
}
sourceSets.all {
languageSettings.optIn("kotlin.OptIn")
}
}
1 change: 1 addition & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright 2018-2021 KMath contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
rootProject.name = "kmath"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Expand Down

0 comments on commit b5f85a6

Please sign in to comment.