Skip to content

Commit

Permalink
Panel Version auf 1.3.6 hochgezogen, texte verbessert, unnötige Komme…
Browse files Browse the repository at this point in the history
…ntare entfernt.
  • Loading branch information
shMeske committed Jan 4, 2024
1 parent 339b93a commit bde6bf9
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 90 deletions.
3 changes: 1 addition & 2 deletions convert_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
MAIN_FILE = "main.py"
IGNORE_FOLDERS = ["build", "dist", "pyodide", "pyscript", "Miscellaneous"]
files_added = []

changed_imports = (
" const env_spec = ['https://cdn.holoviz.org/panel/wheels/bokeh-3.2.2-py3-none-any.whl', "
"'https://cdn.holoviz.org/panel/1.3.2/dist/wheels/panel-1.3.2-py3-none-any.whl', "
"'https://cdn.holoviz.org/panel/1.3.6/dist/wheels/panel-1.3.6-py3-none-any.whl', "
"'pyodide-http==0.2.1', "
"'https://raw.githubusercontent.com/mad-lab-fau/biopsykit-dashboard/development/assets/WheelFiles/docopt-0.6.2-py2.py3-none-any.whl', "
"'https://raw.githubusercontent.com/mad-lab-fau/biopsykit-dashboard/development/assets/WheelFiles/littleutils-0.2.2-py3-none-any.whl', "
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

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

63 changes: 38 additions & 25 deletions src/Physiological/PHYSIOLOGICAL_CONSTANTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,60 @@
EDR_TYPES = ["peak_trough_mean", "peak_trough_diff", "peak_peak_interval"]

SESSION_TEXT = (
"# Number of Sessions \n"
"# Number of Sessions \n\n"
"In this step you can define if your data consists of a single Session or multiple Sessions. \n\n"
"In this context a single Session is defined that only one Sensor is used, "
"while multiple Sessions describe that two or more sensors are used. \n"
)

SIGNAL_TYPE_TEXT = (
"# Selecting Physiological Signal Type \n"
"# Selecting Physiological Signal Type \n\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 "
"of available sheets."
)

SELECT_FREQUENCY_TEXT = (
"# Set Frequency Bands"
"# Set Frequency Bands\n\n"
"In this step you can set the frequency bands for the analysis. "
"The default values are the standard frequency bands for EEG analysis. "
"You can change the values by clicking on the text field and entering the desired value. "
"The values are in Hz."
)

RECORDINGS_TEXT = (
"# Number of Recordings \n"
"# Number of Recordings \n\n"
"After you defined the kind of Sessions, in this step you will set if your data"
"consists of a single Recording or multiple recordings.\n\n"
"A single Recording means, that you only have one file per subject and multiple Recording"
"is defined as two or more files per subject. \n"
)
PROCESSING_PREVIEW_TEXT = (
"# Preview of the Results \n \n"
"# Preview of the Results \n\n"
"Below you can find a short summary of the analyzed data "
"(Preview of the Dataframe, and several statistical values)."
)
PROCESS_HRV_TEXT = (
"# Processing HRV \n \n"
"# Processing HRV \n\n"
"If you want to additionally process the Heart Rate variability, "
"you can select the matching parameters and then hit the "
"process button, and then proceed. Otherwise, you can skip "
"this step and go to the next stage. "
)
ASK_PROCESS_HRV_TEXT = (
"# Processing HRV \n \n"
"# Processing HRV \n\n"
"If you want to additionally process the Heart Rate variability, "
"you can select the matching parameters and then "
"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? \n"
"# Do you want to check for outliers? \n\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"
Expand Down Expand Up @@ -103,49 +104,61 @@
)

FILE_UPLOAD_TEXT = (
"# Upload your session File \n"
"# Upload your session File \n\n"
"## The supported File formats are .bin, .csv you can also upload Folders,"
"but these have to be zipped before.\n"
"You also have to select the Hardware you used to record your data. For that you may choose between"
"Biopac and Nilspod.\n"
"After your upload your file will also be checked if it contains the necessary columns.\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."
"# Download Result \n\n"
"You can download the result of the analysis here. Click on the button below to download the result. "
"After that it may take a while until the Download is finished. \n"
"The result will be downloaded as a .zip file. \n"
"In this .zip File you will find an Excel File for the different kinds of analysis you selected. \n"
)
DATA_ARRIVED_TEXT = (
"# Files uploaded successfully \n"
"Below is a short summary of the files which you uploaded."
"# Files uploaded successfully \n\n"
"Below is a short summary of the files which you uploaded, you may take a look over the table below"
"to verify that you uploaded the correct File. \n"
"These files can be further analysed in the following steps."
)

COMPRESS_FILES_TEXT = (
"# Compress your Files\n"
"# Compress your Files \n\n"
"Because you selected, that you want to analyse more than one File,"
"you have to compress the content of your Folder into one .zip File.\n"
"Please do that before proceeding to the next step.\n"
)

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."
"# Add Phases \n\n"
"In this step you can add Phases for your data. Since this is an optional step, you can skip "
'this by clicking "Skip". Otherwise you can upload an Excel File with your Phases in the following '
"step or add the phases manually. \n"
)
ADD_TIMES_TEXT = (
"# Select Times\n"
"# Add Phases \n\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"
"You can either upload an Excel File or you can manually add "
"Phases for the different subjects.\n"
"If you want to upload an Excel File, you can do that by clicking on the button below, which says "
'"Choose File". \n'
'Otherwise you can add the Phases manually by clicking on the button below, which says "Add Phases". '
"After that you can add subphases and set their time intervals\n"
)

