dzs commited on
Commit
56eae50
·
1 Parent(s): 0c7ed93

remove debug mechanism - fast_bisect wasn't compiling - seems to be fixed now

Browse files
Files changed (1) hide show
  1. main.py +3 -25
main.py CHANGED
@@ -589,19 +589,6 @@ app.layout = html.Div(
589
  ),
590
  ],
591
  ),
592
- html.Pre(
593
- id="mm0_debug",
594
- style={
595
- "whiteSpace": "pre-wrap",
596
- "fontSize": "12px",
597
- "maxHeight": "260px",
598
- "overflowY": "auto",
599
- "border": "1px solid #ddd",
600
- "padding": "8px",
601
- "marginTop": "10px",
602
- "backgroundColor": "#fafafa",
603
- },
604
- ),
605
  ],
606
  ),
607
  ],
@@ -645,7 +632,6 @@ def toggle_condition2_inputs(mode):
645
 
646
  @app.callback(
647
  Output("mm0_chart", "figure"),
648
- Output("mm0_debug", "children"),
649
  Input("calculate", "n_clicks"),
650
  State("matrix", "value"),
651
  State("tg", "value"),
@@ -683,9 +669,6 @@ def update_chart(n_clicks,
683
  # TODO: replace with logic that uses the form inputs
684
  # For now, simply return the same figure when "Calculate" is clicked.
685
 
686
- t0 = time.time()
687
- debug = [f"click={n_clicks}"]
688
-
689
  df = pd.DataFrame()
690
  df['CASRN'] = soluteData['CASRN'].to_numpy()
691
 
@@ -718,13 +701,8 @@ def update_chart(n_clicks,
718
  Iterations = float(c1_iter)
719
  Lbath = float(c1_volume) / float(surface_area)
720
 
721
- try:
722
- medians, lowers, uppers = ExtractMonteCarlo(soluteData, Solvent_PI, w, ExtractionT, Polymer_Tg, Solvent_Name, Solvent_MW,
723
  ExtractionTime, Swell, Iterations, CHRIS_category, L, Lbath, N)
724
- except Exception:
725
- debug.append("c1 FAILED")
726
- debug.append(traceback.format_exc())
727
- return no_update, "\n".join(debug)
728
 
729
  df['Condition 1'] = medians
730
  df['Cond1_err_plus'] = uppers-medians
@@ -758,8 +736,8 @@ def update_chart(n_clicks,
758
  df['Cond2_err_minus'] = medians - lowers
759
 
760
  fig = build_figure(df)
761
- debug.append(f"fig ok total {time.time() - t0:.2f}s")
762
- return fig, "\n".join(debug)
763
 
764
  def ConservativeMonteCarlo(soluteData, CHRIS_category, L, time, N):
765
 
 
589
  ),
590
  ],
591
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  ],
593
  ),
594
  ],
 
632
 
633
  @app.callback(
634
  Output("mm0_chart", "figure"),
 
635
  Input("calculate", "n_clicks"),
636
  State("matrix", "value"),
637
  State("tg", "value"),
 
669
  # TODO: replace with logic that uses the form inputs
670
  # For now, simply return the same figure when "Calculate" is clicked.
671
 
 
 
 
672
  df = pd.DataFrame()
673
  df['CASRN'] = soluteData['CASRN'].to_numpy()
674
 
 
701
  Iterations = float(c1_iter)
702
  Lbath = float(c1_volume) / float(surface_area)
703
 
704
+ medians, lowers, uppers = ExtractMonteCarlo(soluteData, Solvent_PI, w, ExtractionT, Polymer_Tg, Solvent_Name, Solvent_MW,
 
705
  ExtractionTime, Swell, Iterations, CHRIS_category, L, Lbath, N)
 
 
 
 
706
 
707
  df['Condition 1'] = medians
708
  df['Cond1_err_plus'] = uppers-medians
 
736
  df['Cond2_err_minus'] = medians - lowers
737
 
738
  fig = build_figure(df)
739
+
740
+ return fig
741
 
742
  def ConservativeMonteCarlo(soluteData, CHRIS_category, L, time, N):
743