Skip to content

Commit

Permalink
feat: Support python 3.10 runtime in apps
Browse files Browse the repository at this point in the history
Fixes: #125
  • Loading branch information
VijithaEkanayake committed Feb 14, 2024
1 parent 97f4ed8 commit 4ad2482
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion churn-risk/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.churn-risk"
Version = "1.1.0"
Version = "1.2.0"
Title = "Telco Churn Risk"
Description = "Demo to predict churn risk of telco customers and display top reason codes."
LongDescription = "about.md"
Expand Down
4 changes: 2 additions & 2 deletions churn-risk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pandas==1.1.0
pygments==2.7.1
pandas==1.4.0
Pygments==2.15.0
h2o-wave<1.0
h2o-wave-ml>=0.7.0
https://h2o-release.s3.amazonaws.com/h2o/rel-zizler/7/Python/h2o-3.34.0.7-py2.py3-none-any.whl
Expand Down
2 changes: 1 addition & 1 deletion credit-risk/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.credit-risk"
Version = "1.1.0"
Version = "1.2.0"
Title = "Credit Card Risk"
Description = "Demo for business users to review and update model predictions."
LongDescription = "about.md"
Expand Down
6 changes: 3 additions & 3 deletions credit-risk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
numpy==1.19.1
pandas==1.1.0
numpy==1.21.0
pandas==1.4.0
plotly==4.10.0
pygments==2.7.1
pygments==2.15.0
h2o-wave<1.0
h2o-wave-ml>=0.7.0
requests
Expand Down
2 changes: 1 addition & 1 deletion credit-risk/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def render_customer_page(q: Q):
)

# summary
top_feature = contribs.idxmin(axis=1) if approve else contribs.idxmax(axis=1)
top_feature = contribs.idxmin(axis=0) if approve else contribs.idxmax(axis=0)
explanation_data = {
'will_or_will_not': 'will' if approve else 'will not',
'top_contributing_feature': top_feature,
Expand Down
2 changes: 1 addition & 1 deletion explaining-ratings/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.explaining-ratings"
Version = "1.1.0"
Version = "1.2.0"
Title = "Explainable Hotel Ratings"
Description = "Demo to visually explore and compare predictions from text data."
LongDescription = "about.md"
Expand Down
2 changes: 1 addition & 1 deletion explaining-ratings/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandas==1.1.0
pandas==1.4.0
h2o-wave<1.0
matplotlib
wordcloud
2 changes: 1 addition & 1 deletion guess-the-number/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.h2o-guess-the-number"
Version = "1.1.0"
Version = "1.2.0"
Title = "Guess the Number"
Description = "Prove you’re smarter than AI with this simple game."
LongDescription = "about.md"
Expand Down
22 changes: 11 additions & 11 deletions guess-the-number/guess_the_number/guess.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,24 +357,24 @@ async def client_initialize(q: Q):


async def theme_switch_handler(q: Q):
q.client.active_theme = 'h2o-dark' if q.args.toggle_theme else 'default'
q.client.active_theme = 'h2o-dark' if 'toggle_theme' in q.args.data and q.args.data['toggle_theme'] else 'default'
q.page['meta'].theme = q.client.active_theme
await q.page.save()


async def run_app(q: Q):
if q.args.start_game:
if q.args.submit_game:
if 'start_game' in q.args.data and q.args.data['start_game']:
if 'submit_game' in q.args.data and q.args.data['submit_game']:
q.client.game.is_public = True
q.app.games[q.client.game.game_id] = q.client.game
del q.page['leaderboard']
del q.page['hello']
await start_new_game(q)
elif q.args.quit_game:
elif 'quit_game' in q.args.data and q.args.data['quit_game']:
del q.page['starting_game']
await make_welcome_card(q)
elif q.args.guess:
message = q.client.game.guess(q.args.guess)
elif 'guess' in q.args.data and q.args.data['guess']:
message = q.client.game.guess(q.args.data['guess'])
if message == 'You Got It!':
q.page['starting_game'].items = [
ui.text_l(
Expand Down Expand Up @@ -421,7 +421,7 @@ async def run_app(q: Q):
label='your guess',
min=1,
max=100,
value=q.args.guess,
value=q.args.data['guess'] if 'guess' in q.args.data else "",
trigger=True,
),
ui.text_xs('⠀'),
Expand All @@ -430,16 +430,16 @@ async def run_app(q: Q):
justify='center',
),
]
elif q.args.leaderboard:
if q.args.submit_game:
elif 'leaderboard' in q.args.data and q.args.data['leaderboard']:
if 'submit_game' in q.args.data and q.args.data['submit_game']:
q.client.game.is_public = True
q.app.games[q.client.game.game_id] = q.client.game
del q.page['starting_game']
await show_leaderboard(q)
elif q.args.private_leaderboard:
elif 'private_leaderboard' in q.args.data and q.args.data['private_leaderboard']:
await show_private_leaderboard(q)

