11import { For , Match , Show , Switch , createMemo , createUniqueId } from "solid-js" ;
22import { getVerticalProfiles } from "~/lib/profiles" ;
3- import {
4- type Analysis ,
5- deleteAnalysis ,
6- experiments ,
7- outputForExperiment ,
8- outputForPermutation ,
9- } from "~/lib/store" ;
3+ import { type Analysis , deleteAnalysis , experiments } from "~/lib/store" ;
104import LinePlot from "./LinePlot" ;
115import { MdiCog , MdiContentCopy , MdiDelete , MdiDownload } from "./icons" ;
126import { Button } from "./ui/button" ;
@@ -37,21 +31,22 @@ export function TimeSeriesPlot() {
3731 return experiments
3832 . filter ( ( e ) => e . running === false ) // Skip running experiments
3933 . flatMap ( ( e , i ) => {
40- const experimentOutput = outputForExperiment ( e ) ;
41- const permutationRuns = e . permutations . map ( ( perm , j ) => {
42- const permOutput = outputForPermutation ( experimentOutput , j ) ;
43- return {
44- label : `${ e . name } /${ perm . name } ` ,
45- y : permOutput . h ?? [ ] ,
46- x : permOutput . t ?? [ ] ,
47- color : colors [ ( j + 1 ) % 10 ] ,
48- linestyle : linestyles [ i % 5 ] ,
49- } ;
50- } ) ;
34+ const experimentOutput = e . reference . output ;
35+ const permutationRuns = e . permutations
36+ . filter ( ( perm ) => perm . output !== undefined )
37+ . map ( ( perm , j ) => {
38+ return {
39+ label : `${ e . name } /${ perm . name } ` ,
40+ y : perm . output ?. h ?? [ ] ,
41+ x : perm . output ?. t ?? [ ] ,
42+ color : colors [ ( j + 1 ) % 10 ] ,
43+ linestyle : linestyles [ i % 5 ] ,
44+ } ;
45+ } ) ;
5146 return [
5247 {
53- y : experimentOutput ?. reference . h ?? [ ] ,
54- x : experimentOutput ?. reference . t ?? [ ] ,
48+ y : experimentOutput ?. h ?? [ ] ,
49+ x : experimentOutput ?. t ?? [ ] ,
5550 label : e . name ,
5651 color : colors [ 0 ] ,
5752 linestyle : linestyles [ i ] ,
@@ -77,16 +72,14 @@ export function VerticalProfilePlot() {
7772 return experiments
7873 . filter ( ( e ) => e . running === false ) // Skip running experiments
7974 . flatMap ( ( e , i ) => {
80- const experimentOutput = outputForExperiment ( e ) ;
8175 const permutations = e . permutations . map ( ( p , j ) => {
8276 // TODO get additional config info from reference
8377 // permutations probably usually don't have gammaq/gammatetha set?
84- const permOutput = outputForPermutation ( experimentOutput , j ) ;
8578 return {
8679 color : colors [ ( j + 1 ) % 10 ] ,
8780 linestyle : linestyles [ i % 5 ] ,
8881 label : `${ e . name } /${ p . name } ` ,
89- ...getVerticalProfiles ( permOutput , p . config , variable , time ) ,
82+ ...getVerticalProfiles ( p . output , p . config , variable , time ) ,
9083 } ;
9184 } ) ;
9285
@@ -96,7 +89,7 @@ export function VerticalProfilePlot() {
9689 color : colors [ 0 ] ,
9790 linestyle : linestyles [ i ] ,
9891 ...getVerticalProfiles (
99- experimentOutput ? .reference ?? {
92+ e . reference . output ?? {
10093 t : [ ] ,
10194 h : [ ] ,
10295 theta : [ ] ,
@@ -127,27 +120,19 @@ function FinalHeights() {
127120 < For each = { experiments } >
128121 { ( experiment ) => {
129122 const h = ( ) => {
130- const experimentOutput = outputForExperiment ( experiment ) ;
131- return (
132- experimentOutput ?. reference . h [
133- experimentOutput . reference . h . length - 1
134- ] || 0
135- ) ;
123+ const experimentOutput = experiment . reference . output ;
124+ return experimentOutput ?. h [ experimentOutput ?. h . length - 1 ] || 0 ;
136125 } ;
137126 return (
138127 < Show when = { ! experiment . running } >
139128 < li class = "mb-2" title = { experiment . name } >
140129 { experiment . name } : { h ( ) . toFixed ( ) } m
141130 </ li >
142131 < For each = { experiment . permutations } >
143- { ( perm , permIndex ) => {
132+ { ( perm ) => {
144133 const h = ( ) => {
145- const experimentOutput = outputForExperiment ( experiment ) ;
146- const permOutput = outputForPermutation (
147- experimentOutput ,
148- permIndex ( ) ,
149- ) ;
150- return permOutput . h ?. length
134+ const permOutput = perm . output ;
135+ return permOutput ?. h ?. length
151136 ? permOutput . h [ permOutput . h . length - 1 ]
152137 : 0 ;
153138 } ;
0 commit comments