Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove runType #4916

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { ref, computed, watch, onMounted } from 'vue';
import MultiSelect from 'primevue/multiselect';
import Button from 'primevue/button';
import Chart from 'primevue/chart';
import { ChartConfig, DataseriesConfig, RunResults, RunType } from '@/types/SimulateConfig';
import { ChartConfig, DataseriesConfig, RunResults } from '@/types/SimulateConfig';
import type { CsvAsset } from '@/types/Types';
import { getGraphDataFromDatasetCSV } from '@/components/workflow/util';

Expand All @@ -51,7 +51,6 @@ const props = defineProps<{
colorByRun?: boolean;
initialData?: CsvAsset;
mapping?: { [key: string]: string }[];
runType?: RunType;
size?: { width: number; height: number };
showRemoveButton?: boolean;
}>();
Expand Down Expand Up @@ -259,12 +258,7 @@ const renderGraph = () => {
});

if (props.initialData) {
const dataset: DataseriesConfig | null = getGraphDataFromDatasetCSV(
props.initialData,
variable,
props.mapping,
props.runType
);
const dataset: DataseriesConfig | null = getGraphDataFromDatasetCSV(props.initialData, variable, props.mapping);
if (dataset) {
datasets.push(dataset);
}
Expand Down
14 changes: 4 additions & 10 deletions packages/client/hmi-client/src/components/workflow/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { DataseriesConfig, RunType, ChartConfig } from '@/types/SimulateConfig';
import { DataseriesConfig, ChartConfig } from '@/types/SimulateConfig';
import type { CsvAsset, TimeSpan } from '@/types/Types';
import type { WorkflowNode } from '@/types/workflow';
import type { CalibrateMap } from '@/services/calibrate-workflow';
Expand Down Expand Up @@ -90,17 +90,11 @@ export function getTimespan(params: GetTimespanParams): TimeSpan {
export const getGraphDataFromDatasetCSV = (
dataset: CsvAsset,
columnVar: string,
mapping?: { [key: string]: string }[],
runType?: RunType
mapping?: { [key: string]: string }[]
): DataseriesConfig | null => {
// TA3 quirks, adjust variable names - FIXME
const selectedVariableLookup = runType === RunType.Julia ? columnVar.slice(0, -3) : columnVar;
// runType === RunType.Julia ? columnVar.slice(0, -3) : columnVar.slice(0, -6);
const timeVariableLookup = 'timestamp';

// Default
let selectedVariable = selectedVariableLookup;
let timeVariable = timeVariableLookup;
let selectedVariable = columnVar;
let timeVariable = 'timestamp';

// Map variable names to dataset column names
if (mapping) {
Expand Down
5 changes: 0 additions & 5 deletions packages/client/hmi-client/src/types/SimulateConfig.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
export const enum RunType {
Julia = 'julia',
Ciemss = 'ciemss'
}

export type ChartConfig = {
selectedVariable: string[];
selectedRun: string;
Expand Down