add support for corpora default_embedding field (#1696)

* fix mispelling

* re-implement re-embedding

* always load base embedding to fetch counts

* format

* lint

* fix tests

* lint

* fix accept handling

* test log

* more debug

* more

* more

* more

* more

* remove logging

* logging

* jsonify

* remove debugging logs

* lint

* clean up errors a bit

* fix issue found in PR review

* add support for corpora default_embedding

* fix botched merge

* PR review

* PR review
This commit is contained in:
Bruce Martin
2020-07-31 07:36:48 -07:00
committed by GitHub
parent 055511fe60
commit f2fbeff511
3 changed files with 91 additions and 3 deletions

View File

@@ -58,7 +58,7 @@ const doInitialDataLoad = () =>
dispatch({ type: "initial data load start" });
try {
const [, schema] = await Promise.all([
const [config, schema] = await Promise.all([
configFetch(dispatch),
schemaFetch(dispatch),
userColorsFetchAndLoad(dispatch),
@@ -75,6 +75,15 @@ const doInitialDataLoad = () =>
obsCrossfilter,
});
dispatch({ type: "initial data load complete" });
const defaultEmbedding = config?.parameters?.["default_embedding"];
const layoutSchema = schema?.schema?.layout?.obs ?? [];
if (
defaultEmbedding &&
layoutSchema.some((s) => s.name === defaultEmbedding)
) {
dispatch(embActions.layoutChoiceAction(defaultEmbedding));
}
} catch (error) {
dispatch({ type: "initial data load error", error });
}