Skip to content

Commit

Permalink
Added Overview and Writing Scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
bicarlsen committed Nov 3, 2020
1 parent 19bfc47 commit d00a946
Show file tree
Hide file tree
Showing 21 changed files with 6,771 additions and 64 deletions.
6,121 changes: 6,101 additions & 20 deletions source/_static/concepts.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/container-model.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
422 changes: 422 additions & 0 deletions source/_static/examples/gravity/gravity.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/examples/gravity/structure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/organization-analysis-model.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/process-01-organize.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/process-02-data.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/process-03-associate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/process-04a-analyze.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/process-04b-analyze.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/process-04c-analyze.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/script-model.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
'sphinx.ext.autosectionlabel',
'sphinx.ext.mathjax',
'recommonmark',
'sphinx_fontawesome',
'bric-sphinx-bootstrap'
'sphinx_panels' # https://sphinx-panels.readthedocs.io/en/latest/
]

panels_add_bootstrap_css = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -94,6 +95,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = [
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css',
'https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css',
'styles.css'
]
Expand Down
3 changes: 3 additions & 0 deletions source/get_started/hosted_project-advanced.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
########################
Hosted Project: Advanced
########################
36 changes: 18 additions & 18 deletions source/get_started/hosted_project-basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ 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 in :numref:`Fig. %s <hosted_project_organization>`
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 in :numref:`Fig. %s <fig_hosted_project_organization>`

.. _hosted_project_organization:
.. _fig_hosted_project_organization:

.. figure:: /_static/examples/fireworks/fireworks-tree.png
:align: center
Expand All @@ -36,34 +36,34 @@ Luckily our researchers have already written the analysis scripts for us, and ta

.. only:: builder_html or readthedocs

:download:`Click Here to download the project. </_static/examples/fireworks/hosted/fireworks.zip>`
:download:`Click here to download the project. </_static/examples/fireworks/hosted/fireworks.zip>`

From your home dashboard, click on the :bs_btn_primary:`Projects` button, then click the :bs_btn_primary:`New` button. This will take you to the New Project editor. The first thing you'll see here is a box, called a Container, and a tools panel. Containers are the organizational units of a Thot project.
From your home dashboard, click on the :badge:`Projects, badge-primary` button, then click the :badge:`New, badge-primary` button. This will take you to the New Project editor. The first thing you'll see here is a box, called a Container, and a tools panel. Containers are the organizational units of a Thot project.

The first thing we'll do is give our project a name. Click in the Name box of the Container and call it ``Silent Fireworks``. Let's edit the other properties of this Container now.

Click on the pen icon :fa:`pen`, opening up the Container editor. From here add a description about what the project is for. Something like
Click on the pen icon :fa:`pen, style=fas`, opening up the Container editor. From here, add a description about what the project is about. Something like

Testing two different firework recipes to determine which is quieter.
Determining whether recipe A or B is quieter.

Let's save the changes we made by clicking the :bs_btn_primary:`Save` button at the bottom of the editor.
Let's save the changes we made by clicking the :badge:`Save, badge-primary` button at the bottom of the editor.


Adding Levels
=============

We'll start by creating the Recipe A subtree. First click on the plus sign :fa:`plus-circle` to add a child Container to the project, and name it ``Recipe A``. Open the editor just as before by clicking on the pen icon. This time we'll set a few additional properties. First, set its type to ``recipe``. Next well add some metadata to the Container that we can use during the analysis.

Click on the :bs_btn_success:`Add Metadata` button. Our metadata will be named ``recipe``, have a type of ``String``, and a value of ``A``. Save the Container just as before.
Click on the :badge:`Add Metadata, badge-success` button. Our metadata will be named ``recipe``, have a type of ``String``, and a value of ``A``. Save the Container just as before.

Let's now add the batch Containers. This time we'll add both batch at once. To do this hold the :kbd:`Ctrl` key and click on the plus icon. This will reveal the Add Multiple Children dialogue box. In this case we want to add two children, one for each batch. Enter ``2`` into the input box and click the :bs_btn_primary:`Add` button.
Let's now add the batch Containers. This time we'll add both batch at once. To do this hold the :kbd:`Ctrl` key and click on the plus icon. This will reveal the Add Multiple Children dialogue box. In this case we want to add two children, one for each batch. Enter ``2`` into the input box and click the :badge:`Add, badge-primary` button.

Name the first Container ``Batch 1``, and the second ``Batch 2``. To quickly move to the next Container you can press the :kbd:`Tab` key and to move to the previous one hold :kbd:`Shift` then press :kbd:`Tab`.


