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