Cloud read
This commit is contained in:
parent
e8d8e1ea8a
commit
4c67d8b0a0
@ -12,7 +12,7 @@ allprojects {
|
||||
version = "0.1.2"
|
||||
}
|
||||
|
||||
val dataforgeVersion by extra("0.5.2")
|
||||
val dataforgeVersion by extra("0.5.3-dev-4")
|
||||
val tablesVersion: String by extra("0.1.2")
|
||||
val kmathVersion by extra("0.3.0-dev-17")
|
||||
val plotlyVersion: String by extra("0.5.0")
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -10,6 +10,7 @@ val dataforgeVersion: String by rootProject.extra
|
||||
dependencies {
|
||||
api(project(":numass-data-model"))
|
||||
api("space.kscience:dataforge-io:$dataforgeVersion")
|
||||
api(npmlibs.ktor.io)
|
||||
}
|
||||
|
||||
wire{
|
||||
|
@ -19,7 +19,6 @@ import java.nio.file.Path
|
||||
import kotlin.io.path.*
|
||||
import kotlin.streams.toList
|
||||
|
||||
@OptIn(ExperimentalPathApi::class)
|
||||
public class NumassDirectorySet internal constructor(
|
||||
public val context: Context,
|
||||
public val path: Path,
|
||||
|
@ -21,7 +21,7 @@ public class NumassProtoPlugin : AbstractPlugin() {
|
||||
}
|
||||
|
||||
public companion object : PluginFactory<NumassProtoPlugin> {
|
||||
override fun invoke(meta: Meta, context: Context): NumassProtoPlugin = NumassProtoPlugin()
|
||||
override fun build(context: Context, meta: Meta): NumassProtoPlugin = NumassProtoPlugin()
|
||||
override val tag: PluginTag = PluginTag("numass-proto", group = "ru.inr.mass")
|
||||
override val type: KClass<out NumassProtoPlugin> = NumassProtoPlugin::class
|
||||
}
|
||||
|
@ -21,6 +21,9 @@ dependencies {
|
||||
implementation("space.kscience:plotlykt-jupyter:$plotlyVersion")
|
||||
implementation("space.kscience:kmath-jupyter:$kmathVersion")
|
||||
implementation("space.kscience:tables-kt:$tablesVersion")
|
||||
implementation(platform("com.google.cloud:libraries-bom:23.0.0"))
|
||||
implementation("com.google.cloud:google-cloud-nio:0.123.10")
|
||||
implementation("com.google.auth:google-auth-library-oauth2-http:1.3.0")
|
||||
}
|
||||
|
||||
kscience{
|
||||
|
@ -0,0 +1,17 @@
|
||||
package ru.inr.mass.scripts
|
||||
|
||||
import com.google.cloud.storage.contrib.nio.CloudStorageFileSystem
|
||||
import ru.inr.mass.data.proto.NumassDirectorySet
|
||||
import ru.inr.mass.workspace.Numass
|
||||
import space.kscience.dataforge.data.DataTree
|
||||
|
||||
// https://storage.cloud.google.com/numass-data/2020_12/Adiabaticity/16/set_3/p10(10s)(HV1%3D13750)
|
||||
|
||||
suspend fun main() {
|
||||
CloudStorageFileSystem.forBucket("numass-data").use { fs ->
|
||||
val repo: DataTree<NumassDirectorySet> = Numass.readRepository(fs.getPath("2020_12/Adiabaticity"))
|
||||
repo.items().forEach{ (key,item)->
|
||||
println(key)
|
||||
}
|
||||
}
|
||||
}
|
@ -24,7 +24,6 @@ import kotlin.streams.toList
|
||||
object Numass {
|
||||
fun readDirectory(path: String): NumassDirectorySet = NUMASS.context.readNumassDirectory(path)
|
||||
|
||||
@OptIn(ExperimentalPathApi::class)
|
||||
fun readRepository(path: Path): DataTree<NumassDirectorySet> = runBlocking {
|
||||
ActiveDataTree {
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
|
Loading…
Reference in New Issue
Block a user