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

fix bugs in run #76

Merged
merged 1 commit into from
Sep 27, 2023
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
8 changes: 6 additions & 2 deletions frontend/src/store/slice/DisplayData/DisplayDataSlice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSlice } from '@reduxjs/toolkit'
import { createSlice, isAnyOf } from '@reduxjs/toolkit'
import {
DATA_TYPE,
DATA_TYPE_SET,
Expand All @@ -25,7 +25,7 @@ import {
deleteDisplayItem,
setNewDisplayDataPath,
} from '../VisualizeItem/VisualizeItemActions'

import { run, runByCurrentUid } from 'store/slice/Pipeline/PipelineActions'
const initialState: DisplayData = {
timeSeries: {},
heatMap: {},
Expand Down Expand Up @@ -554,6 +554,10 @@ export const displayDataSlice = createSlice({
error: action.error.message ?? 'rejected',
}
})
.addMatcher(
isAnyOf(run.fulfilled, runByCurrentUid.fulfilled),
(state, action) => initialState,
)
},
})

Expand Down
18 changes: 1 addition & 17 deletions studio/app/common/core/workflow/workflow_writer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import os
from dataclasses import asdict
from typing import Dict

from studio.app.common.core.utils.config_handler import ConfigWriter
from studio.app.common.core.utils.filepath_creater import join_filepath
from studio.app.common.core.workflow.workflow import Edge, Node, WorkflowConfig
from studio.app.common.core.workflow.workflow_builder import WorkflowConfigBuilder
from studio.app.common.core.workflow.workflow_reader import WorkflowConfigReader
from studio.app.dir_path import DIRPATH


Expand All @@ -23,23 +21,9 @@ def __init__(
self.nodeDict = nodeDict
self.edgeDict = edgeDict
self.builder = WorkflowConfigBuilder()
self.create_config()

def write(self) -> None:
config_filepath = join_filepath(
[
DIRPATH.OUTPUT_DIR,
self.workspace_id,
self.unique_id,
DIRPATH.WORKFLOW_YML,
]
)

if os.path.exists(config_filepath):
config = WorkflowConfigReader.read(config_filepath)
self.builder.set_config(config)
else:
self.create_config()

ConfigWriter.write(
dirname=join_filepath(
[DIRPATH.OUTPUT_DIR, self.workspace_id, self.unique_id]
Expand Down