Merge branch 'feature/fit-analysis' of git.sciprog.center:NPM/numass into feature/fit-analysis
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
/**
|
||||
* JetBrains Space Automation
|
||||
* This Kotlin-script file lets you automate build activities
|
||||
* For more info, see https://www.jetbrains.com/help/space/automation.html
|
||||
*/
|
||||
|
||||
job("Build and run tests") {
|
||||
gradlew("openjdk:11", "build")
|
||||
}
|
||||
@@ -22,7 +22,7 @@ val kmathVersion by extra("0.4.2")
|
||||
val visionForgeVersion: String by rootProject.extra("0.4.2")
|
||||
|
||||
|
||||
ksciencePublish {
|
||||
kscienceProject {
|
||||
pom("https://spc.jetbrains.space/p/numass/repositories/numass/") {
|
||||
useApache2Licence()
|
||||
useSPCTeam()
|
||||
@@ -30,7 +30,3 @@ ksciencePublish {
|
||||
//space("https://maven.pkg.jetbrains.space/spc/p/numass/maven")
|
||||
//repository("spc","https://maven.sciprog.center/spc")
|
||||
}
|
||||
|
||||
apiValidation {
|
||||
validationDisabled = true
|
||||
}
|
||||
@@ -7,9 +7,8 @@ kotlin.code.style=official
|
||||
kotlin.mpp.stability.nowarn=true
|
||||
kotlin.js.compiler=ir
|
||||
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1G
|
||||
|
||||
toolsVersion=0.16.1-kotlin-2.1.0
|
||||
toolsVersion=0.20.2-kotlin-2.3.0
|
||||
compose.version=1.7.3
|
||||
|
||||
@@ -15,17 +15,11 @@ kscience{
|
||||
dependencies {
|
||||
api("space.kscience:dataforge-context:$dataforgeVersion")
|
||||
api("space.kscience:dataforge-data:$dataforgeVersion")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:${space.kscience.gradle.KScienceVersions.dateTimeVersion}")
|
||||
api(spclibs.kotlinx.datetime)
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
api(spclibs.logback.classic)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin.sourceSets{
|
||||
getByName("jvmMain"){
|
||||
dependencies{
|
||||
api("ch.qos.logback:logback-classic:1.2.3")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package ru.inr.mass.data.proto
|
||||
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.datetime.toInstant
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmInline
|
||||
import kotlin.time.Instant
|
||||
|
||||
@Serializable
|
||||
public data class HVEntry(val timestamp: Instant, val value: Double, val channel: Int = 1) {
|
||||
public companion object {
|
||||
public fun readString(line: String): HVEntry {
|
||||
val (timeStr, channelStr, valueStr) = line.split(' ')
|
||||
return HVEntry((timeStr + "Z").toInstant(), valueStr.toDouble(), channelStr.toInt())
|
||||
return HVEntry(Instant.parse(timeStr + "Z"), valueStr.toDouble(), channelStr.toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,9 @@ kscience{
|
||||
api("space.kscience:kmath-functions:$kmathVersion")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin.sourceSets{
|
||||
getByName("jvmMain"){
|
||||
dependencies {
|
||||
api("space.kscience:kmath-commons:$kmathVersion")
|
||||
api("ch.qos.logback:logback-classic:1.2.3")
|
||||
}
|
||||
jvmMain{
|
||||
api("space.kscience:kmath-commons:$kmathVersion")
|
||||
api(spclibs.logback.classic)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ plugins {
|
||||
kotlin("plugin.serialization")
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
id("org.graalvm.buildtools.native") version "0.10.5"
|
||||
alias(spclibs.plugins.kotlin.jupyter.api)
|
||||
`maven-publish`
|
||||
application
|
||||
}
|
||||
@@ -27,13 +28,15 @@ dependencies {
|
||||
implementation("space.kscience:kmath-jupyter:$kmathVersion")
|
||||
implementation("space.kscience:tables-kt-csv:$tablesVersion")
|
||||
implementation("space.kscience:visionforge-plotly:$visionForgeVersion")
|
||||
implementation("com.charleskorn.kaml:kaml:0.45.0")
|
||||
implementation("com.charleskorn.kaml:kaml:0.104.0")
|
||||
implementation("com.github.ajalt.clikt:clikt:4.2.1")
|
||||
implementation("org.apache.commons:commons-csv:1.10.0")
|
||||
}
|
||||
|
||||
kscience{
|
||||
jupyterLibrary("ru.inr.mass.notebook.NumassJupyter")
|
||||
kotlinJupyter {
|
||||
integrations {
|
||||
producer("ru.inr.mass.notebook.NumassJupyter")
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package ru.inr.mass.scripts
|
||||
|
||||
import com.charleskorn.kaml.Yaml
|
||||
import com.charleskorn.kaml.decodeFromStream
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.serialization.Serializable
|
||||
import ru.inr.mass.models.*
|
||||
import ru.inr.mass.models.NBkgSpectrum
|
||||
import ru.inr.mass.models.NumassBeta
|
||||
import ru.inr.mass.models.NumassTransmission
|
||||
import space.kscience.kmath.expressions.Symbol
|
||||
import java.io.File
|
||||
import kotlin.io.path.Path
|
||||
|
||||
@@ -21,7 +21,10 @@ import space.kscience.kmath.data.XYErrorColumnarData
|
||||
import space.kscience.kmath.data.indices
|
||||
import space.kscience.kmath.expressions.Symbol
|
||||
import space.kscience.kmath.misc.Loggable
|
||||
import space.kscience.kmath.optimization.*
|
||||
import space.kscience.kmath.optimization.OptimizationLog
|
||||
import space.kscience.kmath.optimization.QowOptimizer
|
||||
import space.kscience.kmath.optimization.XYFit
|
||||
import space.kscience.kmath.optimization.result
|
||||
import space.kscience.kmath.structures.asBuffer
|
||||
import space.kscience.kmath.structures.toDoubleArray
|
||||
import space.kscience.plotly.*
|
||||
|
||||
@@ -2,7 +2,6 @@ package ru.inr.mass.scripts
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.context
|
||||
import com.github.ajalt.clikt.core.main
|
||||
import com.github.ajalt.clikt.output.MordantHelpFormatter
|
||||
import com.github.ajalt.clikt.parameters.options.default
|
||||
import com.github.ajalt.clikt.parameters.options.flag
|
||||
@@ -104,17 +103,17 @@ suspend fun calcSpectrum(fitParams: Map<Symbol, Double>, trapFunc: ITrap, wallFu
|
||||
},
|
||||
adjustX = false,
|
||||
),
|
||||
resolution = NumassResolution(1.7e-4, tailFunction = {e,u -> AdiabaticityModel.`2024_11`(e,u) })
|
||||
resolution = NumassResolution(1.7e-4, tailFunction = { e, u -> AdiabaticityModel.`2024_11`(e, u) })
|
||||
).withNBkg()
|
||||
|
||||
val out = range.map {
|
||||
// async(Dispatchers.Default) {
|
||||
|
||||
|
||||
val res = spectrum.invoke(it, fitParams)
|
||||
val res = spectrum.invoke(it, fitParams)
|
||||
// return@async res
|
||||
// }
|
||||
res
|
||||
res
|
||||
}
|
||||
// val out = handles.map { it.await() }
|
||||
println(out.toTypedArray().joinToString("\n"))
|
||||
|
||||
Reference in New Issue
Block a user