|
1 | 1 | import io
|
| 2 | +import json |
2 | 3 | import os
|
3 | 4 | from itertools import product
|
4 | 5 | from os import path
|
5 | 6 | from pathlib import Path
|
6 |
| -from urllib.parse import urljoin |
| 7 | +from urllib.parse import quote, urljoin |
7 | 8 |
|
8 |
| -import json |
9 | 9 | import jupytext
|
10 | 10 | import pandas as pd
|
11 | 11 | import pytest
|
|
133 | 133 | "tooltip": tooltips["synchrony"],
|
134 | 134 | "hidden": False,
|
135 | 135 | },
|
136 |
| - # TODO: Single vs. Batch vs. Asynchronous Optimization, e.g., get_next_trial() vs. get_next_trials() # noqa E501 # NOTE: AC Microcourses |
| 136 | + # TODO: Single vs. Batch vs. Asynchronous Optimization, e.g., get_next_trial() vs. get_next_trials() # NOTE: AC Microcourses # noqa E501 |
| 137 | + # TODO: Consider adding "human-in-the-loop" toggle, or something else related to start/stop or blocking to wait for human input # noqa E501 # NOTE: AC Microcourses |
137 | 138 | ]
|
138 | 139 |
|
139 | 140 | # E.g.,
|
@@ -326,8 +327,13 @@ def is_incompatible(opt):
|
326 | 327 | "https://colab.research.google.com/github/sgbaird/honegumi/blob/main/"
|
327 | 328 | )
|
328 | 329 |
|
329 |
| - notebook_path = path.join(GEN_NOTEBOOK_DIR, f"{rendered_template_stem}.ipynb") |
330 |
| - colab_link = urljoin(colab_prefix, notebook_path) |
| 330 | + notebook_fname = f"{rendered_template_stem}.ipynb" |
| 331 | + notebook_path = path.join(GEN_NOTEBOOK_DIR, notebook_fname) |
| 332 | + # HACK: issue with + encoding becoming %20 instead of %2B due to use of \\, |
| 333 | + # and maybe other issues (hence both quote fn and replace line) |
| 334 | + encoded_notebook_fname = quote(notebook_fname) |
| 335 | + encoded_notebook_path = path.join(GEN_NOTEBOOK_DIR, encoded_notebook_fname) |
| 336 | + colab_link = urljoin(colab_prefix, encoded_notebook_path).replace("\\", "/") |
331 | 337 | colab_badge = f'<a href="{colab_link}"><img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg"></a>' # noqa E501
|
332 | 338 |
|
333 | 339 | preamble = f"{colab_badge} {github_badge}"
|
|
0 commit comments