-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multi-file export #138
Multi-file export #138
Conversation
…ntaining appropriate folders.
(might be a more elegant way to do this but at least I know this works. Python imports are so weird)
now since each model code gen is it's own separate file, it requires imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, congrats! We'll have to merge it with the template-ide
branch, but I'm not sure where @williamprofit is with the codegen for this bit.
function generateFunctions(graph: Graph): string { | ||
const customNodes = graph.nodesAsArray.filter((item: GraphNode) => item.mlNode instanceof Custom); | ||
function importCustomFunctions(graph: Graph): string[] { | ||
const customNodes = graph.nodesAsArray.filter((item: GraphNode) => item.mlNode instanceof Custom || item.mlNode instanceof OverviewCustom); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be item.mlNode instanceof ModelCustom || item.mlNode instanceof DataCustom || item.mlNode instanceof OverviewCustom
if (node.mlNode instanceof Custom) { | ||
funcs.push(node.mlNode.code); | ||
// redundant check as we filter above but typescript is weird like this | ||
if (node.mlNode instanceof Custom || node.mlNode instanceof OverviewCustom) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, probably good to have it in a helper function
@@ -22,7 +24,8 @@ class Custom { | |||
if (parsedFuncs instanceof Error) { | |||
console.error(parsedFuncs); | |||
return 'CUSTOM_NODE_PARSE_ERROR'; | |||
} if (parsedFuncs.length > 0) { | |||
} | |||
if (parsedFuncs.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be added to the other ModelCustom
, DataCustom
and OverviewCustom
as well.
const codevaultFolder = zip.folder('codevault'); | ||
|
||
// generate overview | ||
if (this.overviewSelected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't want to export if we're in another editor? I'm not sure I understand this bit here.
@@ -23,7 +23,7 @@ export enum OverviewNodes { | |||
RMSprop = 'RMSprop', | |||
Rprop = 'Rprop', | |||
SGD = 'SGD', | |||
Custom = 'Custom', | |||
Custom = 'OverviewCustom', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was renamed OverviewCustom = 'OverviewCustom'
Codegen now exported as a zip with models, dataloaders and custom code files in appropriate folders.
To run the project (assumign you have the dataset ready) all you have to do is run 'python main.py'
@lancelotblanchard the OverviewCustom node seemed to be broken (would just be treated as a regular Custom node). So I fixed it. Could you please double check if my changes are safe?