Edit Batch 1 setting its type to ``batch`` and adding a piece of metadata named ``batch`` of type ``Number`` and value ``1``. We'll also add our first piece of data to Batch 1.

Click the :bs_btn_success:`New Assets` button, navigate to the project folder, and select the file ``a1-data.csv``. This creates an Asset for the data, and adds it to the Container. To access the Asset in our analysis script we'll find it by its type. To set this click on the down arrow :fa:`chevron-down` to open its editor. Double click on the (No type) text to open its type editor, and set it to `noise-data`. To save the changes you can either click on the :bs_btn_success:`Save` button, or press :kbd:`Shift + Enter`. To close the editor without saving press `Esc`. To minimize the Asset's editor click on the up arrow :fa:`chevron-up`.
Click the :badge:`New Assets, badge-success` button, navigate to the project folder, and select the file ``a1-data.csv``. This creates an Asset for the data, and adds it to the Container. To access the Asset in our analysis script we'll find it by its type. To set this click on the down arrow :fa:`chevron-down` to open its editor. Double click on the (No type) text to open its type editor, and set it to `noise-data`. To save the changes you can either click on the :badge:`Save, badge-success` button, or press :kbd:`Shift + Enter`. To close the editor without saving press `Esc`. To minimize the Asset's editor click on the up arrow :fa:`chevron-up`.

Save the changes to Batch 1, and we'll now move on to Batch 2. This timem let's add the data in another way. Instead of doing it from Batch 2's editor, will do it directly from the Container Tree. Find the data file ``a2-data.csv`` and drag and drop it on to the Batch 2 Container. This adds an Asset for the data and adds it to te Container.

Expand All @@ -79,9 +79,9 @@ Switch to the Project Assets view by clicking on the Assets icon :fa:`file-image

Return to the Container Tree view by clicking on its icon :fa:`sitemap` in the tools panels. Add Recipe B to the project, and Batches 1 and 2 to the recipe. Set Recipe B's type to ``recipe`` and add a string metadata with value ``B`` to it, just as we did for Recipe A.

Edit Recipe B > Batch 1 as before, setting its type to ``batch``, and adding a ``batch`` number metadata with value ``1``. Let's add our data Asset. Because it's already been added to the project all we have to do is associate it to the Container. Click on the :bs_btn_success:`Add Asset` button, and select it from the drop down list, then click the :bs_btn_success:`Add Asset` button again to add it. Save your changes as usual.
Edit Recipe B > Batch 1 as before, setting its type to ``batch``, and adding a ``batch`` number metadata with value ``1``. Let's add our data Asset. Because it's already been added to the project all we have to do is associate it to the Container. Click on the :badge:`Add Asset, badge-success` button, and select it from the drop down list, then click the :badge:`Add Asset, badge-success` button again to add it. Save your changes as usual.

Finally let's edit Recipe B > Batch 2. Again setting it's type to ``batch``, adding a ``batch`` number metadata with value ``2``, and adding it's Asset. We also wan tot make a note here. Notes allow us to makes remarks directly on our data or analysis. On the day we fabricated this batch the humidity was a bit higher than usual, which we think may have affected the explosive powders. Click the :bs_btn_success:`Add Note` button to add a note. Title it ``Fabrication Humidity`` and make the note
Finally let's edit Recipe B > Batch 2. Again setting it's type to ``batch``, adding a ``batch`` number metadata with value ``2``, and adding it's Asset. We also wan tot make a note here. Notes allow us to makes remarks directly on our data or analysis. On the day we fabricated this batch the humidity was a bit higher than usual, which we think may have affected the explosive powders. Click the :badge:`Add Note, badge-success` button to add a note. Title it ``Fabrication Humidity`` and make the note

We noticed an elevated humidity during fabrication of this batch. While all the powders seem normal, it may have an influence on their performance.

Expand All @@ -96,21 +96,21 @@ We'll now add the analysis Scripts to our project. Go to the Project Scripts vie
+ recipe-stats.py -> Recipe Stats
+ recipe-comparison.py -> Recipe Comparison

Let now associate these Scripts with their respective Containers. We'll start with Recipe A > Batch 1. click on the pen to edit, and click on the :bs_btn_success:`Add Script` button. Select the ``Noise Stats`` Script and save the container. Do the same for the other batches. We'll then repeat the process for both recipes adding the ``Recipe Stats`` Script to them, and finally we'll add the ``Recipe Comparison`` Script to the root container at the top.
Let now associate these Scripts with their respective Containers. We'll start with Recipe A > Batch 1. click on the pen to edit, and click on the :badge:`Add Script, badge-success` button. Select the ``Noise Stats`` Script and save the container. Do the same for the other batches. We'll then repeat the process for both recipes adding the ``Recipe Stats`` Script to them, and finally we'll add the ``Recipe Comparison`` Script to the root container at the top.

Finally we need to add a library dependency to our project. Our Scripts use the `Pandas <https://pandas.pydata.org/>`_ library, so we need to tell our project about this dependency. Open the Library view by clicking on the book icon :fa:`book`. Pandas is considered a remote library because we haven't uploaded it directly to our Thot account. To add is as a dependency in our project type ``pandas`` into the Name field and select ``Python`` as the language. You can leave the version blank, as we'll use the most recent version. Click the :bs_btn_success:`Add Library` button to add it to our project.
Finally we need to add a library dependency to our project. Our Scripts use the `Pandas <https://pandas.pydata.org/>`_ library, so we need to tell our project about this dependency. Open the Library view by clicking on the book icon :fa:`book`. Pandas is considered a remote library because we haven't uploaded it directly to our Thot account. To add is as a dependency in our project type ``pandas`` into the Name field and select ``Python`` as the language. You can leave the version blank, as we'll use the most recent version. Click the :badge:`Add Library, badge-success` button to add it to our project.

