Skip to content

Commit e6fa6bd

Browse files
authored
Merge pull request #1 from posit-dev/TPTM-bug-fixes
Bug fixes for Shiny for Python Exercises
2 parents ca28664 + d253d4c commit e6fa6bd

File tree

18 files changed

+25
-27
lines changed

18 files changed

+25
-27
lines changed

apps/problem-sets/2-basic-ui/2.3-cards-switch/app-solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ui.card_header("Model Metrics")
2222

2323
@render_plotly
24-
def metric():
24+
def metric_plot():
2525
account_subset = df[df["account"] == input.account()]
2626
if input.metric() == "ROC Curve":
2727
return plot_auc_curve(account_subset, "is_electronics", "training_score")

apps/problem-sets/2-basic-ui/2.4-layout-columns/app-solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
ui.card_header("Model Metrics")
2626

2727
@render_plotly
28-
def metric():
28+
def metric_plot():
2929
account_subset = df[df["account"] == input.account()]
3030
if input.metric() == "ROC Curve":
3131
return plot_auc_curve(

apps/problem-sets/2-basic-ui/2.4-layout-columns/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
ui.card_header("Model Metrics")
2121

2222
@render_plotly
23-
def metric():
23+
def metric_plot():
2424
account_subset = df[df["account"] == input.account()]
2525
if input.metric() == "ROC Curve":
2626
return plot_auc_curve(account_subset, "is_electronics", "training_score")

apps/problem-sets/3-reactivity/3.1-reactive-calc/app-solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def account_data():
3333
ui.card_header("Model Metrics")
3434

3535
@render_plotly
36-
def metric():
36+
def metric_plot():
3737
# `account_data` is called similar to an input.
3838
if input.metric() == "ROC Curve":
3939
return plot_auc_curve(

apps/problem-sets/3-reactivity/3.1-reactive-calc/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
ui.card_header("Model Metrics")
2424

2525
@render_plotly
26-
def metric():
26+
def metric_plot():
2727
account_subset = df[df["account"] == input.account()]
2828
if input.metric() == "ROC Curve":
2929
return plot_auc_curve(

apps/problem-sets/3-reactivity/3.2-stacking-reactives/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ We have a second sidebar input which allows the user to filter the dataset by th
22
Add a second reactive calculation to the app which filters the `account_data()` reactive.
33

44
For reference `input.chars()` returns a tuple with the lower and upper range of a value, and you can filter the data frame with:
5-
`df[df["text"].str.len().between(*input.chars()]`.
5+
`df[df["text"].str.len().between(*input.chars())]`.

apps/problem-sets/3-reactivity/3.2-stacking-reactives/app-solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def character_filter():
4545
ui.card_header("Model Metrics")
4646

4747
@render_plotly
48-
def metric():
48+
def metric_plot():
4949
if input.metric() == "ROC Curve":
5050
return plot_auc_curve(
5151
character_filter(), "is_electronics", "training_score"

apps/problem-sets/3-reactivity/3.2-stacking-reactives/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def account_data():
3737
ui.card_header("Model Metrics")
3838

3939
@render_plotly
40-
def metric():
40+
def metric_plot():
4141
if input.metric() == "ROC Curve":
4242
return plot_auc_curve(account_data, "is_electronics", "training_score")
4343
else:

apps/problem-sets/4-dynamic-ui/4.1-render-express/app-solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def sub_selector():
5454
ui.card_header("Model Metrics")
5555

5656
@render_plotly
57-
def metric():
57+
def metric_plot():
5858
if input.metric() == "ROC Curve":
5959
return plot_auc_curve(
6060
character_filter(), "is_electronics", "training_score"

apps/problem-sets/4-dynamic-ui/4.1-render-express/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def character_filter():
4242
ui.card_header("Model Metrics")
4343

4444
@render_plotly
45-
def metric():
45+
def metric_plot():
4646
if input.metric() == "ROC Curve":
4747
return plot_auc_curve(
4848
character_filter(), "is_electronics", "training_score"

0 commit comments

Comments
 (0)