Organizing Your Project#

The first thing we need to do is organize our project. Thot uses a tree structure to organize your projects, giving your project different levels. The top level should be the most important grouping to you, becoming less important as you move down the tree.

For this project the most important thing we need to test is which recipe is quieter, so our top level grouping will be the recipes. Unfortunately, testing underwater fireworks happens to be quite expensive, so we will only be able to make two batches for each recipe. The batches will be our second level. This gives us the tree shown below.

Fireworks tree structure

Fig. 14 Project tree for the silent fireworks test.#

Creating a New Project#

Luckily, our researchers have already recorded the data and written the analysis scripts for us, so all we need to do is create a Thot project for our experiments and run the analysis.

Local projects use your file system as a database. We will begin by making a folder for the project. Let’s call it fireworks. One of the main philosophies behind Thot is that data and analysis should be separate. Let’s reflect this in our project by creating a data folder and an analysis folder.

We will build our project tree in two ways. First, we’ll create the tree for Recipe A by hand to get used to the Desktop interface. Then we’ll use some more powerful tools for Recipe B, automating the process.

Setting Up Your Project Tree#

After installing the Thot Desktop app, run it. A folder browser will appear titled Select Project Root. This will set the root (top level) of our project.

Select project root dialog.

Fig. 15 Select Project Root dialog.#

Navigate to the data folder we just created and click Open. An alert titled Initialize Thot Container will appear stating that the selected folder is not a Thot Contiainer, and asking if we would like to make it one. Click Yes.

Initializing a folder as a Container.

Fig. 16 Initializing the root Container.#

This will open a Container Properties dialog where we can set the properties of our root Container. Enter the following information (leaving the rest blank), then click the Submit button.

Name:

Silent Fireworks

Type:

project

Description:

Determining whether recipe A or B is quieter.

Container Properties dialog.

Fig. 17 Container Properties dialog.#

Great! We just made our first Container. What do Containers do? Well, they Contain things. Namely, they can contain other Containers, Assets, and Script Associations. We’ll get to the Assets and Script Associations later on.

Now that we’ve created and selected our root Container, the main workspace of Thot Desktop is available. You’ll notice there are two main views available at the top of the workspace:

  • Project: Gives a visual representation of our project.

  • File Tree: Shows the directory structure and files of our project.

Thot Desktop Project view.

Fig. 18 Project view.#

Thot Desktop File Tree view.

Fig. 19 File Tree view.#

Let’s make the Container for Recipe A now.

From the Project view, click the plus icon of the Silent Fireworks Container. This opens the Container Properties dialog for the child to be added.

Name:

Recipe A

Type:

recipe

We’ll also add metadata to this Container. This allows us to attach metadata to our data. Child Containers inherit the metadata from their ancestors, but can overwrite it by declaring a new value with the same name.

To add metadata click on the Add Metadata button and enter the following metadata.

Name

Type

Value

recipe

string

a

On to the batches. Create a child Container of Recipe A with the following information:

Name:

Batch 1

Metadata:

batch (number): 1

The notation for the metadata used here will be used for the rest of the tutorial. It is of the form Name (Type): Value.

Let’s see another way to make to make a child Container now. Switch to the File Tree view by clicking on it’s tab near the top of the workspace. Click on the Recipe_A folder. This will show Recipe A’s properties, as well as enable the available actions. Click the Add Child button. This will open up our familiar Container Properties dialog, where we can enter the following information:

Name:

Batch 2

Metadata:

batch (number): 2

Creating a child from the File Tree view.

Fig. 20 Creating a child from the File Tree view#

You may have noticed that Thot has added folders and files for us. This is how Thot keeps track of the structure of our projects. Each Container is actually just a folder with a file named _container.json inside of it. Feel free to explore these files or read the CLI sections for more information.

Great! We’ve now created our Recipe A branch, let’s flip back to the Project view to visualize what we have. Wait… Batch 2 isn’t showing up. Let’s refresh the project by clicking on the sync icon in the upper right of the wokspace.

Project view after creating the Recipe A branch.

Fig. 21 Project view after creating the Recipe A branch.#

Bulk Editing

We forgot to assign a type to the batches. Luckily, we can do this easyily in one step. To select multiple resources from the Project view Ctrl (Cmd) + click them. Select Batch 1 and Batch 2. This opens the Bulk Editing menu. Click the Properties button and set the Type field. When bulk editing only fields that are set in the edit dialog will be changed. i.e. If you leave a field in the edit dialog blank that value will not be changed for any of the selected Containers or Assets.

Bulk edit menu.

Fig. 22 Bulk edit menu.#

Try it!

Click on the < in the upper right hand of the Project view to open the Search and Select pane. See if you can select both Batches using this method.

Tip: Regular expressions are valid input.

Tip: The Metdata section should be a JSON object of key-value pairs or an array of keys.

Now let’s create the Recipe B branch. We could go through the same process we did for Recipe A, manually creating each Container. However, Recipe B is almost an exact duplicate of Recipe A, so why don’t we just copy it? Luckily, Thot Desktop gives us an easy way to do this.

Right click on the Recipe A Container and select Duplicate Tree. This will copy the subtree you selected. Let’s edit the name of the Container. Click on the pen icon of the Recipe A (copy) Container and change its name to Recipe B and its metadata recipe to b.

Project view of the finsihed project strucutre.

Fig. 23 Project view of the finsihed project strucutre.#

Great! Our project’s structure is now complete, and we can start adding data to it.

Click here to download this project step.