PRESTEP_PROCESSING_TEXT = (
"# Processing \n"
"# Processing \n\n"
"In the following step your data will be processed with the parameters you provided"
"in the previous steps."
"in the previous steps, this might take a moment."
)

SET_RSP_PARAMETERS_TEXT = (
"# RSP Parameters\n"
"# RSP Parameters \n\n"
"Here you can set the different parameters for the RSP analysis. You may select if the data is "
"a Raw respiration signal or if it has to be estimated by the ECG. \n"
"You ma also choose the method used to estimate the respiration signal from the ECG. \n"
"You may also choose the method used to estimate the respiration signal from the ECG. \n"
)
56 changes: 42 additions & 14 deletions src/Questionnaire/QUESTIONNAIRE_CONSTANTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

ASK_TO_SET_LOADING_PARAMETERS_TEXT = (
"# Loading Parameters \n\n "
"If you want to explicitly set loading parameters such as:"
' the Subject column, Condition column, etc. you can do so by clicking on the "'
'Set Loading Parameters" button. '
"If you want to explicitly set loading parameters such as: "
"the Subject column, Condition column, etc. you can do so by clicking on the "
'"Set Loading Parameters" button. '
"This will take you to an additional step where you can set the loading parameters. "
'Otherwise, click on "Default".'
)

LOAD_QUESTIONNAIRE_DATA_TEXT = (
"# Set Loading Parameters \n\n"
"Here you can set the loading parameters for your Questionnaire Data. "
"In this step you may set the loading parameters which will be used . "
)

LOADING_DATA_TEXT = (
Expand All @@ -22,7 +22,7 @@
)

SUGGEST_QUESTIONNAIRE_SCORES_TEXT = (
"# Select Scores to Calculate\n\n"
"# Select Scores to Calculate \n\n"
"In this step you may select the scores you want to calculate. "
"You may add the Questionnaire you want to be analyzed "
"(e.g. Perceived Stress Scale) as well as the pattern "
Expand All @@ -31,7 +31,7 @@
)

CHECK_SELECTED_QUESTIONNAIRES_TEXT = (
"# Check selected questionnaires\n\n"
"# Check selected questionnaires \n\n"
"In this step you may check the selected questionnaires "
"and the corresponding columns. If you want to check them "
'press the "Check Questionnaires" button. '
Expand All @@ -45,20 +45,45 @@
'click on the "Yes" button. Otherwise, click on the "No" button to proceed.'
)

