Skip to content

Commit

Permalink
Fix #33.
Browse files Browse the repository at this point in the history
  • Loading branch information
elmisback committed May 3, 2024
1 parent a832ed8 commit 95064ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/herbie/LocalError/LocalError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function LocalError({ expressionId }: { expressionId: number }) {
// get the current point selection and selected point local error
const [selectedPoint, ] = HerbieContext.useGlobal(HerbieContext.SelectedPointContext);
const [selectedPointsLocalError, ] = HerbieContext.useGlobal(HerbieContext.SelectedPointsLocalErrorContext);

const [spec, ] = HerbieContext.useGlobal(HerbieContext.SpecContext)
// get the current sample and expression so we can pick the right local error from the averagelocalerrors table
const [selectedSampleId,] = HerbieContext.useGlobal(HerbieContext.SelectedSampleIdContext);
const [selectedExprId,] = HerbieContext.useGlobal(HerbieContext.SelectedExprIdContext);
Expand All @@ -85,7 +85,7 @@ function LocalError({ expressionId }: { expressionId: number }) {
}

// const graph = localErrorTreeAsMermaidGraph(localError, 64)
const varnames = fpcore.getVarnamesMathJS(expressions.find(e => e.id === expressionId)?.text as string)
const varnames = fpcore.getVarnamesMathJS(spec.expression)

const selectedPointValue = (selectedPoint as number[]).map((value, i) => ({ [varnames[i]]: value })).reduce((a, b) => ({ ...a, ...b }), {})

Expand Down

0 comments on commit 95064ed

Please sign in to comment.