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

Multi-file export #138

Merged
merged 15 commits into from
Jan 11, 2021
Merged

Multi-file export #138

merged 15 commits into from
Jan 11, 2021

Conversation

KacperKazan
Copy link
Contributor

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?

now since each model code gen is it's own separate file, it requires imports
Copy link
Contributor

@lancelotblanchard lancelotblanchard left a 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);
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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',
Copy link
Contributor

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'

@KacperKazan KacperKazan merged commit f2fa1b1 into master Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants