Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ksarink committed Mar 5, 2021
2 parents b3a862b + 441f2b4 commit 067ba92
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js build and lint

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
build_and_lint:

runs-on: ubuntu-18.04

strategy:
matrix:
node-version: [ 12.x ]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run build --if-present
# - run: npm test
33 changes: 33 additions & 0 deletions .github/workflows/publish-https.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Node.js publish online @ explorer.photon-ai.com

on:
release:
types: [released]

jobs:
build_and_publish:

runs-on: ubuntu-18.04

strategy:
matrix:
node-version: [ 12.x ]

steps:
- uses: actions/checkout@v2
- name: Setup SSH Key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSHKEY }}"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- name: Upload dist folder
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: rsync -av --delete -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ "${{ secrets.SSHUSER }}"@"${{ secrets.SSHSERVER }}":/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PHOTONAI Explorer
[![Build Status Travis](https://img.shields.io/travis/com/wwu-mmll/photonai_explorer/master)](https://travis-ci.com/github/wwu-mmll/photonai_explorer/branches)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/wwu-mmll/photonai_explorer/Node.js%20build%20and%20lint/master)](https://github.com/wwu-mmll/photonai_explorer/actions)
[![License: AGPLv3](https://img.shields.io/github/license/wwu-mmll/photonai_explorer)](https://github.com/wwu-mmll/photonai_explorer/blob/master/LICENSE)
[![GitHub Release](https://img.shields.io/github/release-date/wwu-mmll/photonai_explorer)](https://github.com/wwu-mmll/photonai_explorer/releases)
[![Twitter Follow](https://img.shields.io/twitter/follow/wwu_mmll?style=social)](https://twitter.com/intent/follow?screen_name=wwu_mmll)
Expand Down
13 changes: 11 additions & 2 deletions src/components/TestedConfigTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@
*/
extractMeanMetrics(metricList) {
let rMetrics = {};
// let metricListordered = Object.keys(metricList).sort().reduce(
// (obj, key) => {
// obj[key] = metricList[key];
// return obj;
// },
// {}
// )
let sortedMetricList = metricList.map(metric => metric.metric_name).sort();
metricList.forEach(metric => {
if (metric.operation.endsWith("mean") && this.metricNames.includes(metric.metric_name))
rMetrics[metric.metric_name] = metric.value
Expand Down Expand Up @@ -131,7 +139,8 @@
if (this.normalisedSearchTerm.startsWith("$")) {
// adv search
let evalQuery = replaceAll(this.currentSearchTerm, "\\$", "this.") // dont use normalised searach term bc some attributes are case sensitive
let evalQuery = replaceAll(this.currentSearchTerm, "\\$", "this.")
// dont use normalised searach term bc some attributes are case sensitive
filter = row => {
let rowCopy = Object.assign({}, row); // create working copy to not mess with table creation
Expand Down Expand Up @@ -234,7 +243,7 @@
*/
metricNames() {
let metricObject = this.hyperpipeInfo.metrics;
return metricObject.sort().slice(0, this.maxAllowedMetrics);
return metricObject.slice(0, this.maxAllowedMetrics);
},
/**
* Returns number of metrics used in analysis
Expand Down
24 changes: 20 additions & 4 deletions src/preprocessing/configInterpreter.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ function tidyJSON(param_value){
return valueArray
}

Number.prototype.countDecimals = function () {
if(Math.floor(this.valueOf()) === this.valueOf()) return 0;
return this.toString().split(".")[1].length || 0;
}

/**
* This function parses a paramter = value string.
* @param {String} parameter Expects something like "SVC=1.23823"
Expand All @@ -278,10 +283,22 @@ function parseParameter(parameter){
outputObject["name"] = splitPair[0].trim();
let rawValue = splitPair[1].trim();
let value_to_set = rawValue;
let parsed_value = parseFloat(rawValue);
if (!isNaN(parsed_value) && !Number.isInteger(rawValue)){
value_to_set = Math.round((parsed_value + Number.EPSILON) * 10000) / 10000;
if (Number.isInteger(rawValue)){
value_to_set = parseInt(rawValue);
}
else{
let parsed_value = parseFloat(rawValue);

if (!isNaN(parsed_value) && !Number.isInteger(rawValue)) {
if (parsed_value.countDecimals() > 4) {
value_to_set = parsed_value.toFixed(4);
} else {
value_to_set = parsed_value;
}
}
}


outputObject["value"] = value_to_set
return outputObject;
}
Expand Down Expand Up @@ -362,5 +379,4 @@ function getAttributesInternal(config, result) {
} else {
result[config.name] = config.value;
}

}
7 changes: 4 additions & 3 deletions src/preprocessing/plotCreation.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function plotPerformance(file) { // TODO integrate into createPlot function? Con
let outputData = {}; // result data

// extract metrics from dummy_results for iteration

(file.hyperpipe_info.metrics).forEach(metricName => {

// Create empty plot
outputData[metricName] = new PlotlyPlot(metricName, [], false);

Expand All @@ -87,8 +87,8 @@ function plotPerformance(file) { // TODO integrate into createPlot function? Con
// add dummy result
// Extracts .MEAN value from metric list
let dummyValueExtractor = (metric) => file.dummy_estimator.metrics_train
.filter((metricObject) => metricObject.metric_name === metric && metricObject.operation.endsWith("mean"))
.map((metricObject) => metricObject.value)[0];
.filter((metricObject) => metricObject.metric_name === metric && metricObject.operation.endsWith("mean"))
.map((metricObject) => metricObject.value)[0];

let dummyResult = dummyValueExtractor(metricName);
shapes.push({
Expand All @@ -104,6 +104,7 @@ function plotPerformance(file) { // TODO integrate into createPlot function? Con
}
})


// add dummy result shapes to plot
outputData[metricName].addStyle("shapes", shapes);

Expand Down

0 comments on commit 067ba92

Please sign in to comment.