Skip to content

Commit

Permalink
use new dict of labelled contours when exporting to csv
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaranville committed Oct 28, 2024
1 parent 27f4c1f commit 1e3e562
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions refl1d/webview/client/src/components/ProfileUncertaintyView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ type Payload = {
contour_data: {
[model_name: string]: {
z: number[],
data: { [key: string]: number[][][] },
}
data: { [key: string]: {
[contour_label: string]: number[],
}},
},
},
contours: number[],
}
Expand All @@ -57,12 +59,10 @@ function get_csv_data() {
for (const [model_name, model_data] of Object.entries(data)) {
headers.push(`"${model_name} z"`);
values.push(model_data.z);
Object.keys(model_data.data).forEach((key) => {
contours_value.forEach((c, ci) => {
headers.push(`"${model_name} ${key} (${c} lower)"`);
headers.push(`"${model_name} ${key} (${c} upper)"`);
values.push(model_data.data[key][ci][0]);
values.push(model_data.data[key][ci][1]);
Object.entries(model_data.data).forEach(([key, value]) => {
Object.entries(value).forEach(([c, v]) => {
headers.push(`"${model_name} ${key} ${c}"`);
values.push(v);
});
});
}
Expand Down

0 comments on commit 1e3e562

Please sign in to comment.