Skip to content

Commit

Permalink
Fixes #49 Updated webgme dependency to v2.x (#51)
Browse files Browse the repository at this point in the history
WIP #49 Updated plugins to v2.0.0 structure

WIP #49 Updated webgme version

WIP #49 Fixed most of the tests...

Fixed last text. WIP #49
  • Loading branch information
brollb committed May 20, 2016
1 parent 4046915 commit 2960415
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 192 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"version": "0.1.0",
"dependencies": {
"lodash.difference": "^4.1.2",
"webgme": "^1.7.2",
"webgme-autoviz": "dfst/webgme-autoviz",
"webgme-breadcrumbheader": "dfst/webgme-breadcrumbheader",
"webgme-chflayout": "^1.0.0",
"webgme": "^2.0.0",
"webgme-autoviz": "^2.0.0",
"webgme-breadcrumbheader": "^2.0.0",
"webgme-chflayout": "^2.0.0",
"webgme-easydag": "dfst/webgme-easydag",
"webgme-fab": "^1.0.0",
"webgme-fab": "^2.0.0",
"webgme-simple-nodes": "^2.0.0"
},
"devDependencies": {
Expand Down
48 changes: 7 additions & 41 deletions src/plugins/CreateTorchMeta/CreateTorchMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ define([
'plugin/PluginConfig',
'plugin/PluginBase',
'deepforge/js-yaml.min',
'text!deepforge/layers.yml'
'text!deepforge/layers.yml',
'text!./metadata.json'
], function (
PluginConfig,
PluginBase,
yaml,
DEFAULT_LAYERS
DEFAULT_LAYERS,
metadata
) {
'use strict';

Expand All @@ -28,51 +30,15 @@ define([
var CreateTorchMeta = function () {
// Call base class' constructor.
PluginBase.call(this);
this.pluginMetadata = CreateTorchMeta.metadata;
};

CreateTorchMeta.metadata = JSON.parse(metadata);

// Prototypal inheritance from PluginBase.
CreateTorchMeta.prototype = Object.create(PluginBase.prototype);
CreateTorchMeta.prototype.constructor = CreateTorchMeta;

/**
* Gets the name of the CreateTorchMeta.
* @returns {string} The name of the plugin.
* @public
*/
CreateTorchMeta.prototype.getName = function () {
return 'CreateTorchMeta';
};

/**
* Gets the semantic version (semver.org) of the CreateTorchMeta.
* @returns {string} The version of the plugin.
* @public
*/
CreateTorchMeta.prototype.getVersion = function () {
return '0.1.0';
};

/**
* Gets the configuration structure for the CreateTorchMeta.
* The ConfigurationStructure defines the configuration for the plugin
* and will be used to populate the GUI when invoking the plugin from webGME.
* @returns {object} The version of the plugin.
* @public
*/
CreateTorchMeta.prototype.getConfigStructure = function () {
return [
{
name: 'layerNameHash',
displayName: 'Torch Layers',
description: 'Yaml file of torch layer descriptors (optional)',
value: '',
valueType: 'asset',
readOnly: false
}
];
};


/**
* Main function for the plugin to execute. This will perform the execution.
* Notes:
Expand Down
22 changes: 22 additions & 0 deletions src/plugins/CreateTorchMeta/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": "CreateTorchMeta",
"name": "Create Torch Meta",
"version": "0.1.0",
"description": "Create metamodel from Torch yaml",
"icon": {
"src": "",
"class": "glyphicon glyphicon-ok-circle"
},
"disableServerSideExecution": false,
"disableBrowserSideExecution": false,
"configStructure": [
{
"name": "layerNameHash",
"displayName": "Torch Layers",
"description": "Yaml file of torch layer descriptors (optional)",
"value": "",
"valueType": "asset",
"readOnly": false
}
]
}
27 changes: 7 additions & 20 deletions src/plugins/GenerateArchitecture/GenerateArchitecture.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ define([
'SimpleNodes/Constants',
'deepforge/layer-args',
'./dimensionality',
'underscore'
'underscore',
'text!./metadata.json'
], function (
PluginBase,
Constants,
createLayerDict,
dimensionality,
_
_,
metadata
) {
'use strict';

Expand All @@ -30,30 +32,15 @@ define([
var GenerateArchitecture = function () {
// Call base class' constructor.
PluginBase.call(this);
this.pluginMetadata = GenerateArchitecture.metadata;
};

GenerateArchitecture.metadata = JSON.parse(metadata);

// Prototypal inheritance from PluginBase.
GenerateArchitecture.prototype = Object.create(PluginBase.prototype);
GenerateArchitecture.prototype.constructor = GenerateArchitecture;

/**
* Gets the name of the GenerateArchitecture.
* @returns {string} The name of the plugin.
* @public
*/
GenerateArchitecture.prototype.getName = function () {
return 'GenerateArchitecture';
};

/**
* Gets the semantic version (semver.org) of the GenerateArchitecture.
* @returns {string} The version of the plugin.
* @public
*/
GenerateArchitecture.prototype.getVersion = function () {
return '0.1.0';
};

GenerateArchitecture.prototype.main = function () {
this.LayerDict = createLayerDict(this.core, this.META);
this._oldTemplateSettings = _.templateSettings;
Expand Down
13 changes: 13 additions & 0 deletions src/plugins/GenerateArchitecture/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "GenerateArchitecture",
"name": "Generate Architecture",
"version": "0.1.0",
"description": "Generate torch architecture code",
"icon": {
"src": "",
"class": "glyphicon glyphicon-ok-circle"
},
"disableServerSideExecution": false,
"disableBrowserSideExecution": false,
"configStructure": []
}
27 changes: 7 additions & 20 deletions src/plugins/GenerateYaml/GenerateYaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

define([
'deepforge/GraphChecker',
'plugin/PluginBase'
'plugin/PluginBase',
'text!./metadata.json'
], function (
GraphChecker,
PluginBase
PluginBase,
metadata
) {
'use strict';

Expand All @@ -24,30 +26,15 @@ define([
var GenerateYaml = function () {
// Call base class' constructor.
PluginBase.call(this);
this.pluginMetadata = GenerateYaml.metadata;
};

GenerateYaml.metadata = JSON.parse(metadata);

// Prototypal inheritance from PluginBase.
GenerateYaml.prototype = Object.create(PluginBase.prototype);
GenerateYaml.prototype.constructor = GenerateYaml;

/**
* Gets the name of the GenerateYaml.
* @returns {string} The name of the plugin.
* @public
*/
GenerateYaml.prototype.getName = function () {
return 'GenerateYaml';
};

/**
* Gets the semantic version (semver.org) of the GenerateYaml.
* @returns {string} The version of the plugin.
* @public
*/
GenerateYaml.prototype.getVersion = function () {
return '0.1.0';
};

/**
* Main function for the plugin to execute. This will perform the execution.
* Notes:
Expand Down
13 changes: 13 additions & 0 deletions src/plugins/GenerateYaml/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "GenerateYaml",
"name": "Generate Yaml",
"version": "0.1.0",
"description": "Generate yaml representation of the model",
"icon": {
"src": "",
"class": "glyphicon glyphicon-ok-circle"
},
"disableServerSideExecution": false,
"disableBrowserSideExecution": false,
"configStructure": []
}
48 changes: 7 additions & 41 deletions src/plugins/ImportTorch/ImportTorch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ define([
'deepforge/layer-args',
'deepforge/lua',
'./nn',
'plugin/PluginBase'
'plugin/PluginBase',
'text!./metadata.json'
], function (
LayerDict,
luajs,
createNNSearcher,
PluginBase
PluginBase,
metadata
) {
'use strict';

Expand All @@ -28,51 +30,15 @@ define([
var ImportTorch = function () {
// Call base class' constructor.
PluginBase.call(this);
this.pluginMetadata = ImportTorch.metadata;
};

ImportTorch.metadata = JSON.parse(metadata);

// Prototypal inheritance from PluginBase.
ImportTorch.prototype = Object.create(PluginBase.prototype);
ImportTorch.prototype.constructor = ImportTorch;

/**
* Gets the name of the ImportTorch.
* @returns {string} The name of the plugin.
* @public
*/
ImportTorch.prototype.getName = function () {
return 'ImportTorch';
};

/**
* Gets the semantic version (semver.org) of the ImportTorch.
* @returns {string} The version of the plugin.
* @public
*/
ImportTorch.prototype.getVersion = function () {
return '0.1.0';
};

/**
* Gets the configuration structure for the ImportTorch.
* The ConfigurationStructure defines the configuration for the plugin
* and will be used to populate the GUI when invoking the plugin from webGME.
* @returns {object} The version of the plugin.
* @public
*/
ImportTorch.prototype.getConfigStructure = function () {
return [
{
name: 'srcHash',
displayName: 'Torch Source Code',
description: '',
value: '',
valueType: 'asset',
readOnly: false
}
];
};


/**
* Main function for the plugin to execute. This will perform the execution.
* Notes:
Expand Down
22 changes: 22 additions & 0 deletions src/plugins/ImportTorch/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": "ImportTorch",
"name": "Import Torch architecture",
"version": "0.1.0",
"description": "Import a Torch nn architecture.",
"icon": {
"src": "",
"class": "glyphicon glyphicon-ok-circle"
},
"disableServerSideExecution": false,
"disableBrowserSideExecution": false,
"configStructure": [
{
"name": "srcHash",
"displayName": "Torch Source Code",
"description": "",
"value": "",
"valueType": "asset",
"readOnly": false
}
]
}
Loading

0 comments on commit 2960415

Please sign in to comment.