-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added first draft of hosted tutorial.
- Loading branch information
Showing
19 changed files
with
339 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Building the Documentation | ||
|
||
From the root folder, run ``make html``. | ||
|
||
Open `index.html` locally. | ||
|
||
## Publishing | ||
|
||
Push to GitHub. |
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
source/_static/examples/fireworks/hosted/fireworks/analysis/noise_stats.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# import packages | ||
import pandas as pd | ||
from thot.thot import ThotProject | ||
|
||
# initialize thot project | ||
thot = ThotProject() | ||
|
||
# get noise data from asset | ||
noise_data = thot.find_asset( { 'type': 'noise-data' } ) | ||
|
||
# import noise data into a pandas data frame | ||
df = pd.read_csv( noise_data.file, header = 0, index_col = 0, names = ( 'trial', 'volume' ) ) | ||
|
||
# compute statistics | ||
stats = df.describe() | ||
|
||
# create a new asset for the statistics | ||
stats_properties = { | ||
'name': 'Noise Statistics', | ||
'type': 'noise-stats', | ||
'file': 'noise-stats.csv' | ||
} | ||
|
||
stats_path = thot.add_asset( stats_properties, 'noise_stats' ) | ||
|
||
# export the statistics to the new asset | ||
stats.to_csv( stats_path ) |
45 changes: 45 additions & 0 deletions
45
source/_static/examples/fireworks/hosted/fireworks/analysis/recipe_comparison.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import pandas as pd | ||
from thot.thot import ThotProject | ||
|
||
# intialize thot | ||
thot = ThotProject() | ||
|
||
# prepare data | ||
recipe_stats = thot.find_assets( { 'type': 'recipe-stats' } ) | ||
|
||
df = [] | ||
for stat in recipe_stats: | ||
# read data for each recipe | ||
tdf = pd.read_pickle( stat.file ) | ||
tdf.rename( { 0: stat.metadata[ 'recipe' ] }, axis = 1, inplace = True ) | ||
|
||
df.append( tdf ) | ||
|
||
# combine into one dataframe | ||
df = pd.concat( df, axis = 1 ) | ||
|
||
# export data as csv for reading | ||
comparison_properites = { | ||
'name': 'Recipe Comparison', | ||
'type': 'recipe-comparison', | ||
'file': 'recipe_comparison.csv' | ||
} | ||
|
||
comparison_path = thot.add_asset( comparison_properites, 'recipe_comparison' ) | ||
df.to_csv( comparison_path ) | ||
|
||
# create bar char and export | ||
means = df.loc[ 'mean' ] | ||
errs = df.loc[ 'std' ] | ||
|
||
ax = means.plot( kind = 'bar', yerr = errs ) | ||
|
||
bar_properties = { | ||
'name': 'Recipe Comparison', | ||
'type': 'recipe-bar-chart', | ||
'tags': [ 'chart', 'image' ], | ||
'file': 'recipe_comparison.png' | ||
} | ||
|
||
bar_path = thot.add_asset( bar_properties, 'recipe_bar' ) | ||
ax.get_figure().savefig( bar_path, format = 'png' ) |
43 changes: 43 additions & 0 deletions
43
source/_static/examples/fireworks/hosted/fireworks/analysis/recipe_stats.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# include packages | ||
import pandas as pd | ||
from thot.thot import ThotProject | ||
|
||
# initialize thot | ||
thot = ThotProject() | ||
|
||
# get recipe container | ||
recipe = thot.find_container( { '_id': thot.root } ) | ||
|
||
# get noise statistics data | ||
noise_stats = thot.find_assets( { 'type': 'noise-stats' } ) | ||
|
||
# create combined dataframe | ||
df = [] | ||
for stat in noise_stats: | ||
# read data for each batch | ||
tdf = pd.read_csv( | ||
stat.file, | ||
names = ( stat.metadata[ 'batch' ], ), | ||
index_col = 0, | ||
header = 0 | ||
) | ||
|
||
df.append( tdf ) | ||
|
||
df = pd.concat( df, axis = 1 ) | ||
|
||
# compute recipe statistics | ||
mean = df.loc[ 'mean' ].mean() | ||
std = df.loc[ 'std' ].pow( 2 ).sum()/ 4 | ||
|
||
stats = pd.DataFrame( [ mean, std ], index = ( 'mean', 'std' ) ) | ||
|
||
# export recipe statistics | ||
stat_properties = { | ||
'name': '{} Statistics'.format( recipe.name ), | ||
'type': 'recipe-stats', | ||
'file': 'recipe-stats.pkl' | ||
} | ||
|
||
stats_path = thot.add_asset( stat_properties, 'recipe_stats' ) | ||
stats.to_pickle( stats_path ) |
11 changes: 11 additions & 0 deletions
11
source/_static/examples/fireworks/hosted/fireworks/data/a1-data.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Trial,Volume [dB] | ||
1,125 | ||
2,130 | ||
3,127 | ||
4,133 | ||
5,124 | ||
6,131 | ||
7,125 | ||
8,128 | ||
9,125 | ||
10,126 |
11 changes: 11 additions & 0 deletions
11
source/_static/examples/fireworks/hosted/fireworks/data/a2-data.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Trial,Volume [dB] | ||
1,122 | ||
2,127 | ||
3,124 | ||
4,121 | ||
5,126 | ||
6,125 | ||
7,122 | ||
8,124 | ||
9,123 | ||
10,122 |
11 changes: 11 additions & 0 deletions
11
source/_static/examples/fireworks/hosted/fireworks/data/b1-data.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Trial,Volume [dB] | ||
1,90 | ||
2,95 | ||
3,96 | ||
4,97 | ||
5,92 | ||
6,93 | ||
7,98 | ||
8,101 | ||
9,95 | ||
10,96 |
11 changes: 11 additions & 0 deletions
11
source/_static/examples/fireworks/hosted/fireworks/data/b2-data.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Trial,Volume [dB] | ||
1,92 | ||
2,93 | ||
3,97 | ||
4,90 | ||
5,94 | ||
6,95 | ||
7,92 | ||
8,94 | ||
9,95 | ||
10,93 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-8 Bytes
(100%)
source/_static/examples/fireworks/project_steps/03-moving_up/project/project.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.