CONVERT_SCALES_TEXT = "# Convert Scales"
CONVERT_SCALES_TEXT = (
"# Convert Scales \n\n"
"In this step you can convert the scales of your data. You can either "
"convert the score range of the selected questionnaires or alternatively just for "
"the selected columns. "
)

ASK_TO_CROP_SCALE_TEXT = "# Would you like to crop the scale(s) of your data?"
ASK_TO_CROP_SCALE_TEXT = (
"# Would you like to crop the scale(s) of your data? \n\n"
"If you want to crop the scale(s) of your data, i.e., "
"set values out of range to specific minimum and maximum values or to NaN. "
)

CROP_SCALES_TEXT = (
"# Crop scales\n\n"
"Crop questionnaire scales, i.e., set values out of range to specific minimum and maximum values or to NaN."
"In this step you can crop the scales of your data. You can set the range of the scores below in "
"the array input. Please be sure that you enter the data like this: [firstValue, secondValue, etc.]. "
"You can also click on the checkbox to set the values out of range to NaN. "
)

ASK_TO_INVERT_SCORES_TEXT = "# Do you want to invert the scores of selected column(s) ?"
ASK_TO_INVERT_SCORES_TEXT = (
"# Do you want to invert the scores of selected column(s)?\n\n"
"In many questionnaires some items need to be inverted (reversed) before sum scores can be computed. "
"You can either skip this step or invert the scores of the selected columns in the following step."
)

INVERT_SCORES_TEXT = "# Invert Scores"
INVERT_SCORES_TEXT = (
"# Invert Scores \n\n"
"In this step you can invert the scores of your data. You can set the range of the scores "
"below in the Array Input. Please be sure that you enter the data like this: [firstValue, secondValue, etc.]. You can "
"also select just specific columns to invert the scores. "
)

SHOW_RESULTS_TEXT = "# Show Results"
SHOW_RESULTS_TEXT = (
"# Show Results \n\n"
"In this step you can see the results of your data. If you want to change the format of your dataframes from the "
"wide Format to the long Format you can do so by clicking on the next button on the top right. "
'Otherwise, you can download the results by clicking on the "Download" button below the Datatable.'
)

ASK_TO_CHANGE_FORMAT_TEXT = (
"# Do you want to change the format of your Dataframes? \n "
Expand All @@ -68,9 +93,12 @@

CHANGE_FORMAT_TEXT = (
"# Convert from wide to long format \n "
"In this step you can change the format of the dataframe(s) of your questionnaire(s).\n"
"In the wide-format dataframe, the index levels to be converted into long-format are expected to be encoded in the "
"column names and separated by `_`. If multiple levels should be converted into long-format, e.g., for a "
"questionnaire with subscales (level `subscale`) that was assessed pre and post (level `time`), then the different "
"levels are all encoded into the string. The level order is specified by ``levels``."
"Below you can select from the questionnaire(s) of the provided data in order to change the format."
' However only those questionnaire(s) which include column(s) that contain the symbol "_" are shown.'
)

DOWNLOAD_RESULTS_TEXT = "# Results"
DOWNLOAD_RESULTS_TEXT = "# Results \n\n Here you can download the results of your data. Just click on the button below."
14 changes: 7 additions & 7 deletions src/Questionnaire/show_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ class ShowResults(QuestionnaireBase):
)
questionnaire_results_Column = pn.Column()

def __init__(self, **params):
params["HEADER_TEXT"] = SHOW_RESULTS_TEXT
super().__init__(**params)
self.update_step(7)
self.update_text(SHOW_RESULTS_TEXT)
self._view = pn.Column(self.header, self.questionnaire_results_Column)

def show_questionnaire_results(self) -> pn.Accordion:
acc = pn.Accordion(sizing_mode="stretch_width")
supported_questionnaires = (
Expand Down Expand Up @@ -49,13 +56,6 @@ def show_questionnaire_results(self) -> pn.Accordion:
)
return acc

