Skip to content

Commit

Permalink
chore(fix): fix codespell issues
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed May 31, 2022
1 parent a66127c commit 1696a9a
Show file tree
Hide file tree
Showing 28 changed files with 44 additions and 43 deletions.
1 change: 1 addition & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[codespell]
skip = **/package-lock.json,*.vti,PKG-INFO,**/dist/**
ignore-words-list = hist
ignore-regex = name="ba"
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ Read-only:
- **trame__busy**: Provide information if we have pending request waiting
for the server to respond.
- **tts**: Template Time Stamp to regenerate sub elements when a template
get's updated. Usually used as `:key="tts"` to force some component
rebuild.
gets updated. Usually used as `:key="tts"` to force some component
rebuild.
4 changes: 2 additions & 2 deletions docs/content/docs/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from trame.app import get_server # Entry point to trame
from trame.ui.vuetify import SinglePageLayout # UI layout
from trame.widgets import vuetify, vtk # UI widgets

server = get_server() # Create/retreive default server
server = get_server() # Create/retrieve default server
state, ctrl = server.state, server.controller # Extract server state and controller

# Reset resolution variable to 6
Expand Down Expand Up @@ -119,7 +119,7 @@ vuetify.VTextField(value=("'Hello' + var_name", ))

Method can be passed to events attribute of your UI elements. By default, the function will be called with no arguments.

If you want to control its arguments you can use a tuple where the second entry represents the __args__ and the third represents the __kwargs__. If you only want to provide args without kwargs, just provide a tuple with 2 entries. __$event__ is a reserved name to reprensent the event object.
If you want to control its arguments you can use a tuple where the second entry represents the __args__ and the third represents the __kwargs__. If you only want to provide args without kwargs, just provide a tuple with 2 entries. __$event__ is a reserved name to represent the event object.

```python
vuetify.VBtn("Click me", click=ctrl.do_something))
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def slider_value_change(slider_value, **kwargs):
print(f"Slider is changing slider_value to {slider_value}")
```

So far, we only have the client modifing that variable. But if a function on the server were to change that variable, that function will also be called as we simply react to the fact that the variable has been updated by someone.
So far, we only have the client modifying that variable. But if a function on the server were to change that variable, that function will also be called as we simply react to the fact that the variable has been updated by someone.

### Changing the value from Python

Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ There are variety of tools and frameworks available to you when building web app

Building apps with Trame has never been that simpple

1. **Install trame** - Create a Python virtual environment and `pip install trame`. Once working locally, deploy it using Docker or as Dektop app bundle.
1. **Install trame** - Create a Python virtual environment and `pip install trame`. Once working locally, deploy it using Docker or as Desktop app bundle.
2. **Business logic** - Create your processing functions in plain Python and the **state** that needs to be shared with the UI.
3. **State reactivity** - Connect any method to react to state change (i.e. slider changing a sampling parameter)
4. **Design your UI** - Build beautiful, accessible user interfaces by defining the layout of your application and connecting your **state** and **functions** to your UI elements directly.
5. **Run it anywhere** - Once working, you can choose to run it locally as a desktop application, as a client/server or deploy it in the cloud and use it as a service.

![trame](/trame/images/trame-architecture.jpg)

At the end of the day, building a trame application is just a matter of orchestrating the various pieces in a convinient and transparent manner thanks to trame shared state and controller for dealing with event management.
At the end of the day, building a trame application is just a matter of orchestrating the various pieces in a convenient and transparent manner thanks to trame shared state and controller for dealing with event management.

## Getting started

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/module-deckgl.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ deck2 = pdk.Deck(**pydeck_parameters_2) # make a change
deckgl_options = {
"mapboxApiKey": ..., # api token for mapbox layer
"tooltip": False, # whether to show tooltip
"customLibraries": ..., # deckgl add ons
"customLibraries": ..., # deckgl add-ons
}

# Method 1 ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/module-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Inside trame it might be useful to use markdown to simplify the writing of long

## How to use it?

trame supports an extended version of markdown for formatting documents, drawing diagrams, and more. Since Markdown could contains caracters that can conflict with the HTML syntax, a variable must be used to pass the markdown content to the UI component like in the snippet below.
trame supports an extended version of markdown for formatting documents, drawing diagrams, and more. Since Markdown could contains characters that can conflict with the HTML syntax, a variable must be used to pass the markdown content to the UI component like in the snippet below.

```python
from trame.html import markdown
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/module-paraview.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ The `namespace` will also be used as `ref=` unless provided by the user.

#### Mode parameter

The mode is driven by the variable `{namespace}Mode` but can be provided when instantiated so the default can be overriden and a JavaScript expression can be used instead of the default variable. This attribute behaves the same way as any trame one except we won't register the left side as a state entry since we already have one under `{namespace}Mode`. This means we will evaluate the left side of the expression assuming a tuple is provided and the right side of the tuple is used to set its inital value.
The mode is driven by the variable `{namespace}Mode` but can be provided when instantiated so the default can be overridden and a JavaScript expression can be used instead of the default variable. This attribute behaves the same way as any trame one except we won't register the left side as a state entry since we already have one under `{namespace}Mode`. This means we will evaluate the left side of the expression assuming a tuple is provided and the right side of the tuple is used to set its initial value.

### Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/module-simput.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ item = simput.SimputItem(

simput.Simput(
item,
ui_manager=..., # Get from seperate simput library
ui_manager=..., # Get from separate simput library
prefix="...", # Identifier for manager if multiple
)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/module-vtk.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ The `namespace` will also be used as `ref=` unless provided by the user.

#### Mode parameter

The mode is driven by the variable `{namespace}Mode` but can be provided when instantiated so the default can be overriden and a JavaScript expression can be used instead of the default variable. This attribute behaves the same way as any trame one except, we won't register the left side as a state entry since we already have one under `{namespace}Mode`. This means we will evaluate the left side of the expression assuming a tuple is provided and the right side of the tuple is used to set its inital value.
The mode is driven by the variable `{namespace}Mode` but can be provided when instantiated so the default can be overridden and a JavaScript expression can be used instead of the default variable. This attribute behaves the same way as any trame one except, we won't register the left side as a state entry since we already have one under `{namespace}Mode`. This means we will evaluate the left side of the expression assuming a tuple is provided and the right side of the tuple is used to set its initial value.

### Examples

Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/trame_v2_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ First of all, Trame v2 is not changing the ideas and concepts that made trame wh

Like shown in the architecture diagram, trame focus on 4 types of services which help the development of interactive visual applications.

- __State__ in trame is shared across the presentation layer and the buisness logic. Also on top of being shared, it is reactive which means that the UI will react to reflect any change done from the buisness logic. Also in the same fashion, when a slider or else modify a given variable, the buisness logic can listen to it and react appropriately. This __state__ make the binding of the **buisness logic** and **UI** a breeze.
- __Events__ are used to trigger actions usually on buisness logic side to react to user interaction such as a mouse click, hover or else. Trame offer an elegent solution for simply binding methods to any available UI event.
- __State__ in trame is shared across the presentation layer and the business logic. Also on top of being shared, it is reactive which means that the UI will react to reflect any change done from the business logic. Also in the same fashion, when a slider or else modify a given variable, the business logic can listen to it and react appropriately. This __state__ make the binding of the **business logic** and **UI** a breeze.
- __Events__ are used to trigger actions usually on business logic side to react to user interaction such as a mouse click, hover or else. Trame offer an elegent solution for simply binding methods to any available UI event.
- __Widgets__ are key for building and composing a graphical application. Trame already provide an extensive set of widgets that include the common set of form elements but also charts, maps and 3D visualization based on VTK/ParaView. Also on top of the built-in ones, it is easy to contribute or include your own set of widget when developing your own application. Basically you are not limited to what we have. Trame can easily integrate any web based component and interface it so you can use it directly within Python.
- __UI__ are mainly the same thing as widgets except they are more geared toward layouts or pages sections that you may want to update dynamically during the life cycle of your application. Usually applications have a single layout component which represent the UI of the application.

Expand All @@ -18,4 +18,4 @@ With trame v2, we are deprecating PyWebVue in favor of our trame suite (trame +

Also now that we have formalized how new Python modules should interface with trame. The community can more simply extend trame with their new widgets and/or UI elements.

Now you might be wondering if a trame v3 is planed with yet another breaking change in another 6 months? Well to be honest we may have released too early pywebvue and trame but they were so game changer that it was hard to keep them for ourself. To be honest, I don't see a v3 anytime soon as v2 has gave us a chance to review our api, fixed what we didn't like and provide an easy path across our various use-cases.
Now you might be wondering if a trame v3 is planned with yet another breaking change in another 6 months? Well to be honest we may have released too early pywebvue and trame but they were so game changer that it was hard to keep them for ourself. To be honest, I don't see a v3 anytime soon as v2 has gave us a chance to review our api, fixed what we didn't like and provide an easy path across our various use-cases.
6 changes: 3 additions & 3 deletions docs/content/docs/tutorial-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ We want to create a drawer with the ***trame*** pipeline widget, a horizontal di

```python
# State use to track active ui card
state.setdefault("active_ui", None) # prevent reseting value if already present
state.setdefault("active_ui", None) # prevent resetting value if already present
```

We want a little wider `drawer`, so we set the width to 325 pixels. Next, we add the ***trame*** pipeline widget using the `pipeline_widget` function. Then, we use a `VDivider` to separate the ***trame*** widget from the pipeline cards. Finally, we add the pipeline cards using the `mesh_card` and `contour_card` functions.
Expand Down Expand Up @@ -386,7 +386,7 @@ def ui_card(title, ui_name):

<p style="text-align:center;"><img src="../images/tutorial-mesh-card.jpg" alt="Mesh Card" style="width: 25%; height: 25%"></p>

The `mesh_card` containes strictly default GUI components of a pipeline. First, a dropdown menu for the visual [representation](#gui_representation-id) type. Next, a row with two columns. One contains a dropdown menu for the array/field to [color by](#gui_color_by-id), and the other a dropdown menu for which [color map](#gui_color_map-id) to use. Finally, a slider to control the [opacity](#gui_opacity-id).
The `mesh_card` contains strictly default GUI components of a pipeline. First, a dropdown menu for the visual [representation](#gui_representation-id) type. Next, a row with two columns. One contains a dropdown menu for the array/field to [color by](#gui_color_by-id), and the other a dropdown menu for which [color map](#gui_color_map-id) to use. Finally, a slider to control the [opacity](#gui_opacity-id).

```python
def mesh_card():
Expand All @@ -408,7 +408,7 @@ def mesh_card():
)
```

Since these are defaul pipeline elements, we will cover these items together with the contour_card individual components [below](#default_components-id).
Since these are default pipeline elements, we will cover these items together with the contour_card individual components [below](#default_components-id).

<div class="print-break"></div>
<a id="contour_card-id"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/tutorial-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Let's modify the Hello ***trame*** application to add some GUI elements by start

<p style="text-align:center;"><img src="../images/tutorial-light.jpg" alt="Light Mode" style="width: 45%; height: 45%"><img src="../images/tutorial-dark.jpg" alt="Dark Mode" style="width: 45%; height: 45%"></p>

So with the `SinglePageLayout`, we could add UI elements to either the `toolbar`, `content`, or the `footer`. We'll limit ourself to the `toolbar`, but the proceedure is still the same. Let us add to the right side of the `toolbar` a switch to toggle between light and dark mode of the application and a button to reset the view after panning and/or zooming.
So with the `SinglePageLayout`, we could add UI elements to either the `toolbar`, `content`, or the `footer`. We'll limit ourself to the `toolbar`, but the procedure is still the same. Let us add to the right side of the `toolbar` a switch to toggle between light and dark mode of the application and a button to reset the view after panning and/or zooming.

<p style="text-align:center;"><img src="../images/tutorial-buttons.jpg" alt="Light Mode" style="max-height: 40px;"></p>

Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/tutorial-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Each of these layouts can be utilized by importing, instantiating, and serving i

## `VAppLayout` or fullscreen

If you want to experiement with it you can edit `02_layouts/app_cone.py` which was the latest cone example we built using the `SinglePage` layout.
If you want to experiment with it you can edit `02_layouts/app_cone.py` which was the latest cone example we built using the `SinglePage` layout.

The `VAppLayout` starts with VApp and exposes the children array where one could add in other desired HTML elements (Vuetify UI Components).

Expand Down Expand Up @@ -59,7 +59,7 @@ python 02_layouts/solution_FullScreenPage.py --port 1234

## `SinglePageLayout`

The `SinglePageLayout` extends the `VAppLayout` with a few predifined components such as *icon*, *title*, *toolbar*, *content*, and *footer*.
The `SinglePageLayout` extends the `VAppLayout` with a few predefined components such as *icon*, *title*, *toolbar*, *content*, and *footer*.

<p style="text-align:center;"><img src="../images/tutorial-singlepage.jpg" alt="SinglePage Layout" style="width: 75%; height: 75%"></p>

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/tutorial-paraview.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ To learn more about ParaView scripting, you should look into ParaView trace whic

## Advanced example

With the basics in place, we can now dive further in by using some built-in features of ParaView, such as saving and loading a state file. State files are a convinient way of capturing all the settings that were used to generate a visualization with Paraview.
With the basics in place, we can now dive further in by using some built-in features of ParaView, such as saving and loading a state file. State files are a convenient way of capturing all the settings that were used to generate a visualization with Paraview.

![Rock Core](https://kitware.github.io/trame/examples/StateViewer-rock.jpg)

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/tutorial-setup-vtk.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ from trame.app import get_server
from trame.ui.vuetify import SinglePageLayout
```

from ***trame***'s `app`, we import the factory function for getting a server instance on which we will bind our UI and buisness logic. We also import a skeleton for a single page client application that rely on vuetify (our main widget library) from `trame.ui.vuetify`.
from ***trame***'s `app`, we import the factory function for getting a server instance on which we will bind our UI and business logic. We also import a skeleton for a single page client application that rely on vuetify (our main widget library) from `trame.ui.vuetify`.

Next, we define the graphical user interface (GUI) by passing the server on which it should be bound to. Then with that layout we update the toolbar's title to hold `"Hello trame"`.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/tutorial-vtk.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Why do we care about *local* and *remote* rendering? Well each method of renderi

- The data to be rendered doesn't move, only the resulting image.
- Rendering can utilize parallel and distributed processing to handle larger and larger data.
- The server can serve a more diverse set of clients. From cell phone to workstation, their requirements are limited to recieving and rendering images.
- The server can serve a more diverse set of clients. From cell phone to workstation, their requirements are limited to receiving and rendering images.

*Disadvantages*

Expand Down
2 changes: 1 addition & 1 deletion examples/00_howdoi/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def decrement():
@state.change("my_number")
def validate_my_number(my_number, **kwargs):
if isinstance(my_number, int):
# Prevent infinit loop
# Prevent infinite loop
return

try:
Expand Down
4 changes: 2 additions & 2 deletions examples/03_markdown/sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ apples
oranges
: Citrus!
tomatoes
: There's no "e" in tomatoe.
: There's no "e" in tomato.

Again, text is indented 4 spaces. (Put a blank line between each
term/definition pair to spread things out more.)
Expand All @@ -154,4 +154,4 @@ math should get its own line and be put in in double-dollarsigns:
$$I = \int \rho R^{2} dV$$

And note that you can backslash-escape any punctuation characters
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.
Loading

0 comments on commit 1696a9a

Please sign in to comment.