From 04a4693039dc1d00e1499b43ac77421166bff20b Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Fri, 10 May 2024 19:07:54 +0200 Subject: [PATCH 01/12] enh: fix table error --- results/within_session_mi_left_vs_right_hand.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/results/within_session_mi_left_vs_right_hand.csv b/results/within_session_mi_left_vs_right_hand.csv index 46ac00d57..163dd536f 100644 --- a/results/within_session_mi_left_vs_right_hand.csv +++ b/results/within_session_mi_left_vs_right_hand.csv @@ -10,7 +10,7 @@ Pipeline,:class:`BNCI2014_001`,:class:`BNCI2014_004`,:class:`Cho2017`,:class:`Gr `EEGTCNet`_,67.46±20.81,69.70±19.55,58.34±12.63,68.45±16.27,55.68±12.75,55.90±12.74,75.62±22.33,51.26±16.77,63.16±18.32,82.24±9.40 `FilterBank+SVM`_,84.44±16.00,80.39±16.05,67.91±15.63,79.65±18.63,75.07±16.97,58.45±13.93,81.44±17.89,65.63±21.64,76.81±18.88,92.64±5.01 `FgMDM`_,86.53±12.14,79.28±15.25,72.90±12.70,87.02±13.20,81.34±13.93,68.46±19.06,86.71±13.79,70.86±23.36,78.41±14.85,92.54±6.67 -`LogVariance+LDA`_,77.96±15.09,78.51±15.25,64.49±10.08,78.71±11.69,66.21±12.06,61.94±14.41,78.44±13.76,61.78±22.77,74.13±10.40,88.39±8.57, +`LogVariance+LDA`_,77.96±15.09,78.51±15.25,64.49±10.08,78.71±11.69,66.21±12.06,61.94±14.41,78.44±13.76,61.78±22.77,74.13±10.40,88.39±8.57 `LogVariance+SVM`_,75.86±16.45,78.30±15.18,65.46±11.71,81.73±12.40,73.83±13.85,62.35±16.87,79.42±13.66,61.38±22.68,74.85±11.33,88.47±8.50 `MDM`_,81.69±14.94,77.66±15.78,63.39±13.69,64.29±8.04,70.23±13.87,54.76±16.79,61.53±16.41,62.99±21.25,58.80±16.13,90.70±7.11 `ShallowConvNet`_,86.17±13.74,72.36±18.05,73.84±14.95,86.53±13.00,75.83±15.04,65.19±15.80,84.82±15.29,60.80±19.27,79.10±12.63,95.65±5.55 From 2e00eaa965be9d8c332f5a3fcf463d7c24b8c03b Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Fri, 10 May 2024 19:08:25 +0200 Subject: [PATCH 02/12] enh: correct font size --- docs/source/paper_results.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/paper_results.rst b/docs/source/paper_results.rst index d596338f0..9a3adfc02 100644 --- a/docs/source/paper_results.rst +++ b/docs/source/paper_results.rst @@ -6,7 +6,7 @@ -
+
.. currentmodule:: moabb.datasets From 82f8297af329f1478c9cc56e804841dd2ea1ae3b Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Fri, 10 May 2024 19:12:08 +0200 Subject: [PATCH 03/12] enh: update what new --- docs/source/whats_new.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/whats_new.rst b/docs/source/whats_new.rst index 8fd3d70b0..d987c9618 100644 --- a/docs/source/whats_new.rst +++ b/docs/source/whats_new.rst @@ -48,6 +48,7 @@ Bugs - MAINT updating the packages pre-release (:gh:`578` by `Bruno Aristimunha`_) - Updating the parameters of the SSVEP_TRCA method (:gh:`589` by `Bruno Aristimunha`_) - Fix and updating the parameters for the benchmark function (:gh:`588` by `Bruno Aristimunha`_) +- Fix result table display (:gh:`599` by `Sylvain Chevallier`_) API changes From f8b6ff5bac29b1b8c1fe13f90d9324e36592bfc7 Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Wed, 15 May 2024 23:53:55 +0200 Subject: [PATCH 04/12] enh: add csv to json converter --- results/csv_json_results_converter.py | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 results/csv_json_results_converter.py diff --git a/results/csv_json_results_converter.py b/results/csv_json_results_converter.py new file mode 100644 index 000000000..50cfbdfe2 --- /dev/null +++ b/results/csv_json_results_converter.py @@ -0,0 +1,38 @@ +import argparse +import csv +import json +import pathlib + + +def csv_to_json(source_file, output_file): + jsonArray = [] + + with open(source_file, encoding="utf-8") as csvf: + # load csv file data using csv reader + csvReader = csv.reader(csvf) + for row in csvReader: + jsonArray.append(row) + + # remove ` and trailing _ + for e in jsonArray[1:]: + e[0] = e[0].split("`")[1] + + # remove column names + jsonArray = {"data": jsonArray[1:]} + + with open(output_file, "w", encoding="utf-8") as jsonf: + jsonString = json.dumps(jsonArray, indent=4) + jsonf.write(jsonString) + jsonf.write("") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + prog="csv_json_results_converter.py", + description="Convert CSV results file in JSON for doc generation", + ) + parser.add_argument("source_file", type=pathlib.Path, help="CSV result file") + args = parser.parse_args() + output_file = args.source_file.with_suffix(".json") + + csv_to_json(args.source_file, output_file) From d29eb9007360a4f515b4312092a1b27c25a8a6fa Mon Sep 17 00:00:00 2001 From: Salim Khazem Macbook-Pro Date: Thu, 16 May 2024 15:32:39 +0200 Subject: [PATCH 05/12] Adding script to convert csv to json --- results/csv2json.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 results/csv2json.py diff --git a/results/csv2json.py b/results/csv2json.py new file mode 100644 index 000000000..bb72b5c75 --- /dev/null +++ b/results/csv2json.py @@ -0,0 +1,39 @@ +import sys +import csv +import json +import pathlib + + +def csv2json(source_file, output_file): + jsonArray = [] + + with open(source_file, encoding="utf-8") as csvf: + # load csv file data using csv reader + csvReader = csv.reader(csvf) + for row in csvReader: + jsonArray.append(row) + + # remove ` and trailing _ + for e in jsonArray[1:]: + e[0] = e[0].split("`")[1] + + # remove column names + jsonArray = {"data": jsonArray[1:]} + + with open(output_file, "w", encoding="utf-8") as jsonf: + jsonString = json.dumps(jsonArray, indent=4) + jsonf.write(jsonString) + jsonf.write("") + + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python csv2json.py ") + sys.exit(1) + input = pathlib.Path(sys.argv[1]) + if not input.exists(): + print(f"File {input} does not exist.") + sys.exit(1) + output = input.with_suffix(".json") + + csv2json(input, output) From 5194034735a5b564e5ac004619bea485bbdd347c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 13:33:02 +0000 Subject: [PATCH 06/12] [pre-commit.ci] auto fixes from pre-commit.com hooks --- results/csv2json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/results/csv2json.py b/results/csv2json.py index bb72b5c75..2f426663a 100644 --- a/results/csv2json.py +++ b/results/csv2json.py @@ -1,7 +1,7 @@ -import sys import csv import json import pathlib +import sys def csv2json(source_file, output_file): From cfb2b6e2744b60175c7033e88321b94d74e55a2b Mon Sep 17 00:00:00 2001 From: Salim Khazem Macbook-Pro Date: Thu, 16 May 2024 15:40:36 +0200 Subject: [PATCH 07/12] generate json for the fixed version of csv --- results/within_session_mi_left_vs_right_hand.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/results/within_session_mi_left_vs_right_hand.json b/results/within_session_mi_left_vs_right_hand.json index 5ffb6f996..821356edb 100644 --- a/results/within_session_mi_left_vs_right_hand.json +++ b/results/within_session_mi_left_vs_right_hand.json @@ -248,4 +248,4 @@ "93.37\u00b16.30" ] ] -} +} \ No newline at end of file From fcebe38e09387c3d54b9f393ac7944fd4b38377b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 13:44:02 +0000 Subject: [PATCH 08/12] [pre-commit.ci] auto fixes from pre-commit.com hooks --- results/within_session_mi_left_vs_right_hand.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/results/within_session_mi_left_vs_right_hand.json b/results/within_session_mi_left_vs_right_hand.json index 821356edb..5ffb6f996 100644 --- a/results/within_session_mi_left_vs_right_hand.json +++ b/results/within_session_mi_left_vs_right_hand.json @@ -248,4 +248,4 @@ "93.37\u00b16.30" ] ] -} \ No newline at end of file +} From 7ce222e8d9b1736f0adfc62be1cd5d2463a05d58 Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Thu, 30 May 2024 20:38:00 +0200 Subject: [PATCH 09/12] fix: use only 1 json converter --- results/csv2json.py | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 results/csv2json.py diff --git a/results/csv2json.py b/results/csv2json.py deleted file mode 100644 index 2f426663a..000000000 --- a/results/csv2json.py +++ /dev/null @@ -1,39 +0,0 @@ -import csv -import json -import pathlib -import sys - - -def csv2json(source_file, output_file): - jsonArray = [] - - with open(source_file, encoding="utf-8") as csvf: - # load csv file data using csv reader - csvReader = csv.reader(csvf) - for row in csvReader: - jsonArray.append(row) - - # remove ` and trailing _ - for e in jsonArray[1:]: - e[0] = e[0].split("`")[1] - - # remove column names - jsonArray = {"data": jsonArray[1:]} - - with open(output_file, "w", encoding="utf-8") as jsonf: - jsonString = json.dumps(jsonArray, indent=4) - jsonf.write(jsonString) - jsonf.write("") - - -if __name__ == "__main__": - if len(sys.argv) != 2: - print("Usage: python csv2json.py ") - sys.exit(1) - input = pathlib.Path(sys.argv[1]) - if not input.exists(): - print(f"File {input} does not exist.") - sys.exit(1) - output = input.with_suffix(".json") - - csv2json(input, output) From 9b4c61c956ae1a0f48a5cd3ac8fc74890edfcd82 Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Sun, 9 Jun 2024 16:39:45 +0200 Subject: [PATCH 10/12] fix: correct table results in docs --- docs/source/paper_results.rst | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/source/paper_results.rst b/docs/source/paper_results.rst index 9a3adfc02..c5d74f949 100644 --- a/docs/source/paper_results.rst +++ b/docs/source/paper_results.rst @@ -68,20 +68,16 @@ Motor Imagery - Left vs Right Hand - @@ -89,6 +85,7 @@ Motor Imagery - Left vs Right Hand + Motor Imagery - Right Hand vs Feet ================================== @@ -119,7 +116,7 @@ Motor Imagery - Right Hand vs Feet