From dde47436fedeabb9387fa3e7046a8df81d05c3a0 Mon Sep 17 00:00:00 2001 From: Leon KV Date: Mon, 19 Oct 2020 17:05:50 +0200 Subject: [PATCH 01/15] fixed metrics are plotted without dummy --- src/preprocessing/plotCreation.js | 39 +++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/preprocessing/plotCreation.js b/src/preprocessing/plotCreation.js index 20865b5..bff1770 100644 --- a/src/preprocessing/plotCreation.js +++ b/src/preprocessing/plotCreation.js @@ -72,7 +72,8 @@ function plotPerformance(file) { // TODO integrate into createPlot function? Con let outputData = {}; // result data // extract metrics from dummy_results for iteration - Object.keys(file.outer_folds[0].dummy_results.training.metrics).forEach(metricName => { + Object.keys(file.hyperpipe_info.metrics).forEach(metricName => { + metricName = file.hyperpipe_info.metrics[metricName] // Create empty plot outputData[metricName] = new PlotlyPlot(metricName, [], false); @@ -85,23 +86,25 @@ function plotPerformance(file) { // TODO integrate into createPlot function? Con // add dummy result // Extracts .MEAN value from metric list - let dummyValueExtractor = (metric) => file.dummy_estimator.train - .filter((metricObject) => metricObject.metric_name === metric && metricObject.operation.endsWith(".MEAN")) - .map((metricObject) => metricObject.value)[0]; - - let dummyResult = dummyValueExtractor(metricName); - shapes.push({ - type: "line", - xref: "paper", - x0: 0, - y0: dummyResult, - x1: 1, - y1: dummyResult, - line: { - color: "#0e0e1d", - width: 2 - } - }) + if(file.outer_folds[0].dummy_results != null) { + let dummyValueExtractor = (metric) => file.dummy_estimator.train + .filter((metricObject) => metricObject.metric_name === metric && metricObject.operation.endsWith(".MEAN")) + .map((metricObject) => metricObject.value)[0]; + + let dummyResult = dummyValueExtractor(metricName); + shapes.push({ + type: "line", + xref: "paper", + x0: 0, + y0: dummyResult, + x1: 1, + y1: dummyResult, + line: { + color: "#0e0e1d", + width: 2 + } + }) + } // add dummy result shapes to plot outputData[metricName].addStyle("shapes", shapes); From 0b75e70967e90912ad142cd970c2f2a8a34ef1b1 Mon Sep 17 00:00:00 2001 From: Ramona Leenings Date: Wed, 24 Feb 2021 17:38:10 +0100 Subject: [PATCH 02/15] removed merge bug and tested config table header metric confusion --- src/components/TestedConfigTable.vue | 13 ++++++++-- src/preprocessing/configInterpreter.js | 24 ++++++++++++++--- src/preprocessing/plotCreation.js | 36 ++++++++++++-------------- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/src/components/TestedConfigTable.vue b/src/components/TestedConfigTable.vue index faf997f..9085a0a 100644 --- a/src/components/TestedConfigTable.vue +++ b/src/components/TestedConfigTable.vue @@ -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 @@ -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 @@ -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 diff --git a/src/preprocessing/configInterpreter.js b/src/preprocessing/configInterpreter.js index c451c9a..b697e21 100644 --- a/src/preprocessing/configInterpreter.js +++ b/src/preprocessing/configInterpreter.js @@ -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" @@ -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; } @@ -362,5 +379,4 @@ function getAttributesInternal(config, result) { } else { result[config.name] = config.value; } - } \ No newline at end of file diff --git a/src/preprocessing/plotCreation.js b/src/preprocessing/plotCreation.js index a396008..a5ad6bf 100644 --- a/src/preprocessing/plotCreation.js +++ b/src/preprocessing/plotCreation.js @@ -86,26 +86,24 @@ 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]; + + let dummyResult = dummyValueExtractor(metricName); + shapes.push({ + type: "line", + xref: "paper", + x0: 0, + y0: dummyResult, + x1: 1, + y1: dummyResult, + line: { + color: "#0e0e1d", + width: 2 + } + }) - if(file.outer_folds[0].dummy_results != null) { - let dummyValueExtractor = (metric) => file.dummy_estimator.train - .filter((metricObject) => metricObject.metric_name === metric && metricObject.operation.endsWith(".MEAN")) - .map((metricObject) => metricObject.value)[0]; - - let dummyResult = dummyValueExtractor(metricName); - shapes.push({ - type: "line", - xref: "paper", - x0: 0, - y0: dummyResult, - x1: 1, - y1: dummyResult, - line: { - color: "#0e0e1d", - width: 2 - } - }) - } // add dummy result shapes to plot outputData[metricName].addStyle("shapes", shapes); From fb1037fe00980fe9d212c79bb271ced65329ae0a Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Wed, 3 Mar 2021 12:31:56 +0100 Subject: [PATCH 03/15] init GitHub actions (node build & lint) --- .github/workflows/nodejs.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..45557d0 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -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, test ] + 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 From 691ba6909855ee33d34bd6ca04904aee7a172edb Mon Sep 17 00:00:00 2001 From: Kelvin Sarink <2464969+ksarink@users.noreply.github.com> Date: Thu, 4 Mar 2021 16:55:48 +0100 Subject: [PATCH 04/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d681bd0..5c655a0 100644 --- a/README.md +++ b/README.md @@ -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) From f6141e848d3aad6408df46c02a25aa2c9b26ef6f Mon Sep 17 00:00:00 2001 From: Kelvin Sarink <2464969+ksarink@users.noreply.github.com> Date: Thu, 4 Mar 2021 17:01:45 +0100 Subject: [PATCH 05/15] Create manual.yml --- .github/workflows/manual.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..47f24e1 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,30 @@ +# This is a basic workflow that is manually triggered + +name: Manual workflow + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Person to greet' + # Default value if no value is explicitly provided + default: 'World' + # Input has to be provided for the workflow to run + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send greeting + run: echo "Hello ${{ github.event.inputs.name }}" From 5154051e3de1309cd45230de7f79425e0f6fb7e2 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink <2464969+ksarink@users.noreply.github.com> Date: Thu, 4 Mar 2021 17:04:09 +0100 Subject: [PATCH 06/15] Delete manual.yml --- .github/workflows/manual.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml deleted file mode 100644 index 47f24e1..0000000 --- a/.github/workflows/manual.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This is a basic workflow that is manually triggered - -name: Manual workflow - -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. -on: - workflow_dispatch: - # Inputs the workflow accepts. - inputs: - name: - # Friendly description to be shown in the UI instead of 'name' - description: 'Person to greet' - # Default value if no value is explicitly provided - default: 'World' - # Input has to be provided for the workflow to run - required: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "greet" - greet: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Runs a single command using the runners shell - - name: Send greeting - run: echo "Hello ${{ github.event.inputs.name }}" From 66f08c7a258ded7e04cb93dd19bba279f1d263f6 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 15:26:35 +0100 Subject: [PATCH 07/15] removed actions on test branch --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 45557d0..83383ca 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,7 +5,7 @@ name: Node.js build and lint on: push: - branches: [ master, develop, test ] + branches: [ master, develop ] pull_request: branches: [ master, develop ] From 917f86d47da0c453001a53774f9b173b7ef977d8 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 15:27:33 +0100 Subject: [PATCH 08/15] add deployment @ explorer.photon-ai.com --- .github/workflows/publish-https.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish-https.yml diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml new file mode 100644 index 0000000..0ded15c --- /dev/null +++ b/.github/workflows/publish-https.yml @@ -0,0 +1,32 @@ +name: Nodejs publish online @ explorer.photon-ai.com + +on: + release: + types: [published] + +jobs: + build_and_publish: + + 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 build --if-present + - name: Prepare ssh key + run: | + eval "$(ssh-agent -s)" + mkdir ./tmp/ + echo $SSHKEY | base64 -d > ./tmp/sshkey + chmod 600 ./tmp/sshkey + ssh-add ./tmp/sshkey + - name: Upload dist folder + run: rsync -av -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ $SSHUSER@$SSHSERVER:/ From 94372e43b56447afe73e02fdbb0832664832e11a Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 15:31:29 +0100 Subject: [PATCH 09/15] fix indentation --- .github/workflows/publish-https.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index 0ded15c..ff924e6 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -23,10 +23,10 @@ jobs: - run: npm run build --if-present - name: Prepare ssh key run: | - eval "$(ssh-agent -s)" - mkdir ./tmp/ - echo $SSHKEY | base64 -d > ./tmp/sshkey - chmod 600 ./tmp/sshkey - ssh-add ./tmp/sshkey + eval "$(ssh-agent -s)" + mkdir ./tmp/ + echo $SSHKEY | base64 -d > ./tmp/sshkey + chmod 600 ./tmp/sshkey + ssh-add ./tmp/sshkey - name: Upload dist folder run: rsync -av -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ $SSHUSER@$SSHSERVER:/ From 1a5613ea49487782dde8538c7bed995ff58cf0be Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 15:40:55 +0100 Subject: [PATCH 10/15] add check for ssh key --- .github/workflows/publish-https.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index ff924e6..a52b8f8 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -27,6 +27,7 @@ jobs: mkdir ./tmp/ echo $SSHKEY | base64 -d > ./tmp/sshkey chmod 600 ./tmp/sshkey + head -n1 ./tmp/sshkey ssh-add ./tmp/sshkey - name: Upload dist folder run: rsync -av -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ $SSHUSER@$SSHSERVER:/ From 9d4e624d318833be95ab146622dab19e9a787982 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 15:56:55 +0100 Subject: [PATCH 11/15] change trigger for testing purposes --- .github/workflows/publish-https.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index a52b8f8..28838a6 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -1,8 +1,11 @@ name: Nodejs publish online @ explorer.photon-ai.com +# on: +# release: +# types: [published] on: - release: - types: [published] + push: + branches: [ github-actions ] jobs: build_and_publish: From 8aa4e63cf21b139d3835d81eaaebc037ba55b101 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 15:57:09 +0100 Subject: [PATCH 12/15] change access to secrets --- .github/workflows/publish-https.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index 28838a6..acde439 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -18,19 +18,19 @@ jobs: 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: Prepare ssh key - run: | - eval "$(ssh-agent -s)" - mkdir ./tmp/ - echo $SSHKEY | base64 -d > ./tmp/sshkey - chmod 600 ./tmp/sshkey - head -n1 ./tmp/sshkey - ssh-add ./tmp/sshkey - name: Upload dist folder - run: rsync -av -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ $SSHUSER@$SSHSERVER:/ + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: rsync -av -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ "${{ secrets.SSHUSER }}"@"${{ secrets.SSHSERVER }}":/test/ From 2bbbeeaa624746528d8adf051fea719adc765c61 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 16:03:53 +0100 Subject: [PATCH 13/15] add delete to rsync (to remove extraneous files) --- .github/workflows/publish-https.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index acde439..7406e26 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -33,4 +33,4 @@ jobs: - name: Upload dist folder env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock - run: rsync -av -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ "${{ secrets.SSHUSER }}"@"${{ secrets.SSHSERVER }}":/test/ + run: rsync -av --delete -e 'ssh -o StrictHostKeyChecking=no -o LogLevel=ERROR' ./dist/ "${{ secrets.SSHUSER }}"@"${{ secrets.SSHSERVER }}":/ From 1b26c2ff9f171485584ee9c4a67b84809fd8b965 Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 16:22:05 +0100 Subject: [PATCH 14/15] change trigger to released version of the explorer --- .github/workflows/publish-https.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index 7406e26..716bb68 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -1,11 +1,8 @@ name: Nodejs publish online @ explorer.photon-ai.com -# on: -# release: -# types: [published] on: - push: - branches: [ github-actions ] + release: + types: [released] jobs: build_and_publish: From 0f88c50aee5af1e941e3f201aa7605cf7d8cc80e Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Fri, 5 Mar 2021 16:57:15 +0100 Subject: [PATCH 15/15] name update --- .github/workflows/publish-https.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-https.yml b/.github/workflows/publish-https.yml index 716bb68..d6fdbe7 100644 --- a/.github/workflows/publish-https.yml +++ b/.github/workflows/publish-https.yml @@ -1,4 +1,4 @@ -name: Nodejs publish online @ explorer.photon-ai.com +name: Node.js publish online @ explorer.photon-ai.com on: release: