Skip to content

Commit

Permalink
bugfix to handle empty deepview predict array (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
johncalesp authored Apr 4, 2023
1 parent 85103c7 commit 4c904c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions skyline-vscode/react-ui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions skyline-vscode/react-ui/src/sections/Habitat.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export default function Habitat({ habitatData }) {
return (
<>
<div className="innpv-memory innpv-subpanel">
<Subheader icon="database">Habitat</Subheader>
<Subheader icon="database">DeepView.Predict</Subheader>
<div className="innpv-subpanel-content">
<Container fluid className="mt-2">
<Row className="justify-content-md-center">
<h6>The local GPU is not supported by DeepView.Predict</h6>
<h6>The local GPU is not supported by DeepView.Predict or DeepView.Predict is not installed</h6>
</Row>
</Container>
</div>
Expand All @@ -30,7 +30,7 @@ export default function Habitat({ habitatData }) {
return (
<>
<div className="innpv-memory innpv-subpanel">
<Subheader icon="database">Habitat</Subheader>
<Subheader icon="database">DeepView.Predict</Subheader>
<div className="innpv-subpanel-content">
{habitatData.length === 0 ? (
<Container fluid>
Expand Down
2 changes: 1 addition & 1 deletion skyline-vscode/react-ui/src/sections/ProviderPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const ProviderPanel = ({ numIterations, habitatData, additionalProviders }) => {
<Row className="mt-2">
<Alert variant="danger">
Currently showing a demo data because local GPU is not
supported by DeepView.Predict
supported by DeepView.Predict or DeepView.Predict is not installed
</Alert>
</Row>
)}
Expand Down

0 comments on commit 4c904c5

Please sign in to comment.