Unverified Commit 2f5272c7 authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Merge pull request #208 from microsoft/master

merge master
parents c785655e 7a20792a
......@@ -262,16 +262,10 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
<div>
{/* style in para.scss */}
<Row className="meline intermediate">
{/* filter message */}
<span>Filter</span>
<Switch
defaultChecked={false}
onChange={this.switchTurn}
/>
{
isFilter
?
<span>
<span style={{marginRight: 15}}>
<span className="filter-x"># Intermediate result</span>
<input
// placeholder="point"
......@@ -300,6 +294,12 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
:
null
}
{/* filter message */}
<span>Filter</span>
<Switch
defaultChecked={false}
onChange={this.switchTurn}
/>
</Row>
<Row className="intermediate-graph">
<ReactEcharts
......
......@@ -251,13 +251,15 @@ class TableList extends React.Component<TableListProps, TableListState> {
const showColumn: Array<object> = [];
// parameter as table column
const parameterStr: Array<string> = [];
if (tableSource.length > 0) {
const trialMess = TRIALS.getTrial(tableSource[0].id);
const trial = trialMess.description.parameters;
const parameterColumn: Array<string> = Object.keys(trial);
const parameterStr: Array<string> = [];
parameterColumn.forEach(value => {
parameterStr.push(`${value} (search space)`);
});
}
showTitle = COLUMNPro.concat(parameterStr);
// only succeed trials have final keys
......@@ -330,20 +332,35 @@ class TableList extends React.Component<TableListProps, TableListState> {
<Icon type="line-chart" />
</Button>
{/* kill job */}
{
flag
?
<Button
type="default"
disabled={true}
className="margin-mediate special"
title="kill"
>
<Icon type="stop" />
</Button>
:
<Popconfirm
title="Are you sure to cancel this trial?"
okText="Yes"
cancelText="No"
onConfirm={killJob.
bind(this, record.key, record.id, record.status)}
>
<Button
type="default"
disabled={flag}
disabled={false}
className="margin-mediate special"
title="kill"
>
<Icon type="stop" />
</Button>
</Popconfirm>
}
</Row>
);
},
......
......@@ -43,7 +43,7 @@ class Trial implements TableObj {
}
get sortable(): boolean {
return this.finalAcc !== undefined && !isNaN(this.finalAcc);
return this.metricsInitialized && this.finalAcc !== undefined && !isNaN(this.finalAcc);
}
/* table obj start */
......@@ -132,7 +132,7 @@ class Trial implements TableObj {
/* table obj end */
public initialized(): boolean {
return !!(this.infoField && this.metricsInitialized);
return Boolean(this.infoField);
}
public updateMetrics(metrics: MetricDataRecord[]): boolean {
......
......@@ -6,7 +6,7 @@ Button.tableButton{
border-color: $btnBgcolor;
height: 26px;
font-size: 14px;
margin-top: 2px;
margin-top: 4px;
border-radius: 0;
}
......
......@@ -25,8 +25,9 @@
height: 100%;
}
/* log drawer download & close button's row */
.buttons{
margin-top: 11px;
margin-top: 16px;
.close{
text-align: right;
}
......
......@@ -21,7 +21,7 @@ $drowHoverBgColor: #e2e2e2;
padding-bottom: 14px;
.down-icon{
font-size: 20px !important;
padding-right: 2px;
padding-right: 6px;
}
}
......@@ -186,6 +186,11 @@ $drowHoverBgColor: #e2e2e2;
width: 20px;
margin-right: 8px;
}
/* ? icon style */
.question{
width: 14px;
margin-right: 4px;
}
.feedback{
font-size: 16px;
margin: 0 20px;
......
......@@ -15,10 +15,12 @@
.ant-tabs-tab-active{
.panelTitle{
background-color: #999;
/*
span{
color: #fff;
font-weight: normal;
}
*/
}
}
.panelTitle{
......
......@@ -5,8 +5,9 @@ import signal
import psutil
from .common_utils import print_error, print_normal, print_warning
def check_output_command(file_path, head=None, tail=None):
'''call check_output command to read content from a file'''
"""call check_output command to read content from a file"""
if os.path.exists(file_path):
if sys.platform == 'win32':
cmds = ['powershell.exe', 'type', file_path]
......@@ -26,8 +27,9 @@ def check_output_command(file_path, head=None, tail=None):
print_error('{0} does not exist!'.format(file_path))
exit(1)
def kill_command(pid):
'''kill command'''
"""kill command"""
if sys.platform == 'win32':
process = psutil.Process(pid=pid)
process.send_signal(signal.CTRL_BREAK_EVENT)
......@@ -35,21 +37,35 @@ def kill_command(pid):
cmds = ['kill', str(pid)]
call(cmds)
def install_package_command(package_name):
'''install python package from pip'''
#TODO refactor python logic
if sys.platform == "win32":
cmds = 'python -m pip install --user {0}'.format(package_name)
else:
cmds = 'python3 -m pip install --user {0}'.format(package_name)
call(cmds, shell=True)
"""
Install python package from pip.
Parameters
----------
package_name: str
The name of package to be installed.
"""
call(_get_pip_install() + [package_name], shell=False)
def install_requirements_command(requirements_path):
'''install requirements.txt'''
cmds = 'cd ' + requirements_path + ' && {0} -m pip install --user -r requirements.txt'
#TODO refactor python logic
if sys.platform == "win32":
cmds = cmds.format('python')
else:
cmds = cmds.format('python3')
call(cmds, shell=True)
"""
Install packages from `requirements.txt` in `requirements_path`.
Parameters
----------
requirements_path: str
Path to the directory that contains `requirements.txt`.
"""
call(_get_pip_install() + ["-r", os.path.join(requirements_path, "requirements.txt")], shell=False)
def _get_pip_install():
python = "python" if sys.platform == "win32" else "python3"
ret = [python, "-m", "pip", "install"]
if "CONDA_DEFAULT_ENV" not in os.environ and "VIRTUAL_ENV" not in os.environ and \
(sys.platform != "win32" and os.getuid() != 0): # on unix and not running in root
ret.append("--user") # not in virtualenv or conda
return ret
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment