Skip to content

Commit

Permalink
Icons auf der Main Seite angepasst
Browse files Browse the repository at this point in the history
Physiological Pipeline -> Beschreibungen verbessert
Panel Version auf die aktuellste erhöht
Unnötige Tests entfernt
  • Loading branch information
shMeske committed Dec 20, 2023
1 parent 3af2b55 commit 339b93a
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 160 deletions.
2 changes: 1 addition & 1 deletion assets/Icons/Physiological.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/Icons/Psychological.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/Icons/Questionnaire.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/Icons/Saliva.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/Icons/Sleep.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
[tool.poetry.dependencies]
python = ">=3.9,<3.11"
biopsykit = "^0.9.0"
panel = "^1.3.1"
panel = "^1.3.5"
nilspodlib = "3.6.0"
pandas = "1.5.2"
numpy = "1.23.5"
Expand Down
35 changes: 28 additions & 7 deletions src/Physiological/PHYSIOLOGICAL_CONSTANTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
"while multiple Sessions describe that two or more sensors are used. \n"
)

SIGNAL_TYPE_TEXT = "# Selecting Physiological Signal Type"
SIGNAL_TYPE_TEXT = (
"# Selecting Physiological Signal Type \n"
"Below you can select the Physiological Signal Type you want to analyse.\n"
"You may choose between: ECG, RSP, EEG. \n"
)
SELECT_CFT_TEXT = (
"# Select CFT Sheet \n\n"
"This step allows you to select a CFT sheet from a list "
Expand Down Expand Up @@ -64,7 +68,13 @@
"hit the process button, and then proceed. "
"Otherwise, you can skip this step and go to the next stage. \n \n"
)
ASK_DETECT_OUTLIER_TEXT = "# Do you want to check for outliers?"
ASK_DETECT_OUTLIER_TEXT = (
"# Do you want to check for outliers? \n"
"If you want to check for outliers,"
'you can click the "Yes" button, otherwise click "Skip". In the following '
"step are the different kinds of outlier detection methods you can apply"
"to your data.\n"
)

