Skip to content

Commit

Permalink
Merge pull request #64 from EducationalTestingService/hotfix/javascri…
Browse files Browse the repository at this point in the history
…pt-in-header-notebooks

Fix the loading of Javascript sorting library in header notebooks.
  • Loading branch information
desilinguist authored Sep 13, 2016
2 parents cb4a263 + 8bc9190 commit 5cc1907
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion rsmtool/notebooks/comparison/header.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
},
"outputs": [],
"source": [
"display(Javascript(filename=join(javascript_path, \"sort.js\")))"
"with open(join(javascript_path, \"sort.js\"), \"r\", encoding=\"utf-8\") as sortf:\n",
" display(Javascript(data=sortf.read()))"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion rsmtool/notebooks/header.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@
},
"outputs": [],
"source": [
"display(Javascript(filename=join(javascript_path, \"sort.js\")))"
"with open(join(javascript_path, \"sort.js\"), \"r\", encoding=\"utf-8\") as sortf:\n",
" display(Javascript(data=sortf.read()))"
]
},
{
Expand Down
8 changes: 3 additions & 5 deletions rsmtool/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@
package_path = dirname(__file__)
notebook_path = abspath(join(package_path, 'notebooks'))
template_path = join(notebook_path, 'templates')
javascript_path = join(package_path, 'notebooks', 'javascript')
comparison_notebook_path = abspath(join(package_path,
'notebooks',
'comparison'))
javascript_path = join(notebook_path, 'javascript')
comparison_notebook_path = join(notebook_path, 'comparison')

# Define the general section list

Expand Down Expand Up @@ -543,7 +541,7 @@ def create_comparison_report(experiment_id_old, description_old,
os.environ['FIGURE_DIR_NEW'] = figdir_new
os.environ['SCALED_NEW'] = '1' if use_scaled_predictions_new else '0'
os.environ['JAVASCRIPT_PATH'] = javascript_path

# we define separate groups to allow future flexibility in defining
# what groups are used for descriptives and evaluations
os.environ['GROUPS_FOR_DESCRIPTIVES'] = '%%'.join(subgroups)
Expand Down

0 comments on commit 5cc1907

Please sign in to comment.