Skip to content

Commit

Permalink
Task: Change optimize output to be a simulation ID (#3048)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey authored Mar 19, 2024
1 parent 8bb027b commit 5079f30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const OptimizeCiemssOperation: Operation = {
displayName: 'Optimize with PyCIEMSS',
description: 'Optimize with PyCIEMSS',
inputs: [{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false }],
outputs: [{ type: 'modelConfigId' }],
outputs: [{ type: 'simulationId' }],
isRunnable: true,

initState: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,14 @@ const runOptimize = async () => {
const simulationResponse = await makeForecastJobCiemss(simulationPayload);
getStatus(simulationResponse.id);
const state = _.cloneDeep(props.node.state);
emit('append-output', {
type: OptimizeCiemssOperation.outputs[0].type,
label: `Simulation output - ${props.node.outputs.length + 1}`,
value: [simulationResponse.id],
isSelected: false,
state
});
};
const getStatus = async (runId: string) => {
Expand Down Expand Up @@ -554,7 +562,6 @@ const getOptimizeStatus = async (runId: string) => {
const saveModelConfiguration = async () => {
if (!modelConfiguration.value) return;
const state = _.cloneDeep(props.node.state);
// TODO: This should be taking some values from our output result but its TBD
const data = await createModelConfiguration(
modelConfiguration.value.model_id,
Expand All @@ -569,13 +576,6 @@ const saveModelConfiguration = async () => {
}
logger.success('Created model configuration');
emit('append-output', {
type: OptimizeCiemssOperation.outputs[0].type,
label: state.modelConfigName,
value: data.id,
isSelected: false,
state
});
};
const setOutputValues = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const processResult = (runId: string) => {
emit('append-output', {
type: SimulateCiemssOperation.outputs[0].type,
label: `Output - ${props.node.outputs.length + 1}`,
value: runId,
value: [runId],
state: {
currentTimespan: state.currentTimespan,
numSamples: state.numSamples,
Expand Down

0 comments on commit 5079f30

Please sign in to comment.