Skip to content

Commit

Permalink
update testing script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Nov 7, 2024
1 parent fb42ed8 commit 9848e0d
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions dont_fret/tmp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# %%
import uuid
from dataclasses import replace
from functools import reduce
Expand All @@ -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,
Expand All @@ -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 = """
Expand All @@ -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()


# %%

0 comments on commit 9848e0d

Please sign in to comment.