-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
64 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,51 @@ | ||
import uuid | ||
from dataclasses import replace | ||
from functools import reduce | ||
from itertools import chain | ||
from operator import and_ | ||
from pathlib import Path | ||
from typing import Callable, Dict, List, Optional, Type, TypedDict, Union | ||
|
||
import altair as alt | ||
import numpy as np | ||
import solara | ||
import solara.lab | ||
import yaml | ||
|
||
import dont_fret.web.state as state | ||
from dont_fret.config.config import cfg | ||
from dont_fret.config.config import BurstFilterItem, cfg | ||
from dont_fret.web.bursts import BurstPage | ||
from dont_fret.web.bursts.components import BurstFigure, BurstFigureSelection | ||
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 PhotonNode | ||
from dont_fret.web.new_models import FRETNode, ListStore | ||
from dont_fret.web.models import BurstNode, PhotonNode | ||
from dont_fret.web.new_models import FRETNode, ListStore, SelectorNode, SyncDataManager | ||
from dont_fret.web.trace import TracePage | ||
from dont_fret.web.utils import ( | ||
find_index, | ||
find_object, | ||
get_bursts, | ||
make_selector_nodes, | ||
wrap_callback, | ||
) | ||
|
||
data = yaml.safe_load(Path("default_testing.yaml").read_text()) | ||
cfg.update(data) | ||
|
||
ROOT = Path(__file__).parent.parent | ||
pth = ROOT / "tests" / "test_data" / "input" / "ds2" | ||
photon_file_items = [PhotonNode(file_path=ptu_pth) for ptu_pth in pth.glob("*.ptu")] | ||
style = """ | ||
.vega-embed { | ||
overflow: visible; | ||
width: 100% !important; | ||
} | ||
""" | ||
|
||
# TODO default burst searches from config | ||
DCBS_TEST = {"DD + DA": {"L": 50, "M": 35, "T": 0.0005}, "AA": {"L": 50, "M": 35, "T": 0.0005}} | ||
APBS_TEST = {"DD + DA + AA": {"L": 50, "M": 35, "T": 0.0005}} | ||
my_selection = ListStore([]) | ||
|
||
pth = "ds2" | ||
# photon_file_items = [] | ||
# burst_items = load_burst_items(pth, suffix=".csv") | ||
|
||
fret_nodes = [ | ||
FRETNode( | ||
name=solara.reactive("FRET TOO"), | ||
photons=ListStore(photon_file_items), | ||
# bursts=burst_items, | ||
), | ||
] | ||
|
||
# %% | ||
values = ["a", "b1", "c1", "d3"] | ||
|
||
|
||
@solara.component | ||
def Page(): | ||
def preload(): | ||
# state.FRET_NODES.set([]) | ||
if len(state.fret_nodes) == 0: | ||
print("len zero") | ||
state.fret_nodes.extend(fret_nodes) | ||
|
||
solara.use_effect(preload, dependencies=[]) | ||
# nodes = state.fret_nodes.value | ||
|
||
if len(state.fret_nodes) != 0: | ||
with solara.Column(style={"height": "100%"}): | ||
MainPage() | ||
else: | ||
solara.Text("Loading fret nodes...") | ||
solara.Style(style) | ||
MainPage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.