File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,9 +66,37 @@ export const useSimulationQueries = (experiments: ExperimentResult[]): UseSimula
6666 combine : ( queryResults ) => {
6767 const data : Record < string , SimulationResults [ ] > = { } ;
6868
69+ let simulationIndex : number = 0 ;
70+
6971 for ( const result of queryResults ) {
72+ if ( result . isLoading ) {
73+ ( data [ simulationsToRun [ simulationIndex ] . experiment . name ] ??= [ ] ) . push ( {
74+ status : "pending" ,
75+ finalConcentrations : { } ,
76+ modelInput : {
77+ modelId : simulationsToRun [ simulationIndex ] . model . modelId ,
78+ parameters : simulationsToRun [ simulationIndex ] . model . parameters
79+ ? Object . fromEntries (
80+ Object . entries ( simulationsToRun [ simulationIndex ] . model . parameters ) . map (
81+ ( [ key , value ] ) => [ key , value . default ]
82+ )
83+ )
84+ : { } ,
85+ concentrations : Object . fromEntries (
86+ Object . entries (
87+ simulationsToRun [ simulationIndex ] . experiment . initialConcentrations
88+ ) . filter ( ( [ , value ] ) => Number ( value ) !== 0 )
89+ ) ,
90+ } ,
91+ panels : [ ] ,
92+ } ) ;
93+ }
94+
7095 if ( ! result . data ) continue ;
96+
7197 ( data [ result . data . experiment . name ] ??= [ ] ) . push ( result . data . result ) ;
98+
99+ simulationIndex += 1 ;
72100 }
73101 const isLoading =
74102 queryResults . length !== simulationsToRun . length || queryResults . some ( ( value ) => value . isLoading ) ;
You can’t perform that action at this time.
0 commit comments