if q.args.toggle_theme is not None:
if 'toggle_theme' in q.args.data and q.args.data['toggle_theme'] is not None:
await theme_switch_handler(q)
await q.page.save()

Expand Down
22 changes: 11 additions & 11 deletions guess-the-number/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
certifi==2020.12.5; python_version >= "3.6" and python_full_version >= "3.6.1"
click==7.1.2; python_full_version >= "3.6.1"
h11==0.11.0; python_version >= "3.6" and python_full_version >= "3.6.1"
certifi==2020.12.5
click==7.1.2
h11==0.11.0
h2o-wave<1.0
httpcore==0.12.2; python_version >= "3.6" and python_full_version >= "3.6.1"
httpx==0.16.1; python_version >= "3.6" and python_full_version >= "3.6.1"
idna==2.10; python_version >= "3.6" and python_full_version >= "3.6.1"
rfc3986==1.4.0; python_version >= "3.6" and python_full_version >= "3.6.1"
sniffio==1.2.0; python_version >= "3.6" and python_full_version >= "3.6.1"
starlette==0.13.8; python_version >= "3.6" and python_full_version >= "3.6.1"
typing-extensions==3.7.4.3; python_version < "3.8" and python_full_version >= "3.6.1"
uvicorn==0.12.2; python_full_version >= "3.6.1"
httpcore==0.12.2
httpx==0.16.1
idna==2.10
rfc3986==1.4.0
sniffio==1.2.0
starlette==0.13.8
typing-extensions==3.7.4.3
uvicorn==0.12.2
2 changes: 1 addition & 1 deletion insurance-churn-risk/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.insurance-churn-risk"
Version = "1.1.0"
Version = "1.2.0"
Title = "Home Insurance Churn Risk"
Description = "Demo to predict churn risk of insurance customers and display top factors."
LongDescription = "about.md"
Expand Down
4 changes: 2 additions & 2 deletions insurance-churn-risk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pandas==1.1.0
pygments==2.7.1
pandas==1.4.0
Pygments==2.15.0
h2o-wave<1.0
h2o-wave-ml>=0.6.0
https://h2o-release.s3.amazonaws.com/h2o/rel-zizler/7/Python/h2o-3.34.0.7-py2.py3-none-any.whl
Expand Down
4 changes: 2 additions & 2 deletions sales-forecasting/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ httpcore==0.12.2; python_version >= "3.6" and python_full_version >= "3.6.1"
httpx==0.16.1; python_version >= "3.6" and python_full_version >= "3.6.1"
idna==2.10; python_version >= "3.6" and python_full_version >= "3.6.1"
jmespath==0.10.0; python_version >= "2.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0"
numpy==1.19.4; python_version >= "3.6" and python_full_version >= "3.6.1"
pandas==1.1.4; python_full_version >= "3.6.1"
numpy==1.21.0; python_version >= "3.6" and python_full_version >= "3.6.1"
pandas==1.4.0; python_version >= "3.6" and python_full_version >= "3.6.1"
python-dateutil==2.8.1; python_full_version >= "3.6.1"
pytz==2020.4; python_full_version >= "3.6.1"
rfc3986==1.4.0; python_version >= "3.6" and python_full_version >= "3.6.1"
Expand Down
2 changes: 1 addition & 1 deletion shopping-cart-recommendations/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.shopping-cart-recommendations"
Version = "1.1.0"
Version = "1.2.0"
Title = "Shopping Cart Recommendations"
Description = "Demo of a recommendation engine on groceries items."
LongDescription="about.md"
Expand Down
2 changes: 1 addition & 1 deletion shopping-cart-recommendations/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
h2o-wave<1.0
pandas==1.1.4
pandas==1.4.0
2 changes: 1 addition & 1 deletion template-explore-binary-classification/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
h2o_wave==0.20.0
toml==0.10.2
loguru==0.6.0
pandas==1.4.1
pandas==1.4.0
matplotlib==3.5.1
2 changes: 1 addition & 1 deletion twitter-sentiment/app.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name = "ai.h2o.wave.twitter-sentiment"
Version = "1.1.0"
Version = "1.2.0"
Title = "Twitter Sentiment"
Description = "Search keywords on twitter and see the sentiments of the latest tweets."
LongDescription="about.md"
Expand Down

0 comments on commit 4ad2482

Please sign in to comment.