def __init__(self, **params):
params["HEADER_TEXT"] = SHOW_RESULTS_TEXT
super().__init__(**params)
self.update_step(7)
self.update_text(SHOW_RESULTS_TEXT)
self._view = pn.Column(self.header, self.questionnaire_results_Column)

def panel(self):
if self.data_scaled is None:
self.data_scaled = self.data.copy()
Expand Down
48 changes: 37 additions & 11 deletions src/Saliva/SALIVA_CONSTANTS.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
SALIVA_MAX_STEPS = 4

ASK_FOR_FORMAT_TEXT = "# Choose the format your data is stored in"
ASK_TO_LOAD_CONDITION_LIST_TEXT = "# Do you want to add a condition list?"
ADD_CONDITION_LIST_TEXT = "# Add a condition list"
ASK_TO_SET_SAMPLE_TIMES_TEXT = "# Do you want to set sample times?"
SET_SAMPLE_TIMES_TEXT = "# Set sample times"
LOAD_PLATE_DATA_TEXT = (
"# Upload Saliva Data \n Here you can upload the saliva data. "
"In the following steps you can analyze the data and then download the results."
)
SHOW_FEATURES_TEXT = "# Show Features"
ASK_TO_EXCLUDE_SUBJECTS_TEXT = "# Do you want to exclude subjects?"
ASK_FOR_FORMAT_TEXT = (
"# Select the format \n\n "
'Here you can select the format of the saliva data. You can choose between the "Wide Format" and '
'the "Plate Format". '
)

ASK_TO_SET_SAMPLE_TIMES_TEXT = (
"# Set sample times \n\n"
'If you want to set sample times, click on the "Yes" button. Otherwise, click on the "No" button. '
"You can set the sample times in the next step. "
)
SET_SAMPLE_TIMES_TEXT = (
"# Set sample times \n\n"
"In this step you can set the sample times. For that you have to enter the sample times in the"
"Box below like this: [-30,10,30,60]. The sample times have to be separated by commas and sourrounded by square brackets."
)
ASK_TO_LOAD_CONDITION_LIST_TEXT = (
"# Add a condition list \n\n"
'If you want to add a condition list, click on the "Yes" button. Otherwise click on the "No" button. '
)
ADD_CONDITION_LIST_TEXT = (
"# Add a condition list \n\n "
"Below you can upload a condition list. This file has to be a .csv file or an "
"Excel file."
)

LOAD_SALIVA_DATA_TEXT = (
"# Upload Saliva Data \n\n "
"Here you can upload the saliva data. The Data has to be a .csv file or an Excel file. After uploading the data you "
"can add different parameters necessary to parse the uploaded data. "
)

SHOW_FEATURES_TEXT = (
"# Show Features \n\n "
"Here you can see the features of the saliva data. To download the results click on the "
"type of result you want to download and click on the download button below the datatable."
)
6 changes: 3 additions & 3 deletions src/Saliva/load_saliva_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import panel as pn
import param

from src.Saliva.SALIVA_CONSTANTS import LOAD_PLATE_DATA_TEXT
from src.Saliva.SALIVA_CONSTANTS import LOAD_SALIVA_DATA_TEXT
from src.Saliva.SalivaBase import SalivaBase
from src.utils import load_saliva_plate, load_saliva_wide_format

Expand Down Expand Up @@ -71,10 +71,10 @@ class LoadSalivaData(SalivaBase):
)

def __init__(self, **params):
params["HEADER_TEXT"] = LOAD_PLATE_DATA_TEXT
params["HEADER_TEXT"] = LOAD_SALIVA_DATA_TEXT
super().__init__(**params)
self.update_step(3)
self.update_text(LOAD_PLATE_DATA_TEXT)
self.update_text(LOAD_SALIVA_DATA_TEXT)
self.filename = None
self.select_saliva.link(self, callbacks={"value": self.saliva_type_changed})
self.upload_btn.link(self, callbacks={"filename": self.filename_changed})
Expand Down
Loading

0 comments on commit bde6bf9

Please sign in to comment.