Skip to content

Commit

Permalink
refactor: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
adagora committed Dec 1, 2023
1 parent 4cd64b7 commit be3b5d6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 121 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# What are benefits of using solara and why choose solara for next app?

- Define your UI based on the state/data (declarative, like ReactJS)Auto re-executes what is needed (reactive, like Excel)
- Reusability / encapsulation (components)
- you can write new ones using the underlying library (ipyvuetify)
- you can use html/css/js/vue/react to write your own widgets if needed
- Together they make it possible to take on larger projects and don't get stuck.
- it's nice to be able to just call the python functions you want to use instead of going through REST api's etc.

# Install locally

```
pip install -e .
```
Expand All @@ -14,12 +24,10 @@ $ solara run solarathon.pages

[Get your Ploomber API key](https://docs.cloud.ploomber.io/en/latest/quickstart/apikey.html) and set it as `PLOOMBER_CLOUD_KEY` in GitHub (under Settings->Secrets and Variables->Actions, and click "New repository secret")


## Do only once

* [Sign up for Ploomber](https://www.platform.ploomber.io/register/)
* [Get the API key](https://docs.cloud.ploomber.io/en/latest/quickstart/apikey.html) from [The Ploomber dashboard](https://platform.ploomber.io/)

- [Sign up for Ploomber](https://www.platform.ploomber.io/register/)
- [Get the API key](https://docs.cloud.ploomber.io/en/latest/quickstart/apikey.html) from [The Ploomber dashboard](https://platform.ploomber.io/)

```
$ ploomber-cloud key YOURKEY
Expand All @@ -30,18 +38,18 @@ $ git commit -m "ci: set ploomber id"
$ git push origin master:ploomber
```


## Run to deploy a new version

```
$ git push origin master:ploomber
# add --force if needed
```

# Other resources

* [Wanderlust app](https://github.com/widgetti/wanderlust)
* [Solara website](https://github.com/widgetti/solara/tree/master/solara/website)
* [Solara examples](https://solara.dev/examples)
- [Wanderlust app](https://github.com/widgetti/wanderlust)
- [Solara website](https://github.com/widgetti/solara/tree/master/solara/website)
- [Solara examples](https://solara.dev/examples)

# Deploy manually

Expand Down
26 changes: 5 additions & 21 deletions solarathon/pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,14 @@
@solara.component
def Page():
with solara.Column(style={"padding-top": "30px"}):
solara.Title("Solarathon example project")
# Calculate word_count within the component to ensure re-execution when reactive variables change.
word_count = len(sentence.value.split())
solara.Title("Solarathon Hackathon Team 4")
solara.Markdown(r'''
# Welcome to the Solarathon Hackathon!
solara.SliderInt("Word limit", value=word_limit, min=2, max=20)
solara.InputText(label="Your sentence", value=sentence, continuous_update=True)

# Display messages based on the current word count and word limit.
if word_count >= int(word_limit.value):
solara.Error(
f"With {word_count} words, you passed the word limit of {word_limit.value}."
)
elif word_count >= int(0.8 * word_limit.value):
solara.Warning(
f"With {word_count} words, you are close to the word limit of {word_limit.value}."
)
else:
solara.Success("Great short writing!")

solara.Markdown(
"*First exercise*: remove this text and write your own sentence."
## Application can be used for research and making financial decisions
'''
)


@solara.component
def Layout(children):
# this is the default layout, but you can override it here, for instance some extra padding
Expand Down
68 changes: 0 additions & 68 deletions solarathon/pages/chat.py

This file was deleted.

15 changes: 0 additions & 15 deletions solarathon/pages/clickbutton.py

This file was deleted.

9 changes: 0 additions & 9 deletions solarathon/pages/settings.py

This file was deleted.

0 comments on commit be3b5d6

Please sign in to comment.