Skip to content

Commit 7563a0b

Browse files
mpolson64facebook-github-bot
authored andcommitted
Fix tutorials after introduction of MetricFetchResult (#1243)
Summary: X-link: facebook/Ax#1243 Pull Request resolved: #1475 A few tutorials were not compatible with the new way we fetch data. In this diff we change custom metrics to return Ok(data) instead of data, and change `trial.fetch_data()` => `Metric._unwrap_trial_data_multi(results=trial.fetch_data())`. In the future we may want to add some copy in the tutorials discussing Result, but we should land this for now to get things working again ASAP Reviewed By: dme65 Differential Revision: D40994060 fbshipit-source-id: 9a5f86273a7da8496e480a0d7ca0aa2c03ecb194
1 parent 48f2047 commit 7563a0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tutorials/custom_botorch_model_in_ax.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@
10851085
" Runner,\n",
10861086
" SearchSpace,\n",
10871087
")\n",
1088+
"from ax.utils.common.result import Ok\n",
10881089
"from botorch.test_functions import Branin\n",
10891090
"\n",
10901091
"\n",
@@ -1106,7 +1107,7 @@
11061107
" \"sem\": float(\"nan\"), # SEM (observation noise) - NaN indicates unknown\n",
11071108
" }\n",
11081109
" )\n",
1109-
" return Data(df=pd.DataFrame.from_records(records))\n",
1110+
" return Ok(value=Data(df=pd.DataFrame.from_records(records)))\n",
11101111
"\n",
11111112
"\n",
11121113
"# Search space defines the parameters, their types, and acceptable values.\n",

0 commit comments

Comments
 (0)