Skip to content

Commit

Permalink
more lenient build
Browse files Browse the repository at this point in the history
  • Loading branch information
eroell committed Oct 10, 2024
1 parent de76662 commit f550dd3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ build:
sphinx:
configuration: docs/conf.py
# disable this for more lenient docs builds
fail_on_warning: true
fail_on_warning: false
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ changelog.md
contributing.md
references.md
notebooks/tutorial_omop_visualization
notebooks/omop_tables_tutorial
notebooks/tutorial_ehrdata_omop
notebooks/cohort_definition
Expand Down
30 changes: 12 additions & 18 deletions docs/notebooks/tutorial_omop_visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,21 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"options = [\"person\", \"observation_period\", \"visit_occurrence\", \"condition_occurrence\"]\n",
"\n",
"ui_obs, selected_obs = create_single_option_widget(\n",
" title_text=\"Please select which table should be used for OBS indexing:\",\n",
" title_text=\"Please select which table should be used for .obs indexing in ehrdata:\",\n",
" options=options,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -113,7 +113,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -136,7 +136,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -152,15 +152,14 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data...\n",
"Download successful. ZIP file downloaded and extracted successfully to ehrapy_data/mimic-iv-demo-data-in-the-omop-common-data-model-0.9.\n",
"Path to data exists, load tables from there: ehrapy_data/mimic-iv-demo-data-in-the-omop-common-data-model-0.9\n",
"missing tables: [['concept'], ['vocabulary'], ['domain'], ['concept_class'], ['concept_relationship'], ['relationship'], ['concept_synonym'], ['concept_ancestor'], ['source_to_concept_map'], ['drug_strength']]\n"
]
}
Expand All @@ -178,7 +177,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -349,7 +348,7 @@
"26 visit_occurrence"
]
},
"execution_count": 10,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -359,25 +358,20 @@
"tables"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b3e8a5d0a3c248eda05be45114a845e2",
"model_id": "1b7fb1527a044731a59a24407f62ba7a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HTML(value='<h3>Please select which table should be used for OBS indexing:</h3>'), RadioButtons…"
"VBox(children=(HTML(value='<h3>Please select which table should be used for .obs indexing in ehrdata:</h3>'), …"
]
},
"metadata": {},
Expand Down
48 changes: 48 additions & 0 deletions docs/notebooks/widgets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import ipywidgets as widgets


def create_single_option_widget(title_text: str, options: list[str]):
"""Create a single-option selection widget (RadioButtons).
Args:
title_text (str): The title displayed above the radio buttons.
options (list[str]): List of strings representing the radio button options.
default_value (str): The default selected value.
Returns
-------
tuple: A VBox containing the UI elements and the RadioButtons widget.
"""
title = widgets.HTML(f"<h3>{title_text}</h3>")
default_value = options[0]
radio_buttons = widgets.RadioButtons(options=options, value=default_value, layout=widgets.Layout(width="auto"))
ui = widgets.VBox([title, radio_buttons])

return ui, radio_buttons


def create_multiple_options_widget(title_text: str, options: list[str]):
"""Create a multiple-option selection widget (SelectMultiple).
Args:
title_text (str): The title displayed above the selection box.
options (list[str]): List of strings representing the options.
Returns
-------
tuple: A VBox containing the UI elements and the SelectMultiple widget.
"""
title = widgets.HTML(f"<h3 style='color: #333; font-family: Arial, sans-serif;'>{title_text}</h3>")

height = f"{min(30 * len(options), 300)}px"

select_multiple = widgets.SelectMultiple(
options=options, value=(options[0],), layout=widgets.Layout(width="100%", height=height, font_family="Arial")
)

ui = widgets.VBox(
[title, select_multiple],
layout=widgets.Layout(padding="10px", border="1px solid #ddd", border_radius="5px", width="50%"),
)

return ui, select_multiple

0 comments on commit f550dd3

Please sign in to comment.