Great! That finished our project set up. We can ensure we have everything set up the way we want by going to the Container Tree view and changing the **Preview** of our Containers. Go through each of the options to verify the Containers have the desired properties and associations.

Let's now save the project by clicking on the save icon :fa:`save` in the toll panel. This will save our project and take us to the project page.
Let's now save the project by clicking on the save icon :fa:`save` in the tool panel. This will save our project and take us to the project page.

************
Project Page
************

Let's start off by adding a tag to our project. Double click on the Silent Fireworks Container to open its editor. Then double click on the (No tags) section. This opens up the tag editor. Tags can be used to search for different items both within a project and across projects. Let's give our project the tags ``underwater`` and ``low noise``. To do this, enter both values separated by a comma. To save you can either click on the :bs_btn_success:`Save` button, or press :kbd:`Shift + Enter`, just as we did with the noise data Asset before. To close the editor without saving you can press the :kbd:`Esc` key.
Let's start off by adding a tag to our project. Double click on the Silent Fireworks Container to open its editor. Then double click on the (No tags) section. This opens up the tag editor. Tags can be used to search for different items both within a project and across projects. Let's give our project the tags ``underwater`` and ``low noise``. To do this, enter both values separated by a comma. To save you can either click on the :badge:`Save, badge-success` button, or press :kbd:`Shift + Enter`, just as we did with the noise data Asset before. To close the editor without saving you can press the :kbd:`Esc` key.

Notice now that we are in the Project editor, instead of the Project Creation editor there is no longer a :bs_btn_primary:`Save` button at the bottom of the Container editor. This is because any changes you make are automaitcally saved when you submit them. To close the editor you can either click on one of the view in the tools panel, or click on the close icon :fa:`times-circle` in the upper right hand of the editor.
Notice now that we are in the Project editor, instead of the Project Creation editor there is no longer a :badge:`Save, badge-primary` button at the bottom of the Container editor. This is because any changes you make are automaitcally saved when you submit them. To close the editor you can either click on one of the view in the tools panel, or click on the close icon :fa:`times-circle` in the upper right hand of the editor.


Analyzing the Project
Expand All @@ -121,7 +121,7 @@ Now that our project is all set up, let's finally analyze it. We can choose to a
Select its Container by single clicking on it. This activates some of the tools that were disabled before. Click on the Analyze button :fa:`chart-line`
. When the Analysis is done you'll see the new Asset show up in the preview panel on the right hand side of the screen.

Now let's analyze the whole Recipe A subtree. Open the Recipe A Container editor, and clcik on the :bs_btn_primary:`Analyze` button. Once the analysis is complete we will see the new Assets show up in the Assets section.
Now let's analyze the whole Recipe A subtree. Open the Recipe A Container editor, and clcik on the :badge:`Analyze, badge-primary` button. Once the analysis is complete we will see the new Assets show up in the Assets section.

Let open the Container editor for Recipe A. Here we see that we can download the entire container, which will also download all of its children. We can also download individual Assets.

Expand Down
4 changes: 3 additions & 1 deletion source/get_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ These tutorials will get you started using Thot to manage and analyze your data.
:maxdepth: 2
:caption: Contents:

hosted_project-basic
hosted_project-advanced
local_project-basic
local_project-advanced
hosted_project-basic
writing_scripts
utilities


Expand Down

0 comments on commit d00a946

Please sign in to comment.