Skip to content

Commit

Permalink
Ts/2500 implement notebook beaker integrate within model config (#2758)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey authored Feb 21, 2024
1 parent c27c9f1 commit b366c6c
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ export const createModelConfiguration = async (
model_id: string | undefined,
name: string,
description: string,
configuration: Model
configuration: Model,
isTemporary?: boolean
) => {
if (!model_id) {
return null;
}
const temporary = isTemporary ?? false;
const response = await API.post(`/model-configurations`, {
model_id,
temporary,
name,
description,
configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import type { Initial, ModelParameter } from '@/types/Types';

export const name = 'ModelConfigOperation';

export interface ModelEditCode {
code: string;
timestamp: number;
}

export interface ModelConfigOperationState {
modelId: string | null;
name: string;
description: string;
initials?: Initial[];
parameters?: ModelParameter[];
timeseries?: { [key: string]: string };
initials: Initial[];
parameters: ModelParameter[];
timeseries: { [key: string]: string };
modelEditCodeHistory: ModelEditCode[];
hasCodeBeenRun: boolean;
tempConfigId: string; // This is used for beaker context when there is no output selected. It is a config id that is in TDS and marked as temp
}

export const ModelConfigOperation: Operation = {
Expand All @@ -23,9 +30,14 @@ export const ModelConfigOperation: Operation = {

initState: () => {
const init: ModelConfigOperationState = {
modelId: null,
name: '',
description: ''
description: '',
modelEditCodeHistory: [],
hasCodeBeenRun: false,
tempConfigId: '',
initials: [],
parameters: [],
timeseries: {}
};
return init;
}
Expand Down
Loading

0 comments on commit b366c6c

Please sign in to comment.