OUTLIER_DETECTION_TEXT = (
"# Outlier Detection \n\n"
Expand Down Expand Up @@ -94,11 +104,16 @@

FILE_UPLOAD_TEXT = (
"# Upload your session File \n"
"## The supported File formats are .bin, .csv, and you can also choose Folders.\n"
"## The supported File formats are .bin, .csv you can also upload Folders,"
"but these have to be zipped before.\n"
"After your upload your file will also be checked if it contains the necessary columns.\n"
)

DOWNLOAD_RESULT_TEXT = "# Download Result \n"
DOWNLOAD_RESULT_TEXT = (
"# Download Result \n"
"You can download the result of the analysis here. In the downloaded file you "
"you can find the analysed data as .xslsx files."
)
DATA_ARRIVED_TEXT = (
"# Files uploaded successfully \n"
"Below is a short summary of the files which you uploaded."
Expand All @@ -114,12 +129,18 @@
ASK_ADD_TIMES_TEXT = (
"# Do you want to add Phases for your Data?\n"
"If you want to upload an Excel oder CSV File, or if you want to manually add Phases "
"to your data then click on the Add Times Button otherwise skip"
"to your data then click on the Add Times Button otherwise skip."
)
ADD_TIMES_TEXT = (
"# Select Times\n"
"In this step you can add Phases for your data. \n"
"You can either upload an Excel or CSV File or you can manually add "
"Phases for the different subjects. \n"
)
ADD_TIMES_TEXT = "# Select Times"
PRESTEP_PROCESSING_TEXT = (
"# Processing \n"
"Im nächsten Schritt werden die Daten verarbeitet, dieser Schritt dauert einen Moment :)."
"In the following step your data will be processed with the parameters you provided"
"in the previous steps."
)

SET_RSP_PARAMETERS_TEXT = (
Expand Down
105 changes: 0 additions & 105 deletions src/Physiological/PhysiologicalBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class PhysiologicalBase(param.Parameterized):
estimate_rsp = param.Boolean(default=False)
estimate_rsp_method = param.String(default="peak_trough_mean")
freq_bands = param.Dynamic(default=None)
hardware = param.Selector(
label="Select the Hardware with which you recorded your data",
objects=PHYSIOLOGICAL_HW_OPTIONS,
default="NilsPod",
)
hr_data = None
hrv_types = param.List(default=None)
hrv_index_name = param.Dynamic(default=None)
Expand Down Expand Up @@ -97,106 +92,6 @@ def get_progress(step) -> pn.indicators.Progress:
def set_progress_value(self, step):
self.progress.value = int((step / self.max_steps) * 100)

def select_vp_changed(self, _, event):
self.subject = str(event.new)

def dict_to_column(self):
if self.session == "Single Session" and len(self.subject_time_dict.keys()) > 1:
self.select_vp.options = list(self.subject_time_dict.keys())
self.select_vp.visible = True
self.select_vp.link(
"subject",
callbacks={"value": self.select_vp_changed},
)
self.subject = list(self.subject_time_dict.keys())[0]
self.ready = True
timestamps = []
for subject in self.subject_time_dict.keys():
col = pn.Column()
for condition in self.subject_time_dict[subject].keys():
cond = pn.widgets.TextInput(value=condition)
cond.link(
(subject, condition),
callbacks={"value": self.change_condition_name},
)
btn_remove_phase = pn.widgets.Button(
name="Remove Phase", button_type="danger"
)
btn_remove_phase.link(
(subject, condition),
callbacks={"value": self.remove_btn_click},
)
col.append(pn.Row(cond, btn_remove_phase))
for phase, time in self.subject_time_dict[subject][condition].items():
row = pn.Row()
phase_name_input = pn.widgets.TextInput(value=phase)
phase_name_input.link(
(subject, condition, phase),
callbacks={"value": self.change_phase_name},
)
row.append(phase_name_input)
dt_picker = pn.widgets.DatetimePicker(value=time)
dt_picker.link(
(subject, condition, phase),
callbacks={"value": self.timestamp_changed},
)
row.append(dt_picker)
remove_btn = pn.widgets.Button(name="Remove", button_type="danger")
remove_btn.link(
(subject, condition, phase),
callbacks={"value": self.remove_btn_click},
)
row.append(remove_btn)
col.append(row)
btn_subphase = pn.widgets.Button(
name="Add Subphase", button_type="primary"
)
btn_subphase.link(
(subject, condition),
callbacks={"value": self.add_subphase_btn_click},
)
row = pn.Row(pn.layout.HSpacer(), pn.layout.HSpacer(), btn_subphase)
col.append(row)
btn = pn.widgets.Button(name="Add Phase", button_type="primary")
btn.link(
(subject,),
callbacks={"value": self.add_phase_btn_click},
)
col.append(btn)
timestamps.append((subject, col))
self.times.objects = [pn.Accordion(objects=timestamps)]

def add_phase_btn_click(self, target, _):
new_phase_name = "New Phase"
self.subject_time_dict[target[0]][new_phase_name] = pd.Series(
{"New Subphase": datetime.datetime.now()}
)
active = self.times.objects[0].active
self.dict_to_column()
self.times.objects[0].active = active

def add_subphase_btn_click(self, target, event):
new_phase_name = "New Subphase"
if new_phase_name in list(
self.subject_time_dict[target[0]][target[1]].index.values
):
i = 1
new_phase_name = new_phase_name + " " + str(i)
while new_phase_name in list(
self.subject_time_dict[target[0]][target[1]].index.values
):
i += 1
new_phase_name = new_phase_name + " " + str(i)
self.subject_time_dict[target[0]][target[1]] = pd.concat(
[
self.subject_time_dict[target[0]][target[1]],
pd.Series(data=[datetime.datetime.now()], index=[new_phase_name]),
]
)
active = self.times.objects[0].active
self.dict_to_column()
self.times.objects[0].active = active

def get_outlier_params(self):
if self.skip_outlier_detection:
self.outlier_params = None
Expand Down
4 changes: 3 additions & 1 deletion src/Physiological/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __init__(self, **params):
self.update_step(4)
self.select_timezone.link(self, callbacks={"value": self.timezone_changed})
self.select_hardware.link(self, callbacks={"value": self.hardware_changed})
self._select_hardware = pn.widgets.Select.from_param(self.param.hardware)
self.file_input.link(
self,
callbacks={
Expand Down Expand Up @@ -77,6 +76,9 @@ def timezone_changed(self, _, event):
self.ready = True

def hardware_changed(self, _, event):
if event.new not in self.select_hardware.options:
self.select_hardware.value = self.select_hardware.options[0]
return
self.hardware = event.new
if self.hardware == "NilsPod":
self.file_input.accept = ".csv,.bin, .zip"
Expand Down
Loading

0 comments on commit 339b93a

Please sign in to comment.