Skip to content

Commit

Permalink
deleted CancerDiscover, switching to pure python implementations, fun…
Browse files Browse the repository at this point in the history
…ctional pipeline upto cross-validation
  • Loading branch information
achillesrasquinha committed Aug 2, 2017
1 parent e6f4c0a commit da4c8d9
Show file tree
Hide file tree
Showing 28 changed files with 446 additions and 404 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion CancerDiscover
Submodule CancerDiscover deleted from 12212f
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ $ candis --cdata path/to/data.cdata --config path/to/config.json
```

Then, simply use the `CData.toARFF` API:

```python
>>> cdata.toARFF('path/to/data.arff')
```
Expand Down
9 changes: 5 additions & 4 deletions candis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# module - candis
from candis.config import Config, get_config, CONFIG
from candis.ios import cdata, pipeline
from candis.ios.cdata import CData
from candis.config import Config, get_config, CONFIG
from candis.ios.cdata import CData
from candis.ios.pipeline import Pipeline
from candis.ios import cdata, pipeline
# candis.cli
from candis.cli import main
from candis.cli import main

__version__ = CONFIG.VERSION
198 changes: 124 additions & 74 deletions candis/app/assets/js/bundle.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -10675,7 +10675,10 @@ var ActionType = {
Asynchronous: {
WRITE_REQUEST: 'ACTION_TYPE_ASYNCHRONOUS_WRITE_REQUEST',
WRITE_SUCCESS: 'ACTION_TYPE_ASYNCHRONOUS_WRITE_SUCCESS',
WRITE_ERROR: 'ACTION_TYPE_ASYNCHRONOUS_WRITE_ERROR'
WRITE_ERROR: 'ACTION_TYPE_ASYNCHRONOUS_WRITE_ERROR',
GET_RESOURCE_REQUEST: 'ACTION_TYPE_GET_RESOURCE_REQUEST',
GET_RESOURCE_SUCCESS: 'ACTION_TYPE_GET_RESOURCE_SUCCESS',
GET_RESOURCE_ERROR: 'ACTION_TYPE_GET_RESOURCE_ERROR'
},

Modal: {
Expand Down Expand Up @@ -16616,12 +16619,14 @@ var write = function write(output) {

_dispatch(action);

return _axios2.default.post(_config2.default.routes.api.data.write, parameters).then(function (response) {
response = response.data;
return _axios2.default.post(_config2.default.routes.api.data.write, parameters).then(function (_ref) {
var data = _ref.data;

var response = data;

if (response.status == "success") {
var data = response.data;
var _action = successWrite(output, buffer, data);
var _data = response.data;
var _action = successWrite(output, buffer, _data);

_dispatch(_action);
} else if (response.status == "error") {
Expand Down Expand Up @@ -16670,33 +16675,66 @@ var errorWrite = function errorWrite(output, buffer, error) {
return action;
};

// RAW
var getResource = function getResource(dispatch) {
dispatch({
type: _ActionType2.default.GET_RESOURCE_REQUEST
});
var getResource = function getResource() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

_axios2.default.post(_config2.default.routes.api.data.resource).then(function (response) {
response = response.data;
var dispatch = function dispatch(_dispatch2) {
var action = getResourceRequest(path);
var parameters = { path: path };

if (response.status == "success") {
var data = response.data;
var action = {
type: _ActionType2.default.GET_RESOURCE_SUCCESS,
payload: data
};
_dispatch2(action);

dispatch(action);
} else {
var _action3 = {
type: _ActionType2.default.GET_RESOURCE_ERROR
};
_axios2.default.get(_config2.default.routes.api.data.resource, parameters).then(function (_ref2) {
var data = _ref2.data;

dispatch(_action3);
}
});
var response = data;

if (response.status == "success") {
var _data2 = response.data;
var _action3 = getResourceSuccess(path, _data2);

_dispatch2(_action3);
} else if (response.status == "error") {
var error = response.error;
var _action4 = getResourceError(path, error);

_dispatch2(_action4);
}
});
};

return dispatch;
};

var getResourceRequest = function getResourceRequest(path) {
var payload = { path: path };
var action = {
type: _ActionType2.default.Asynchronous.GET_RESOURCE_REQUEST,
payload: payload
};

return action;
};

var getResourceSuccess = function getResourceSuccess(path, data) {
var payload = { path: path, data: data };
var action = {
type: _ActionType2.default.Asynchronous.GET_RESOURCE_SUCCESS,
payload: payload
};

return action;
};

var getResourceError = function getResourceError(path, error) {
var payload = { path: path, error: error };
var action = {
type: _ActionType2.default.Asynchronous.GET_RESOURCE_ERROR,
payload: payload
};

return action;
};
// end

exports.write = write;
exports.getResource = getResource;
Expand Down Expand Up @@ -81009,7 +81047,6 @@ var app = function app() {
switch (action.type) {
case _ActionType2.default.App.SIGNIN_REQUEST:
case _ActionType2.default.App.SIGNOUT_REQUEST:
case _ActionType2.default.Asynchronous.WRITE_REQUEST:
nprogress.set(0.0);

break;
Expand All @@ -81019,6 +81056,8 @@ var app = function app() {
case _ActionType2.default.App.SIGNOUT_SUCCESS:
case _ActionType2.default.App.SIGNOUT_ERROR:
case _ActionType2.default.Asynchronous.WRITE_SUCCESS:
case _ActionType2.default.Asynchronous.GET_RESOURCE_SUCCESS:
case _ActionType2.default.Asynchronous.GET_RESOURCE_ERROR:
nprogress.set(1.0);

break;
Expand Down Expand Up @@ -102731,9 +102770,9 @@ var dataEditor = function dataEditor() {
return _extends({}, state, { rows: _rows4 });
}

case _ActionType2.default.GET_RESOURCE_SUCCESS:
case _ActionType2.default.Asynchronous.GET_RESOURCE_SUCCESS:
{
var resource = action.payload;
var resource = action.payload.data;
var _columns2 = state.columns.slice();

_columns2.forEach(function (column) {
Expand Down Expand Up @@ -160821,16 +160860,30 @@ var _ActionType2 = _interopRequireDefault(_ActionType);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var initialState = { resource: {} };
var initial = {
resource: null
};
var data = function data() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initial;
var action = arguments[1];

switch (action.type) {
case _ActionType2.default.GET_RESOURCE_SUCCESS:
{
return _extends({}, state, { resource: action.payload });
}
case _ActionType2.default.Asynchronous.WRITE_REQUEST:
case _ActionType2.default.Asynchronous.GET_RESOURCE_REQUEST:
nprogress.set(0.0);

break;

case _ActionType2.default.Asynchronous.WRITE_SUCCESS:
case _ActionType2.default.Asynchronous.WRITE_ERROR:
nprogress.set(1.0);

break;

case _ActionType2.default.Asynchronous.GET_RESOURCE_SUCCESS:
nprogress.set(1.0);

return _extends({}, state, { resource: action.payload.data });
}

return state;
Expand Down Expand Up @@ -164704,8 +164757,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = __webpack_require__(3);
Expand All @@ -164722,6 +164773,10 @@ var _config = __webpack_require__(24);

var _config2 = _interopRequireDefault(_config);

var _ToolBar = __webpack_require__(694);

var _ToolBar2 = _interopRequireDefault(_ToolBar);

var _DataEditorAction = __webpack_require__(702);

var _AsynchronousAction = __webpack_require__(52);
Expand All @@ -164742,28 +164797,27 @@ var DataEditor = function (_React$Component) {

var _this = _possibleConstructorReturn(this, (DataEditor.__proto__ || Object.getPrototypeOf(DataEditor)).call(this, props));

var that = _this;
_this.tools = [{
icon: _config2.default.routes.icons + '/insert-row.png',
tooltip: 'Insert Row',
onClick: function onClick(dispatch) {
var action = (0, _DataEditorAction.insertRow)(that.props.rows);
onClick: function onClick(props, dispatch) {
var action = (0, _DataEditorAction.insertRow)(props.rows);

dispatch(action);
}
}, {
icon: _config2.default.routes.icons + '/insert-column.png',
tooltip: 'Insert Column',
onClick: function onClick(dispatch) {
var action = (0, _DataEditorAction.insertColumn)(that.props.columns);
onClick: function onClick(props, dispatch) {
var action = (0, _DataEditorAction.insertColumn)(props.columns);

dispatch(action);
}
}, {
icon: _config2.default.routes.icons + '/delete-row.png',
tooltip: 'Delete Row',
onClick: function onClick(dispatch) {
that.props.rows.forEach(function (row) {
onClick: function onClick(props, dispatch) {
props.rows.forEach(function (row) {
if (row.selected) {
var action = (0, _DataEditorAction.deleteRow)(row);

Expand All @@ -164778,18 +164832,28 @@ var DataEditor = function (_React$Component) {
}, {
icon: _config2.default.routes.icons + '/reload.png',
tooltip: 'Refresh',
onClick: _AsynchronousAction.getResource
onClick: function onClick(dispatch) {}
}];
return _this;
}

_createClass(DataEditor, [{
key: 'componentWillMount',
value: function componentWillMount() {

var props = this.props;
var action = (0, _AsynchronousAction.getResource)();

props.dispatch(action);
}
}, {
key: 'render',
value: function render() {
var that = this;
var props = this.props;

return _react2.default.createElement(
'div',
{ className: 'wrapper' },
null,
_react2.default.createElement(
'div',
{ className: 'panel panel-default no-background no-border no-shadow' },
Expand All @@ -164799,23 +164863,9 @@ var DataEditor = function (_React$Component) {
_react2.default.createElement(
'div',
{ className: 'text-right' },
this.tools.map(function (tool, index) {
var tooltip = tool.tooltip;
var ttattrs = tooltip ? {
"data-toggle": "tooltip",
"data-placement": "top",
title: tooltip
} : {};

return _react2.default.createElement(
'button',
_extends({ key: index, className: 'btn no-background no-border no-shadow'
}, ttattrs, { onClick: function onClick() {
that.props.dispatch(tool.onClick);
} }),
_react2.default.createElement('img', { width: '20', src: tool.icon })
);
})
_react2.default.createElement(_ToolBar2.default, { tools: this.tools, onClick: function onClick(tool) {
tool.onClick(props, props.dispatch);
} })
)
)
),
Expand All @@ -164825,26 +164875,26 @@ var DataEditor = function (_React$Component) {
_react2.default.createElement(_reactDataGrid2.default, {
ref: 'grid',
enableCellSelect: true,
columns: this.props.columns,
columns: props.columns,
rowGetter: function rowGetter(index) {
return that.props.rows[index];
return props.rows[index];
},
rowsCount: this.props.rows.length,
rowsCount: props.rows.length,
rowSelection: {
showCheckbox: true,
enableShiftSelect: true,
onRowsSelected: function onRowsSelected(rows) {
rows.forEach(function (row) {
var action = (0, _DataEditorAction.selectRow)(row);

that.props.dispatch(action);
props.dispatch(action);
});
},
onRowsDeselected: function onRowsDeselected(rows) {
rows.forEach(function (row) {
var action = (0, _DataEditorAction.deselectRow)(row);

that.props.dispatch(action);
props.dispatch(action);
});
},
selectBy: { isSelectedKey: 'selected' }
Expand All @@ -164854,14 +164904,14 @@ var DataEditor = function (_React$Component) {
toRow = _ref.toRow,
updated = _ref.updated;

that.props.dispatch(function (dispatch) {
props.dispatch(function (dispatch) {
var action = (0, _DataEditorAction.updateRows)(fromRow, toRow, updated);

dispatch(action);

that.props.onChangeData({
columns: that.props.columns,
rows: that.props.rows
props.onChangeData({
columns: props.columns,
rows: props.rows
});
});
} })
Expand Down
Loading

0 comments on commit da4c8d9

Please sign in to comment.