Skip to content

Commit

Permalink
Merge pull request #81 from SciProgCentre/dev
Browse files Browse the repository at this point in the history
0.8.0
  • Loading branch information
SPC-code authored Feb 3, 2024
2 parents c9d5710 + 196b394 commit 8116489
Show file tree
Hide file tree
Showing 96 changed files with 2,394 additions and 2,790 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ out/
.gradle
build/

.kotlin


!gradle-wrapper.jar
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Unreleased

### Added
- Wasm artifacts

### Changed

Expand All @@ -12,10 +11,34 @@
### Removed

### Fixed
- Partially fixed a bug with `MutableMeta` observable wrappers.

### Security

## 0.8.0 - 2024-02-03

### Added

- Wasm artifacts
- Add automatic MetaConverter for serializeable objects
- Add Meta and MutableMeta delegates for convertable and serializeable
- Meta mapping for data.

### Changed

- Descriptor `children` renamed to `nodes`
- `MetaConverter` now inherits `MetaSpec` (former `Specifiction`). So `MetaConverter` could be used more universally.
- Meta copy and modification now use lightweight non-observable meta builders.
- Full refactor of Data API. DataTree now works similar to Meta: contains optional anonymous root element and data items. Updates are available for `ObservaleDataSource` and `ObservableDataTree` variants.

### Deprecated

- `node(key,converter)` in favor of `serializable` delegate

### Fixed

- Partially fixed a bug with `MutableMeta` observable wrappers.
- `valueSequence` now include root value. So `meta.update` works properly.

## 0.7.0 - 2023-11-26

### Added
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

allprojects {
group = "space.kscience"
version = "0.7.1"
version = "0.8.0"
}

subprojects {
Expand Down
6 changes: 2 additions & 4 deletions dataforge-context/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ Context and provider definitions

## Artifact:

The Maven coordinates of this project are `space.kscience:dataforge-context:0.7.0`.
The Maven coordinates of this project are `space.kscience:dataforge-context:0.8.0`.

**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}

dependencies {
implementation("space.kscience:dataforge-context:0.7.0")
implementation("space.kscience:dataforge-context:0.8.0")
}
```
21 changes: 19 additions & 2 deletions dataforge-context/api/dataforge-context.api
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,27 @@ public final class space/kscience/dataforge/context/SlfLogManager$Companion : sp
public fun getTag ()Lspace/kscience/dataforge/context/PluginTag;
}

public final class space/kscience/dataforge/properties/PropertyKt {
public abstract interface annotation class space/kscience/dataforge/descriptors/Description : java/lang/annotation/Annotation {
public abstract fun value ()Ljava/lang/String;
}

public final class space/kscience/dataforge/properties/SchemePropertyKt {
public abstract interface annotation class space/kscience/dataforge/descriptors/DescriptorResource : java/lang/annotation/Annotation {
public abstract fun resourceName ()Ljava/lang/String;
}

public abstract interface annotation class space/kscience/dataforge/descriptors/DescriptorUrl : java/lang/annotation/Annotation {
public abstract fun url ()Ljava/lang/String;
}

public abstract interface annotation class space/kscience/dataforge/descriptors/Multiple : java/lang/annotation/Annotation {
}

public final class space/kscience/dataforge/descriptors/ReflectiveDescriptorsKt {
public static final fun forClass (Lspace/kscience/dataforge/meta/descriptors/MetaDescriptor$Companion;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/meta/descriptors/MetaDescriptor;
public static synthetic fun forClass$default (Lspace/kscience/dataforge/meta/descriptors/MetaDescriptor$Companion;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/meta/descriptors/MetaDescriptor;
}

public final class space/kscience/dataforge/properties/MetaAsFlowKt {
}

public final class space/kscience/dataforge/provider/DfTypeKt {
Expand Down
2 changes: 1 addition & 1 deletion dataforge-context/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kscience {
useCoroutines()
useSerialization()
commonMain {
api(project(":dataforge-meta"))
api(projects.dataforgeMeta)
api(spclibs.atomicfu)
}
jvmMain{
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package space.kscience.dataforge.properties


import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import space.kscience.dataforge.meta.*
import space.kscience.dataforge.misc.DFExperimental

@DFExperimental
public fun <T> ObservableMeta.asFlow(converter: MetaSpec<T>): Flow<T> = callbackFlow {
onChange(this){
trySend(converter.read(this))
}

awaitClose{
removeListener(this)
}
}

@DFExperimental
public fun <T> MutableMeta.listenTo(
scope: CoroutineScope,
converter: MetaConverter<T>,
flow: Flow<T>,
): Job = flow.onEach {
update(converter.convert(it))
}.launchIn(scope)

@DFExperimental
public fun <T> ObservableMutableMeta.bind(
scope: CoroutineScope,
converter: MetaConverter<T>,
flow: MutableSharedFlow<T>,
): Job = scope.launch{
listenTo(this, converter,flow)
onChange(flow){
launch {
flow.emit(converter.read(this@onChange))
}
}
flow.onCompletion {
removeListener(flow)
}
}.also {
it.invokeOnCompletion {
removeListener(flow)
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8116489

Please sign in to comment.