From 9848e0d7f812a0d33c9088c006fbd75705131bfb Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Thu, 7 Nov 2024 13:15:14 +0100 Subject: [PATCH] update testing script --- dont_fret/tmp.py | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/dont_fret/tmp.py b/dont_fret/tmp.py index 82646c8..4b5d7db 100644 --- a/dont_fret/tmp.py +++ b/dont_fret/tmp.py @@ -1,3 +1,4 @@ +# %% import uuid from dataclasses import replace from functools import reduce @@ -19,7 +20,8 @@ from dont_fret.web.components import RegexSelectDialog from dont_fret.web.home import HomePage from dont_fret.web.main import Page as MainPage -from dont_fret.web.models import BurstNode, ListStore, PhotonNode +from dont_fret.web.methods import make_burst_nodes +from dont_fret.web.models import BurstNode, FRETNode, ListStore, PhotonNode from dont_fret.web.trace import TracePage from dont_fret.web.utils import ( find_index, @@ -29,7 +31,14 @@ wrap_callback, ) -data = yaml.safe_load(Path("default_testing.yaml").read_text()) +# %% + +ROOT = Path(__file__).parent.parent +ROOT +# %% + + +data = yaml.safe_load((ROOT / "default_testing.yaml").read_text()) cfg.update(data) style = """ @@ -39,15 +48,37 @@ } """ -my_selection = ListStore([]) +pth = ROOT / "tests" / "test_data" / "input" / "ds2" + +# %% +pth.exists() +# %% + + +def on_start(): + photon_nodes = [PhotonNode(file_path=ptu_pth) for ptu_pth in pth.glob("*.ptu")] + burst_nodes = make_burst_nodes(photon_nodes, cfg.burst_search) -values = ["a", "b1", "c1", "d3"] + node_1 = FRETNode( + name=solara.Reactive("my_node"), + photons=ListStore(photon_nodes), + bursts=ListStore(burst_nodes), + ) -state.disable_burst_page.set(False) -state.disable_trace_page.set(False) + state.fret_nodes.set([node_1]) + state.disable_burst_page.set(False) + state.disable_trace_page.set(False) + + +import solara.lifecycle + +solara.lifecycle.on_kernel_start(on_start) @solara.component def Page(): solara.Style(style) MainPage() + + +# %%