[jupyter] update widget so it uses str(...) instread of repr(...) and topological order of nodes.

This commit is contained in:
Romain Dorgueil
2017-06-05 09:43:38 +02:00
parent 84573cc8fa
commit 471e38e67b
12 changed files with 1472 additions and 32 deletions

View File

@ -1,7 +1,7 @@
# This file has been auto-generated. # This file has been auto-generated.
# All changes will be lost, see Projectfile. # All changes will be lost, see Projectfile.
# #
# Updated at 2017-06-05 09:15:27.073880 # Updated at 2017-06-05 09:21:02.910936
PACKAGE ?= bonobo PACKAGE ?= bonobo
PYTHON ?= $(shell which python) PYTHON ?= $(shell which python)

View File

@ -52,6 +52,6 @@ python.add_requirements(
], ],
jupyter=[ jupyter=[
'jupyter >=1.0,<1.1', 'jupyter >=1.0,<1.1',
'ipywidgets >=6.0.0.beta5', 'ipywidgets >=6.0.0,<7',
] ]
) )

View File

@ -42,7 +42,7 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
/************************************************************************/ /************************************************************************/
/******/ ([ /******/ ([
/* 0 */ /* 0 */
/***/ function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
// Entry point for the unpkg bundle containing custom model definitions. // Entry point for the unpkg bundle containing custom model definitions.
// //
@ -55,14 +55,13 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
module.exports['version'] = __webpack_require__(4).version; module.exports['version'] = __webpack_require__(4).version;
/***/ }, /***/ }),
/* 1 */ /* 1 */
/***/ function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
var widgets = __webpack_require__(2); var widgets = __webpack_require__(2);
var _ = __webpack_require__(3); var _ = __webpack_require__(3);
// Custom Model. Custom widgets models must at least provide default values // Custom Model. Custom widgets models must at least provide default values
// for model attributes, including `_model_name`, `_view_name`, `_model_module` // for model attributes, including `_model_name`, `_view_name`, `_model_module`
// and `_view_module` when different from the base class. // and `_view_module` when different from the base class.
@ -102,15 +101,15 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
}; };
/***/ }, /***/ }),
/* 2 */ /* 2 */
/***/ function(module, exports) { /***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ }, /***/ }),
/* 3 */ /* 3 */
/***/ function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3
// http://underscorejs.org // http://underscorejs.org
@ -1662,9 +1661,9 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
}.call(this)); }.call(this));
/***/ }, /***/ }),
/* 4 */ /* 4 */
/***/ function(module, exports) { /***/ (function(module, exports) {
module.exports = { module.exports = {
"name": "bonobo-jupyter", "name": "bonobo-jupyter",
@ -1696,6 +1695,6 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
} }
}; };
/***/ } /***/ })
/******/ ])});; /******/ ])});;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
var widgets = require('jupyter-js-widgets'); var widgets = require('jupyter-js-widgets');
var _ = require('underscore'); var _ = require('underscore');
// Custom Model. Custom widgets models must at least provide default values // Custom Model. Custom widgets models must at least provide default values
// for model attributes, including `_model_name`, `_view_name`, `_model_module` // for model attributes, including `_model_name`, `_view_name`, `_model_module`
// and `_view_module` when different from the base class. // and `_view_module` when different from the base class.

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,8 @@ class JupyterOutputPlugin(Plugin):
IPython.core.display.display(self.widget) IPython.core.display.display(self.widget)
def run(self): def run(self):
self.widget.value = [repr(node) for node in self.context.parent.nodes] self.widget.value = [
str(self.context.parent[i]) for i in self.context.parent.graph.topologically_sorted_indexes
]
finalize = run finalize = run

View File

@ -42,7 +42,7 @@ define(function() { return /******/ (function(modules) { // webpackBootstrap
/************************************************************************/ /************************************************************************/
/******/ ([ /******/ ([
/* 0 */ /* 0 */
/***/ function(module, exports) { /***/ (function(module, exports) {
// This file contains the javascript that is run when the notebook is loaded. // This file contains the javascript that is run when the notebook is loaded.
// It contains some requirejs configuration and the `load_ipython_extension` // It contains some requirejs configuration and the `load_ipython_extension`
@ -66,5 +66,5 @@ define(function() { return /******/ (function(modules) { // webpackBootstrap
}; };
/***/ } /***/ })
/******/ ])});; /******/ ])});;

View File

@ -42,7 +42,7 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
/************************************************************************/ /************************************************************************/
/******/ ([ /******/ ([
/* 0 */ /* 0 */
/***/ function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
// Entry point for the notebook bundle containing custom model definitions. // Entry point for the notebook bundle containing custom model definitions.
// //
@ -58,14 +58,13 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
module.exports['version'] = __webpack_require__(4).version; module.exports['version'] = __webpack_require__(4).version;
/***/ }, /***/ }),
/* 1 */ /* 1 */
/***/ function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
var widgets = __webpack_require__(2); var widgets = __webpack_require__(2);
var _ = __webpack_require__(3); var _ = __webpack_require__(3);
// Custom Model. Custom widgets models must at least provide default values // Custom Model. Custom widgets models must at least provide default values
// for model attributes, including `_model_name`, `_view_name`, `_model_module` // for model attributes, including `_model_name`, `_view_name`, `_model_module`
// and `_view_module` when different from the base class. // and `_view_module` when different from the base class.
@ -105,15 +104,15 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
}; };
/***/ }, /***/ }),
/* 2 */ /* 2 */
/***/ function(module, exports) { /***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ }, /***/ }),
/* 3 */ /* 3 */
/***/ function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3
// http://underscorejs.org // http://underscorejs.org
@ -1665,9 +1664,9 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
}.call(this)); }.call(this));
/***/ }, /***/ }),
/* 4 */ /* 4 */
/***/ function(module, exports) { /***/ (function(module, exports) {
module.exports = { module.exports = {
"name": "bonobo-jupyter", "name": "bonobo-jupyter",
@ -1699,6 +1698,6 @@ define(["jupyter-js-widgets"], function(__WEBPACK_EXTERNAL_MODULE_2__) { return
} }
}; };
/***/ } /***/ })
/******/ ])});; /******/ ])});;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ import ipywidgets as widgets
from traitlets import List, Unicode from traitlets import List, Unicode
@widgets.register('bonobo-widget.Bonobo') @widgets.register('bonobo-widget.bonobo')
class BonoboWidget(widgets.DOMWidget): class BonoboWidget(widgets.DOMWidget):
_view_name = Unicode('BonoboView').tag(sync=True) _view_name = Unicode('BonoboView').tag(sync=True)
_model_name = Unicode('BonoboModel').tag(sync=True) _model_name = Unicode('BonoboModel').tag(sync=True)

View File

@ -62,7 +62,7 @@ setup(
'pytest-cov (>= 2.5, < 3.0)', 'pytest-timeout (>= 1, < 2)', 'sphinx (>= 1.6, < 2.0)' 'pytest-cov (>= 2.5, < 3.0)', 'pytest-timeout (>= 1, < 2)', 'sphinx (>= 1.6, < 2.0)'
], ],
'docker': ['bonobo-docker'], 'docker': ['bonobo-docker'],
'jupyter': ['ipywidgets (>= 6.0.0.beta5)', 'jupyter (>= 1.0, < 1.1)'] 'jupyter': ['ipywidgets (>= 6.0.0, < 7)', 'jupyter (>= 1.0, < 1.1)']
}, },
entry_points={ entry_points={
'bonobo.commands': [ 'bonobo.commands': [