From c73ce25f03d051ab8e03b61b17aa12ad154b07e2 Mon Sep 17 00:00:00 2001 From: John Calderon Date: Tue, 4 Apr 2023 15:33:37 -0400 Subject: [PATCH] bugfix to handle empty deepview predict array --- skyline-vscode/react-ui/src/App.js | 6 ++++-- skyline-vscode/react-ui/src/sections/Habitat.js | 6 +++--- skyline-vscode/react-ui/src/sections/ProviderPanel.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/skyline-vscode/react-ui/src/App.js b/skyline-vscode/react-ui/src/App.js index a4ebe08..8cebde9 100644 --- a/skyline-vscode/react-ui/src/App.js +++ b/skyline-vscode/react-ui/src/App.js @@ -103,12 +103,14 @@ function App() { setConnectionStatus(event.data["status"]); } else if (event.data["message_type"] === "analysis") { if ( - event.data.habitat[0][0] === "unavailable" && - event.data.habitat[0][1] === -1.0 + event.data.habitat.length === 0 || + (event.data.habitat[0][0] === "unavailable" && + event.data.habitat[0][1] === -1.0) ) { event.data.habitat = profiling_data.habitat; event.data.habitat.push(["demo", 1]); } + console.log(event.data); processAnalysisState(event.data); } else if (event.data["message_type"] === "text_change") { setTextChanged(true); diff --git a/skyline-vscode/react-ui/src/sections/Habitat.js b/skyline-vscode/react-ui/src/sections/Habitat.js index bcac6b2..2817967 100644 --- a/skyline-vscode/react-ui/src/sections/Habitat.js +++ b/skyline-vscode/react-ui/src/sections/Habitat.js @@ -14,11 +14,11 @@ export default function Habitat({ habitatData }) { return ( <>
- Habitat + DeepView.Predict
-
The local GPU is not supported by DeepView.Predict
+
The local GPU is not supported by DeepView.Predict or DeepView.Predict is not installed
@@ -30,7 +30,7 @@ export default function Habitat({ habitatData }) { return ( <>
- Habitat + DeepView.Predict
{habitatData.length === 0 ? ( diff --git a/skyline-vscode/react-ui/src/sections/ProviderPanel.js b/skyline-vscode/react-ui/src/sections/ProviderPanel.js index 3bdc20f..8b08392 100644 --- a/skyline-vscode/react-ui/src/sections/ProviderPanel.js +++ b/skyline-vscode/react-ui/src/sections/ProviderPanel.js @@ -176,7 +176,7 @@ const ProviderPanel = ({ numIterations, habitatData, additionalProviders }) => { Currently showing a demo data because local GPU is not - supported by DeepView.Predict + supported by DeepView.Predict or DeepView.Predict is not installed )}