Skip to content

Commit

Permalink
Adds demo for plotting sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
neukym committed Dec 7, 2023
1 parent 65a0bab commit 0cd0880
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 12 deletions.
105 changes: 94 additions & 11 deletions demos/demo_plotting.ipynb

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion kymata/datasets/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Optional
from urllib import request

from kymata.entities.expression import HexelExpressionSet
from kymata.entities.expression import HexelExpressionSet, SensorExpressionSet
from kymata.io.file import path_type
from kymata.io.nkg import load_expression_set

Expand Down Expand Up @@ -121,6 +121,24 @@ def to_expressionset(self) -> HexelExpressionSet:
assert isinstance(es, HexelExpressionSet)
return es

class TVLDeltaInsTC1LoudnessOnlySensorsDataset(SampleDataset):
def __init__(self, data_root: Optional[path_type] = None, download: bool = True):
name = "TVL_2020_delta_ins_tontop_chan1_loudness_only_sensors"
super().__init__(
name=name,
filenames=[
"TVL_2020_delta_ins_tontop_chan1_loudness_only_sensors.nkg"
],
data_root=data_root,
remote_root="https://kymata.org/assets_kymata_toolbox_tutorial_data/gridsearch-result-data/",
download=download,
)

def to_expressionset(self) -> SensorExpressionSet:
es = load_expression_set(from_path_or_file=Path(self.path, self.filenames[0]))
assert isinstance(es, SensorExpressionSet)
return es


def data_root_path(data_root: Optional[path_type] = None) -> Path:

Expand Down

0 comments on commit 0cd0880

Please sign in to comment.