From 66f0b9cfa4799b1fee57416338f7d564bad68950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 21:20:23 +0100 Subject: [PATCH 01/27] Added test timing. Blocking some long running tests to ease further development --- .gitignore | 2 + caseologue_python/caseologue.py | 46 +++++++++++++++---- .../output_caseologue_timing_example.tsv | 21 +++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 caseologue_python/output_caseologue_timing_example.tsv diff --git a/.gitignore b/.gitignore index f25bece..90eb34d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ robot_config/report_profile.tsv caseologue_python/output_caseologue.tsv caseologue_python/test/output_caseologue.tsv +caseologue_python/output_caseologue_timing.tsv +caseologue_python/test/output_caseologue_timing.tsv **/__pycache__/ docs/_build/ robot_config/robot.jar diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index c822bc8..c4c2cd7 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1,4 +1,5 @@ import unittest +import time from rdflib import OWL, ConjunctiveGraph, Namespace import os import pandas as pd @@ -11,7 +12,6 @@ # from rich_dataframe import prettify from queries.edamxpath_id_unique import check_unique_id - def parsing(): parser = argparse.ArgumentParser( @@ -67,20 +67,20 @@ def suite(): if run_essential == True: suite.addTest(EdamQueryTest("test_super_class_refers_to_self")) - suite.addTest(EdamQueryTest("test_bad_uri_reference")) + # suite.addTest(EdamQueryTest("test_bad_uri_reference")) # t -> x suite.addTest(EdamQueryTest("test_empty_property")) suite.addTest(EdamQueryTest("test_id_unique")) suite.addTest(EdamQueryTest("test_spelling_check")) if run_error == True: - suite.addTest(EdamQueryTest("test_mandatory_property_missing")) + # suite.addTest(EdamQueryTest("test_mandatory_property_missing")) # t -> x suite.addTest(EdamQueryTest("test_deprecated_replacement")) suite.addTest(EdamQueryTest("test_missing_deprecated_property")) suite.addTest(EdamQueryTest("test_next_id_modif")) suite.addTest(EdamQueryTest("test_subset_id")) suite.addTest(EdamQueryTest("test_object_relation_obsolete")) suite.addTest(EdamQueryTest("test_bad_uri")) - suite.addTest(EdamQueryTest("test_duplicate_in_concept")) + # suite.addTest(EdamQueryTest("test_duplicate_in_concept")) # t -> x return suite @@ -103,8 +103,32 @@ def setUpClass(cls): cls.report = pd.DataFrame( columns=["Level", "Test Name", "Entity", "Label", "Debug Message"] ) + cls.timing = pd.DataFrame( + columns=["Test Name", "Time"] + ) # print(cls.report) + def setUp(self): + """Start a timer before each test""" + self.start_time = time.time() + + def tearDown(self): + """Stop the timer after each test and record the time taken.""" + end_time = time.time() + elapsed_time = end_time - self.start_time + # Append the timing to the class's timing DataFrame + test_name = self.id().split('.')[-1] # This gets the name of the current test method + #print(type(self.__class__.timing)) + #print(type(self.timing)) + print({"Test Name": test_name, "Time": elapsed_time}) + timing_info_df = pd.DataFrame([{ + "Test Name": test_name, + "Time": elapsed_time + }]) + self.__class__.timing = pd.concat( + [self.__class__.timing, timing_info_df], ignore_index=True + ) + ################# DEPRECATED REPLACEMENT OBSOLETE ########################### def test_deprecated_replacement_obsolete(self): @@ -230,7 +254,7 @@ def test_bad_uri(self): ################# MANDATORY PROPERTY MISSING ########################### - def test_mandatory_property_missing(self): + def xest_mandatory_property_missing(self): """ Checks that no mandatory property for all concepts are missing (oboInOwl:hasDefinition, rdfs:subClassOf, created_in, oboInOwl:inSubset, rdfs:label). @@ -493,7 +517,7 @@ def test_deprecated_replacement(self): ################# BAD URI REFERENCE ########################### - def test_bad_uri_reference(self): + def xest_bad_uri_reference(self): """ Check that a reference (e.g. superclass) to another concept is actually declared in EDAM. @@ -777,7 +801,7 @@ def test_relation_too_broad(self): ################# DUPLICATE IN CONCEPT ########################### - def test_duplicate_in_concept(self): + def xest_duplicate_in_concept(self): """ Checks that there is no duplicate content (case insensitive) within a concept on given properties. @@ -823,7 +847,7 @@ def test_duplicate_in_concept(self): ################# DUPLICATE ALL ########################### - def test_duplicate_all(self): + def xest_duplicate_all(self): """ Checks that there is no duplicate content (case sensitive, for computational reasons) across all the ontology on given properties. @@ -1251,6 +1275,10 @@ def tearDownClass(cls): ) # prettify(cls.report[['Entity','Label','Debug Message']]) cls.report.to_csv("./output_caseologue.tsv", sep="\t") + + if not cls.timing.empty: + cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") + return super().tearDownClass() @@ -1262,6 +1290,8 @@ def tearDownClass(cls): ) runner = unittest.TextTestRunner() + snapshot = tracemalloc.take_snapshot() + top_stats = snapshot.statistics('lineno') # sys.exit(runner.run(suite())) cmd = runner.run(suite()) print(cmd) diff --git a/caseologue_python/output_caseologue_timing_example.tsv b/caseologue_python/output_caseologue_timing_example.tsv new file mode 100644 index 0000000..9877cf4 --- /dev/null +++ b/caseologue_python/output_caseologue_timing_example.tsv @@ -0,0 +1,21 @@ + Test Name Time +0 test_bad_uri 1.0815401077270508 +1 test_bad_uri_reference 25.825088024139404 +2 test_check_wikipedia_link 0.08854079246520996 +3 test_deprecated_replacement 0.20197391510009766 +4 test_deprecated_replacement_obsolete 0.05450296401977539 +5 test_duplicate_in_concept 93.84282612800598 +6 test_empty_property 2.236135959625244 +7 test_format_property_missing 6.53064489364624 +8 test_formatting 18.661022901535034 +9 test_id_unique 0.1343379020690918 +10 test_identifier_property_missing 0.1664717197418213 +11 test_literal_links 2.1890227794647217 +12 test_mandatory_property_missing 452.72374391555786 +13 test_missing_deprecated_property 0.5847809314727783 +14 test_next_id_modif 0.7566969394683838 +15 test_object_relation_obsolete 0.1579902172088623 +16 test_relation_too_broad 2.0439181327819824 +17 test_spelling_check 0.5218229293823242 +18 test_subset_id 1.3255770206451416 +19 test_super_class_refers_to_self 0.6076903343200684 From 1327dced62b81016caa00a318709931cb1e90788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 21:34:56 +0100 Subject: [PATCH 02/27] Removed long running test for ease of development --- caseologue_python/test/test_caseologue.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/caseologue_python/test/test_caseologue.py b/caseologue_python/test/test_caseologue.py index 624e465..bc59830 100644 --- a/caseologue_python/test/test_caseologue.py +++ b/caseologue_python/test/test_caseologue.py @@ -68,17 +68,17 @@ def test_caseologue(name,nb_expected_error): test_caseologue(name= "deprecated_replacement_obsolete", nb_expected_error=1) test_caseologue(name= "super_class_refers_to_self", nb_expected_error=1) test_caseologue(name= "bad_uri", nb_expected_error=2) - test_caseologue(name= "mandatory_property_missing", nb_expected_error=5) + # test_caseologue(name= "mandatory_property_missing", nb_expected_error=5) test_caseologue(name= "formatting", nb_expected_error=5) test_caseologue(name= "deprecated_replacement", nb_expected_error=1) - test_caseologue(name= "bad_uri_reference", nb_expected_error=6) + # test_caseologue(name= "bad_uri_reference", nb_expected_error=6) test_caseologue(name= "missing_deprecated_property", nb_expected_error=3) test_caseologue(name= "check_wikipedia_link", nb_expected_error=2) test_caseologue(name= "identifier_property_missing", nb_expected_error=1) test_caseologue(name= "id_unique", nb_expected_error=2) test_caseologue(name= "relation_too_broad", nb_expected_error=1) - test_caseologue(name= "duplicate_in_concept", nb_expected_error=2) - test_caseologue(name= "duplicate_all", nb_expected_error=1) + # test_caseologue(name= "duplicate_in_concept", nb_expected_error=2) + # test_caseologue(name= "duplicate_all", nb_expected_error=1) test_caseologue(name= "literal_links", nb_expected_error=1) test_caseologue(name= "next_id_modif", nb_expected_error=1) test_caseologue(name= "subset_id", nb_expected_error=1) From ce7e54766089cc254780fd53e7132f6e60f95aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 21:38:45 +0100 Subject: [PATCH 03/27] Updated caseologue_python yml to upload timing --- .github/workflows/caseologue_python.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index c316bc9..928b53a 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -48,4 +48,11 @@ jobs: uses: actions/upload-artifact@v2 with: name: output_caseologue - path: caseologue_python/output_caseologue.tsv \ No newline at end of file + path: caseologue_python/output_caseologue.tsv + + - name: Archive test timing + if: always() + uses: actions/upload-artifact@v2 + with: + name: output_caseologue_timing + path: caseologue_python/output_caseologue_timing.tsv \ No newline at end of file From 62953f53917f9bf2e2daa6c75314f1d8e1124c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 21:48:22 +0100 Subject: [PATCH 04/27] Removing unused code --- caseologue_python/caseologue.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index c4c2cd7..464ab5d 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1290,8 +1290,6 @@ def tearDownClass(cls): ) runner = unittest.TextTestRunner() - snapshot = tracemalloc.take_snapshot() - top_stats = snapshot.statistics('lineno') # sys.exit(runner.run(suite())) cmd = runner.run(suite()) print(cmd) From f4c4ff77b1fbd0d16af4accd8f0a0030dc5e1504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 22:10:34 +0100 Subject: [PATCH 05/27] Combining output into one file --- .github/workflows/caseologue_python.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index 928b53a..df62ad0 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -48,11 +48,6 @@ jobs: uses: actions/upload-artifact@v2 with: name: output_caseologue - path: caseologue_python/output_caseologue.tsv - - - name: Archive test timing - if: always() - uses: actions/upload-artifact@v2 - with: - name: output_caseologue_timing - path: caseologue_python/output_caseologue_timing.tsv \ No newline at end of file + path: + - caseologue_python/output_caseologue.tsv + - caseologue_python/output_caseologue_timing.tsv From 9d819467eb71fa74b3191803908942213848ed44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 22:19:45 +0100 Subject: [PATCH 06/27] Alternative syntax --- .github/workflows/caseologue_python.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index df62ad0..9f6d525 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -43,11 +43,12 @@ jobs: # run: | # cat caseologue_python/output_caseologue.tsv - - name: Archive tests output + - name: Archive test outputs if: always() uses: actions/upload-artifact@v2 with: - name: output_caseologue - path: - - caseologue_python/output_caseologue.tsv - - caseologue_python/output_caseologue_timing.tsv + name: test-outputs + path: | + caseologue_python/output_caseologue.tsv + caseologue_python/output_caseologue_timing.tsv + From 46090786c0415da9e7c41ae8374c1c5d1dd5ba06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 23:07:37 +0100 Subject: [PATCH 07/27] Last try --- caseologue_python/caseologue.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 464ab5d..af56f48 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1257,6 +1257,24 @@ def tearDownClass(cls): """ + if cls.timing.empty == False: + pd.set_option( + "display.max_rows", + None, + "display.max_colwidth", + 5000, + "display.width", + 5000, + ) + print( + tabulate( + cls.report[["Test Name", "Time"]], + headers=["Test Name", "Time"], + ) + ) + + cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") + # output = cls.report.sort('Level',) if cls.report.empty == False: pd.set_option( @@ -1276,9 +1294,6 @@ def tearDownClass(cls): # prettify(cls.report[['Entity','Label','Debug Message']]) cls.report.to_csv("./output_caseologue.tsv", sep="\t") - if not cls.timing.empty: - cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") - return super().tearDownClass() From 8f7fb0bc4708e401d72c40b7b04a2fff0069aab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Wed, 8 Nov 2023 23:13:55 +0100 Subject: [PATCH 08/27] Last last try --- caseologue_python/caseologue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index af56f48..322f6b7 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1268,7 +1268,7 @@ def tearDownClass(cls): ) print( tabulate( - cls.report[["Test Name", "Time"]], + cls.timing[["Test Name", "Time"]], headers=["Test Name", "Time"], ) ) @@ -1294,7 +1294,7 @@ def tearDownClass(cls): # prettify(cls.report[['Entity','Label','Debug Message']]) cls.report.to_csv("./output_caseologue.tsv", sep="\t") - return super().tearDownClass() + super().tearDownClass() if __name__ == "__main__": From 030c47fd9e87fb90e3f8a36c91d4e8e3137da25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Thu, 9 Nov 2023 00:50:18 +0100 Subject: [PATCH 09/27] dummy file test --- .github/workflows/caseologue_python.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index 9f6d525..c114ae0 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -35,13 +35,18 @@ jobs: - name: run run: | cd caseologue_python/ - printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________" + printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________\n" EDAM_PATH=${{inputs.edam_path}} python3 caseologue.py ${{inputs.caseologue_options}} # - name: Print output # if: always() # run: | - # cat caseologue_python/output_caseologue.tsv + # cat caseologue_python/output_caseologue.tsv + + - name: make_file + run: | + cd caseologue_python/ + touch output_caseologue_timing.tsv - name: Archive test outputs if: always() @@ -49,6 +54,7 @@ jobs: with: name: test-outputs path: | - caseologue_python/output_caseologue.tsv caseologue_python/output_caseologue_timing.tsv + caseologue_python/output_caseologue.tsv + From 327fff6305dc5114a679a86cf5576df13d865aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 13:30:49 +0100 Subject: [PATCH 10/27] trial and error --- .github/workflows/caseologue_python.yml | 13 +++---------- caseologue_python/caseologue.py | 7 +++---- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index c114ae0..8641bb4 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -35,26 +35,19 @@ jobs: - name: run run: | cd caseologue_python/ - printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________\n" + printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________\n\n" EDAM_PATH=${{inputs.edam_path}} python3 caseologue.py ${{inputs.caseologue_options}} - + # - name: Print output # if: always() # run: | # cat caseologue_python/output_caseologue.tsv - - name: make_file - run: | - cd caseologue_python/ - touch output_caseologue_timing.tsv - - name: Archive test outputs if: always() uses: actions/upload-artifact@v2 with: name: test-outputs - path: | - caseologue_python/output_caseologue_timing.tsv - caseologue_python/output_caseologue.tsv + path: caseologue_python/output_caseologue.tsv diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 322f6b7..7205d01 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -118,9 +118,6 @@ def tearDown(self): elapsed_time = end_time - self.start_time # Append the timing to the class's timing DataFrame test_name = self.id().split('.')[-1] # This gets the name of the current test method - #print(type(self.__class__.timing)) - #print(type(self.timing)) - print({"Test Name": test_name, "Time": elapsed_time}) timing_info_df = pd.DataFrame([{ "Test Name": test_name, "Time": elapsed_time @@ -1273,7 +1270,7 @@ def tearDownClass(cls): ) ) - cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") + #cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") # output = cls.report.sort('Level',) if cls.report.empty == False: @@ -1302,11 +1299,13 @@ def tearDownClass(cls): run_error, run_essential, run_curation = parsing() print( f"error = {run_error}, essential = {run_essential}, curation = {run_curation}" + f"before start" ) runner = unittest.TextTestRunner() # sys.exit(runner.run(suite())) cmd = runner.run(suite()) print(cmd) + print(f"after cmd") if (len(cmd.failures) != 0) or (len(cmd.errors) != 0): exit(1) From fd26a4cb5acd904273c3805dc3dba0a95f336d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 14:46:14 +0100 Subject: [PATCH 11/27] change sync to fork repo --- .github/workflows/caseologue_python.yml | 14 +++++++++++--- caseologue_python/caseologue.py | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index 8641bb4..2b36496 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v2 with: - repository: edamontology/caseologue + repository: maanst/caseologue - name: download artifacts uses: actions/download-artifact@v3 @@ -43,11 +43,19 @@ jobs: # run: | # cat caseologue_python/output_caseologue.tsv + - name: Display structure of files + run: ls -R + - name: Archive test outputs if: always() uses: actions/upload-artifact@v2 with: - name: test-outputs + name: output_caseologue path: caseologue_python/output_caseologue.tsv - + - name: Archive tests timing + if: always() + uses: actions/upload-artifact@v2 + with: + name: output_caseologue_timing + path: caseologue_python/output_caseologue_timing.tsv \ No newline at end of file diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 7205d01..675b5ed 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1270,7 +1270,7 @@ def tearDownClass(cls): ) ) - #cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") + cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") # output = cls.report.sort('Level',) if cls.report.empty == False: From 274b444a31ad68a8bc89831c4c7e7600d6a82383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 15:07:59 +0100 Subject: [PATCH 12/27] clean-up --- .github/workflows/caseologue_python.yml | 15 --------------- caseologue_python/caseologue.py | 4 +--- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index 2b36496..d9ad834 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -38,24 +38,9 @@ jobs: printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________\n\n" EDAM_PATH=${{inputs.edam_path}} python3 caseologue.py ${{inputs.caseologue_options}} - # - name: Print output - # if: always() - # run: | - # cat caseologue_python/output_caseologue.tsv - - - name: Display structure of files - run: ls -R - - name: Archive test outputs if: always() uses: actions/upload-artifact@v2 with: name: output_caseologue path: caseologue_python/output_caseologue.tsv - - - name: Archive tests timing - if: always() - uses: actions/upload-artifact@v2 - with: - name: output_caseologue_timing - path: caseologue_python/output_caseologue_timing.tsv \ No newline at end of file diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 675b5ed..b79fe7b 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1298,14 +1298,12 @@ def tearDownClass(cls): run_error, run_essential, run_curation = parsing() print( - f"error = {run_error}, essential = {run_essential}, curation = {run_curation}" - f"before start" + f"error = {run_error}, essential = {run_essential}, curation = {run_curation}\n" ) runner = unittest.TextTestRunner() # sys.exit(runner.run(suite())) cmd = runner.run(suite()) print(cmd) - print(f"after cmd") if (len(cmd.failures) != 0) or (len(cmd.errors) != 0): exit(1) From 7693bbf3955684759c56427a399b91fc87a8cba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 15:21:35 +0100 Subject: [PATCH 13/27] Further clean-up --- .github/workflows/caseologue_python.yml | 2 +- caseologue_python/caseologue.py | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index d9ad834..c835623 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -35,7 +35,7 @@ jobs: - name: run run: | cd caseologue_python/ - printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________\n\n" + printf "\n_____________________________________________________________________________________________\n\nThe following debug table is archived as an artifact called 'output_caseologue'\n_____________________________________________________________________________________________\n\n" EDAM_PATH=${{inputs.edam_path}} python3 caseologue.py ${{inputs.caseologue_options}} - name: Archive test outputs diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index b79fe7b..ac15f3e 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1,15 +1,11 @@ import unittest import time -from rdflib import OWL, ConjunctiveGraph, Namespace +from rdflib import ConjunctiveGraph import os import pandas as pd import argparse import sys -from collections import Counter -from rdflib.namespace import RDF, RDFS, _OWL from tabulate import tabulate - -# from rich_dataframe import prettify from queries.edamxpath_id_unique import check_unique_id def parsing(): @@ -30,8 +26,6 @@ def parsing(): args = parser.parse_args() - # print("args argparse",args.error,args.essential,args.curation) - if args.error != False or args.essential != False or args.curation != False: run_error = args.error run_essential = args.essential @@ -42,8 +36,6 @@ def parsing(): run_essential = True run_curation = True - # print("def parsing",run_error,run_essential,run_curation) - sys.argv[1:] = args.unittest_args return (run_error, run_essential, run_curation) @@ -1270,7 +1262,7 @@ def tearDownClass(cls): ) ) - cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") + # cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") # output = cls.report.sort('Level',) if cls.report.empty == False: @@ -1288,7 +1280,7 @@ def tearDownClass(cls): headers=["Test Name", "Entity", "Label", "Debug Message"], ) ) - # prettify(cls.report[['Entity','Label','Debug Message']]) + cls.report.to_csv("./output_caseologue.tsv", sep="\t") super().tearDownClass() @@ -1302,7 +1294,6 @@ def tearDownClass(cls): ) runner = unittest.TextTestRunner() - # sys.exit(runner.run(suite())) cmd = runner.run(suite()) print(cmd) if (len(cmd.failures) != 0) or (len(cmd.errors) != 0): From 095130b68abafede737b171ab9e56e65e6c73203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 15:33:37 +0100 Subject: [PATCH 14/27] Reinstated time consuming tests --- caseologue_python/caseologue.py | 6 +++--- caseologue_python/test/test_caseologue.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index ac15f3e..9aa5a5c 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -59,20 +59,20 @@ def suite(): if run_essential == True: suite.addTest(EdamQueryTest("test_super_class_refers_to_self")) - # suite.addTest(EdamQueryTest("test_bad_uri_reference")) # t -> x + suite.addTest(EdamQueryTest("test_bad_uri_reference")) suite.addTest(EdamQueryTest("test_empty_property")) suite.addTest(EdamQueryTest("test_id_unique")) suite.addTest(EdamQueryTest("test_spelling_check")) if run_error == True: - # suite.addTest(EdamQueryTest("test_mandatory_property_missing")) # t -> x + suite.addTest(EdamQueryTest("test_mandatory_property_missing")) suite.addTest(EdamQueryTest("test_deprecated_replacement")) suite.addTest(EdamQueryTest("test_missing_deprecated_property")) suite.addTest(EdamQueryTest("test_next_id_modif")) suite.addTest(EdamQueryTest("test_subset_id")) suite.addTest(EdamQueryTest("test_object_relation_obsolete")) suite.addTest(EdamQueryTest("test_bad_uri")) - # suite.addTest(EdamQueryTest("test_duplicate_in_concept")) # t -> x + suite.addTest(EdamQueryTest("test_duplicate_in_concept")) return suite diff --git a/caseologue_python/test/test_caseologue.py b/caseologue_python/test/test_caseologue.py index bc59830..a529e8f 100644 --- a/caseologue_python/test/test_caseologue.py +++ b/caseologue_python/test/test_caseologue.py @@ -68,16 +68,16 @@ def test_caseologue(name,nb_expected_error): test_caseologue(name= "deprecated_replacement_obsolete", nb_expected_error=1) test_caseologue(name= "super_class_refers_to_self", nb_expected_error=1) test_caseologue(name= "bad_uri", nb_expected_error=2) - # test_caseologue(name= "mandatory_property_missing", nb_expected_error=5) + test_caseologue(name= "mandatory_property_missing", nb_expected_error=5) test_caseologue(name= "formatting", nb_expected_error=5) test_caseologue(name= "deprecated_replacement", nb_expected_error=1) - # test_caseologue(name= "bad_uri_reference", nb_expected_error=6) + test_caseologue(name= "bad_uri_reference", nb_expected_error=6) test_caseologue(name= "missing_deprecated_property", nb_expected_error=3) test_caseologue(name= "check_wikipedia_link", nb_expected_error=2) test_caseologue(name= "identifier_property_missing", nb_expected_error=1) test_caseologue(name= "id_unique", nb_expected_error=2) test_caseologue(name= "relation_too_broad", nb_expected_error=1) - # test_caseologue(name= "duplicate_in_concept", nb_expected_error=2) + test_caseologue(name= "duplicate_in_concept", nb_expected_error=2) # test_caseologue(name= "duplicate_all", nb_expected_error=1) test_caseologue(name= "literal_links", nb_expected_error=1) test_caseologue(name= "next_id_modif", nb_expected_error=1) From 45e75f340350a2f6f7d3dafa1fbedca92135f8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 15:36:26 +0100 Subject: [PATCH 15/27] Forgot to change names of tests --- caseologue_python/caseologue.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 9aa5a5c..44df8e1 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -243,7 +243,7 @@ def test_bad_uri(self): ################# MANDATORY PROPERTY MISSING ########################### - def xest_mandatory_property_missing(self): + def test_mandatory_property_missing(self): """ Checks that no mandatory property for all concepts are missing (oboInOwl:hasDefinition, rdfs:subClassOf, created_in, oboInOwl:inSubset, rdfs:label). @@ -506,7 +506,7 @@ def test_deprecated_replacement(self): ################# BAD URI REFERENCE ########################### - def xest_bad_uri_reference(self): + def test_bad_uri_reference(self): """ Check that a reference (e.g. superclass) to another concept is actually declared in EDAM. @@ -790,7 +790,7 @@ def test_relation_too_broad(self): ################# DUPLICATE IN CONCEPT ########################### - def xest_duplicate_in_concept(self): + def test_duplicate_in_concept(self): """ Checks that there is no duplicate content (case insensitive) within a concept on given properties. @@ -836,7 +836,7 @@ def xest_duplicate_in_concept(self): ################# DUPLICATE ALL ########################### - def xest_duplicate_all(self): + def test_duplicate_all(self): """ Checks that there is no duplicate content (case sensitive, for computational reasons) across all the ontology on given properties. From e886a7bbc19ae0daa5792b447efd65459e7304d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 17:12:57 +0100 Subject: [PATCH 16/27] Explicit reference to current branch in current repo --- .github/workflows/caseologue_python.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index c835623..5e75c0f 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -18,8 +18,11 @@ jobs: steps: - uses: actions/checkout@v2 - with: - repository: maanst/caseologue + with: + # This will automatically check out the branch that triggered the workflow + # within the current repository. + repository: ${{ github.repository }} + ref: ${{ github.ref }} - name: download artifacts uses: actions/download-artifact@v3 From bf7b6b089389e67ad7a205a8b61d08e25252f7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 17:43:00 +0100 Subject: [PATCH 17/27] Removing 'ref:' as it might differ from default --- .github/workflows/caseologue_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index 5e75c0f..d617af4 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -22,7 +22,7 @@ jobs: # This will automatically check out the branch that triggered the workflow # within the current repository. repository: ${{ github.repository }} - ref: ${{ github.ref }} + # ref: ${{ github.ref }} - name: download artifacts uses: actions/download-artifact@v3 From d2114d16c22c7991a28f7ade167b21cea8bb5ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 17:53:38 +0100 Subject: [PATCH 18/27] Relying on default repo/branch --- .github/workflows/caseologue_python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index d617af4..16a1770 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v2 - with: + # with: # This will automatically check out the branch that triggered the workflow # within the current repository. - repository: ${{ github.repository }} + # repository: ${{ github.repository }} # ref: ${{ github.ref }} - name: download artifacts From c7215ee6b5d1789d145d0b339ddfaba57bde3c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 18:12:15 +0100 Subject: [PATCH 19/27] Removing hardcoding of repo --- .github/workflows/caseologue_robot_reason.yml | 4 ++-- .github/workflows/caseologue_robot_report.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caseologue_robot_reason.yml b/.github/workflows/caseologue_robot_reason.yml index 0592c80..a12ca49 100644 --- a/.github/workflows/caseologue_robot_reason.yml +++ b/.github/workflows/caseologue_robot_reason.yml @@ -16,8 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 - with: - repository: edamontology/caseologue + # with: + # repository: edamontology/caseologue - name: download artifacts uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/caseologue_robot_report.yml b/.github/workflows/caseologue_robot_report.yml index 22e94f0..98aa827 100644 --- a/.github/workflows/caseologue_robot_report.yml +++ b/.github/workflows/caseologue_robot_report.yml @@ -16,8 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 - with: - repository: edamontology/caseologue + # with: + # repository: edamontology/caseologue - name: download artifacts uses: actions/download-artifact@v3 From 12f809430121c31974da6031f39a2936457e8592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 18:48:11 +0100 Subject: [PATCH 20/27] Removing reference to saved table. Timing is shown in stdout of each run --- .gitignore | 2 -- caseologue_python/caseologue.py | 2 -- .../output_caseologue_timing_example.tsv | 21 ------------------- 3 files changed, 25 deletions(-) delete mode 100644 caseologue_python/output_caseologue_timing_example.tsv diff --git a/.gitignore b/.gitignore index 90eb34d..f25bece 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ robot_config/report_profile.tsv caseologue_python/output_caseologue.tsv caseologue_python/test/output_caseologue.tsv -caseologue_python/output_caseologue_timing.tsv -caseologue_python/test/output_caseologue_timing.tsv **/__pycache__/ docs/_build/ robot_config/robot.jar diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 44df8e1..17f2e89 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -1262,8 +1262,6 @@ def tearDownClass(cls): ) ) - # cls.timing.to_csv("./output_caseologue_timing.tsv", sep="\t") - # output = cls.report.sort('Level',) if cls.report.empty == False: pd.set_option( diff --git a/caseologue_python/output_caseologue_timing_example.tsv b/caseologue_python/output_caseologue_timing_example.tsv deleted file mode 100644 index 9877cf4..0000000 --- a/caseologue_python/output_caseologue_timing_example.tsv +++ /dev/null @@ -1,21 +0,0 @@ - Test Name Time -0 test_bad_uri 1.0815401077270508 -1 test_bad_uri_reference 25.825088024139404 -2 test_check_wikipedia_link 0.08854079246520996 -3 test_deprecated_replacement 0.20197391510009766 -4 test_deprecated_replacement_obsolete 0.05450296401977539 -5 test_duplicate_in_concept 93.84282612800598 -6 test_empty_property 2.236135959625244 -7 test_format_property_missing 6.53064489364624 -8 test_formatting 18.661022901535034 -9 test_id_unique 0.1343379020690918 -10 test_identifier_property_missing 0.1664717197418213 -11 test_literal_links 2.1890227794647217 -12 test_mandatory_property_missing 452.72374391555786 -13 test_missing_deprecated_property 0.5847809314727783 -14 test_next_id_modif 0.7566969394683838 -15 test_object_relation_obsolete 0.1579902172088623 -16 test_relation_too_broad 2.0439181327819824 -17 test_spelling_check 0.5218229293823242 -18 test_subset_id 1.3255770206451416 -19 test_super_class_refers_to_self 0.6076903343200684 From 9f39f1ccbb2423d6ccfa3964fb1d003dbb42b6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 18:54:42 +0100 Subject: [PATCH 21/27] More descriptive name of column --- caseologue_python/caseologue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index 17f2e89..f49fb78 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -112,7 +112,7 @@ def tearDown(self): test_name = self.id().split('.')[-1] # This gets the name of the current test method timing_info_df = pd.DataFrame([{ "Test Name": test_name, - "Time": elapsed_time + "Time in seconds": elapsed_time }]) self.__class__.timing = pd.concat( [self.__class__.timing, timing_info_df], ignore_index=True From 0c5d9cf6e33840b100dad0ac32b979f32dc7c9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 19:10:32 +0100 Subject: [PATCH 22/27] Descriptive name, propagation --- caseologue_python/caseologue.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index f49fb78..b21397b 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -96,7 +96,7 @@ def setUpClass(cls): columns=["Level", "Test Name", "Entity", "Label", "Debug Message"] ) cls.timing = pd.DataFrame( - columns=["Test Name", "Time"] + columns=["Test Name", "Time in seconds"] ) # print(cls.report) @@ -1257,8 +1257,8 @@ def tearDownClass(cls): ) print( tabulate( - cls.timing[["Test Name", "Time"]], - headers=["Test Name", "Time"], + cls.timing[["Test Name", "Time in seconds"]], + headers=["Test Name", "Time in seconds"], ) ) From b9bf9d75dcb64ac78bb466bde0155c562f2aab47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 19:26:04 +0100 Subject: [PATCH 23/27] Updated actions/checkout to v3 --- .github/workflows/caseologue_all_tests.yml | 2 +- .github/workflows/caseologue_curation.yml | 2 +- .github/workflows/caseologue_error_essential.yml | 2 +- .github/workflows/caseologue_python.yml | 2 +- .github/workflows/caseologue_robot_reason.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/caseologue_all_tests.yml b/.github/workflows/caseologue_all_tests.yml index 3b7a383..3595f53 100644 --- a/.github/workflows/caseologue_all_tests.yml +++ b/.github/workflows/caseologue_all_tests.yml @@ -7,7 +7,7 @@ jobs: upload_edam: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: download edam run: wget https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl - name: upload edam diff --git a/.github/workflows/caseologue_curation.yml b/.github/workflows/caseologue_curation.yml index cea36b8..ed1e9ce 100644 --- a/.github/workflows/caseologue_curation.yml +++ b/.github/workflows/caseologue_curation.yml @@ -7,7 +7,7 @@ jobs: upload_edam: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: download edam run: wget https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl - name: upload edam diff --git a/.github/workflows/caseologue_error_essential.yml b/.github/workflows/caseologue_error_essential.yml index eb3d090..63dd007 100644 --- a/.github/workflows/caseologue_error_essential.yml +++ b/.github/workflows/caseologue_error_essential.yml @@ -7,7 +7,7 @@ jobs: upload_edam: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: download edam run: wget https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl - name: upload edam diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index 16a1770..d8f5b95 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -17,7 +17,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # with: # This will automatically check out the branch that triggered the workflow # within the current repository. diff --git a/.github/workflows/caseologue_robot_reason.yml b/.github/workflows/caseologue_robot_reason.yml index a12ca49..7c458f6 100644 --- a/.github/workflows/caseologue_robot_reason.yml +++ b/.github/workflows/caseologue_robot_reason.yml @@ -15,7 +15,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # with: # repository: edamontology/caseologue - name: download artifacts From 2d93454a4e676aa58ac016de25b332bde658f7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 19:36:23 +0100 Subject: [PATCH 24/27] Remaining v2 to v3 --- .github/workflows/caseologue_python.yml | 2 +- .github/workflows/caseologue_robot_report.yml | 4 ++-- .github/workflows/test_caseologue.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caseologue_python.yml b/.github/workflows/caseologue_python.yml index d8f5b95..880d489 100644 --- a/.github/workflows/caseologue_python.yml +++ b/.github/workflows/caseologue_python.yml @@ -43,7 +43,7 @@ jobs: - name: Archive test outputs if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: output_caseologue path: caseologue_python/output_caseologue.tsv diff --git a/.github/workflows/caseologue_robot_report.yml b/.github/workflows/caseologue_robot_report.yml index 98aa827..071afaf 100644 --- a/.github/workflows/caseologue_robot_report.yml +++ b/.github/workflows/caseologue_robot_report.yml @@ -15,7 +15,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # with: # repository: edamontology/caseologue @@ -41,7 +41,7 @@ jobs: - name: Archive Robot report tests if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: robot_report_profile path: ./robot_config/report_profile.tsv diff --git a/.github/workflows/test_caseologue.yml b/.github/workflows/test_caseologue.yml index 6a96bfb..bda513e 100644 --- a/.github/workflows/test_caseologue.yml +++ b/.github/workflows/test_caseologue.yml @@ -18,7 +18,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install requirements run: | From a63cc63d3983691aa61a03172e5a00ec7de3fc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 21:36:45 +0100 Subject: [PATCH 25/27] Remaining remaining v2 to v3 --- .github/workflows/caseologue_all_tests.yml | 2 +- .github/workflows/caseologue_curation.yml | 2 +- .github/workflows/caseologue_error_essential.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/caseologue_all_tests.yml b/.github/workflows/caseologue_all_tests.yml index 3595f53..e86d564 100644 --- a/.github/workflows/caseologue_all_tests.yml +++ b/.github/workflows/caseologue_all_tests.yml @@ -11,7 +11,7 @@ jobs: - name: download edam run: wget https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl - name: upload edam - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: input_ontology path: EDAM_dev.owl diff --git a/.github/workflows/caseologue_curation.yml b/.github/workflows/caseologue_curation.yml index ed1e9ce..70208f9 100644 --- a/.github/workflows/caseologue_curation.yml +++ b/.github/workflows/caseologue_curation.yml @@ -11,7 +11,7 @@ jobs: - name: download edam run: wget https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl - name: upload edam - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: input_ontology path: EDAM_dev.owl diff --git a/.github/workflows/caseologue_error_essential.yml b/.github/workflows/caseologue_error_essential.yml index 63dd007..b7a7537 100644 --- a/.github/workflows/caseologue_error_essential.yml +++ b/.github/workflows/caseologue_error_essential.yml @@ -11,7 +11,7 @@ jobs: - name: download edam run: wget https://raw.githubusercontent.com/edamontology/edamontology/main/EDAM_dev.owl - name: upload edam - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: input_ontology path: EDAM_dev.owl From 1389720d9e12093b2b2d22f706c527f966c7f1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20Andr=C3=A9=20Strand?= Date: Mon, 13 Nov 2023 23:01:41 +0100 Subject: [PATCH 26/27] Updated the README adding curation only workflow. --- .github/workflows/README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 37d1de4..1eb91d3 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1,15 +1,17 @@ ### GitHub Actions workflows for caseologue -`build_docs.yml` : will run when a modification occurs in the docs/ folder of the caseologye.py script. It will trigger the update and deployment of the github page documentation of caseologue. +`build_docs.yml` : This workflow will run when a modification occurs in the docs/ folder of the caseologue.py script. A run of this workflow will trigger the update and deployment of the caseologue GitHub page documentation. -`caseologue_python.yml`: Is a callable workflow to run the caseologue.py script, running custom SPARQL queries. It cannot be run on it's own, it needs to be called by another workflow. It requires as input the ontology path and optionnaly severity level. +`caseologue_python.yml`: This is a callable workflow to run the caseologue.py script, running custom SPARQL queries. This workflow cannot be run on its own as it needs to be called by another workflow. The workflow requires an ontology path as input, with optional severity levels. -`caseologue_robot_reason.yml`: Is a callable workflow to run the ELK reasonner using the robot reason tool. It cannot be run on it's own, it needs to be called by another workflow. It requires as input the ontology path. +`caseologue_robot_reason.yml`: This is a callable workflow to run the ELK reasoner using the ROBOT reason tool. This workflow cannot be run on its own as it needs to be called by another workflow. The workflow requires an ontology path as input. -`caseologue_robot_report.yml`: Is a callable workflow to run the generic and adapted robot SPARQL queries using the robot report tool. It cannot be run on it's own, it needs to be called by another workflow. It requires as input the ontology path. +`caseologue_robot_report.yml`: This is a callable workflow to run the generic and adapted ROBOT SPARQL queries using the ROBOT report tool. This workflow cannot be run on its own as it needs to be called by another workflow. The workflow requires an ontology path as input. -`caseologue_all_tests.yml`: Calls the 3 workflows above (caseologue_python.yml, caseologue_robot_reason.yml, caseologue_robot_report.yml) and run them on the current dev version of EDAM. It can only be run mannualy on the GitHub Actions interface. It runs all test including the one with a "curation" level in caseologue python. +`caseologue_all_tests.yml`: This workflow runs "error", "essential" and "curation" tests. The workflow calls caseologue_python.yml, caseologue_robot_reason.yml, and caseologue_robot_report.yml and runs them on the current dev version of EDAM. The workflow can only be run manually on the GitHub Actions interface. -`caseologue_error_essential.yml`: Calls the 3 workflows above (caseologue_python.yml, caseologue_robot_reason.yml, caseologue_robot_report.yml) and run them on the current dev version of EDAM. It is triggered by every push on the caseologue repository and can be run manually on the GitHub Actions interface. For caseologue python, it only runs the test with a "error" and "essential" level. +`caseologue_error_essential.yml`: This workflow runs "error" and "essential" level tests. The workflow calls caseologue_python.yml, caseologue_robot_reason.yml, and caseologue_robot_report.yml and runs them on the current dev version of EDAM. The workflow calls the same three workflows as caseologue_all_tests and runs them on the current dev version of EDAM. The workflow is triggered by every push on the caseologue repository, but can also be run manually on the GitHub Actions interface. -`test_caseologue.yml`: runs the test_caseologue.py script in th caseologue_oyhton/test/ folder. It tests that caseologue tests do catch errors in the test data owl files. \ No newline at end of file +`caseologue_curation.yml`: This workflow runs "curation" level tests. The workflow calls caseologue_python.yml, caseologue_robot_reason.yml, and caseologue_robot_report.yml and runs them on the current dev version of EDAM. The workflow can only be run manually on the GitHub Actions interface. + +`test_caseologue.yml`: This workflow runs the test_caseologue.py script in the caseologue_python/test/ folder and checks that caseologue tests catch the correct number of errors in the test data owl files. \ No newline at end of file From f2d4caa407441484f7e5f4bb66f56c5f9f2e5e23 Mon Sep 17 00:00:00 2001 From: "Marius A. Strand" <61313399+maanst@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:04:40 +0100 Subject: [PATCH 27/27] Minor reformatting (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Pycharm reformatting and removal of redundant parentheses * Simplifying boolean expressions --------- Co-authored-by: Marius André Strand --- caseologue_python/caseologue.py | 213 ++++++++++++++------------------ 1 file changed, 91 insertions(+), 122 deletions(-) diff --git a/caseologue_python/caseologue.py b/caseologue_python/caseologue.py index b21397b..7801919 100644 --- a/caseologue_python/caseologue.py +++ b/caseologue_python/caseologue.py @@ -8,8 +8,8 @@ from tabulate import tabulate from queries.edamxpath_id_unique import check_unique_id -def parsing(): +def parsing(): parser = argparse.ArgumentParser( description="Level of tests, by default all levels are ran" ) @@ -38,7 +38,7 @@ def parsing(): sys.argv[1:] = args.unittest_args - return (run_error, run_essential, run_curation) + return run_error, run_essential, run_curation def suite(): @@ -47,7 +47,7 @@ def suite(): """ suite = unittest.TestSuite() - if run_curation == True: + if run_curation: suite.addTest(EdamQueryTest("test_deprecated_replacement_obsolete")) suite.addTest(EdamQueryTest("test_formatting")) suite.addTest(EdamQueryTest("test_check_wikipedia_link")) @@ -57,14 +57,14 @@ def suite(): # suite.addTest(EdamQueryTest('test_duplicate_all')) too long computing time for now suite.addTest(EdamQueryTest("test_format_property_missing")) - if run_essential == True: + if run_essential: suite.addTest(EdamQueryTest("test_super_class_refers_to_self")) suite.addTest(EdamQueryTest("test_bad_uri_reference")) suite.addTest(EdamQueryTest("test_empty_property")) suite.addTest(EdamQueryTest("test_id_unique")) suite.addTest(EdamQueryTest("test_spelling_check")) - if run_error == True: + if run_error: suite.addTest(EdamQueryTest("test_mandatory_property_missing")) suite.addTest(EdamQueryTest("test_deprecated_replacement")) suite.addTest(EdamQueryTest("test_missing_deprecated_property")) @@ -89,7 +89,7 @@ def setUpClass(cls): :meta private: docstring set to private to avoid automatic default docstring in documentation """ - cls.dir_path=os.path.dirname(os.path.realpath(__file__)) + cls.dir_path = os.path.dirname(os.path.realpath(__file__)) cls.edam_graph = ConjunctiveGraph() cls.edam_graph.parse(os.environ.get("EDAM_PATH"), format="xml") cls.report = pd.DataFrame( @@ -130,8 +130,8 @@ def test_deprecated_replacement_obsolete(self): Severity level: curation """ - - query=self.dir_path + "/queries/deprecated_replacement_obsolete.rq" + + query = self.dir_path + "/queries/deprecated_replacement_obsolete.rq" with open(query, "r") as f: query_term = f.read() @@ -146,10 +146,8 @@ def test_deprecated_replacement_obsolete(self): "CURATION", "deprecated_replacement_obsolete", r["entity"], - (f"'{r['label']}'"), - ( - f"concept is replaced by ({r['property']}) an obsolete concept: {r['replacement']}" - ), + f"'{r['label']}'", + f"concept is replaced by ({r['property']}) an obsolete concept: {r['replacement']}", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -172,8 +170,8 @@ def test_super_class_refers_to_self(self): Severity level: essential """ - query =self.dir_path + "/queries/super_class_refers_to_self.rq" - + query = self.dir_path + "/queries/super_class_refers_to_self.rq" + with open(query, "r") as f: query_term = f.read() @@ -188,7 +186,7 @@ def test_super_class_refers_to_self(self): "ESSENTIAL", "super_class_refers_to_self", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "concept declared as superclass of itself", ] ], @@ -213,7 +211,7 @@ def test_bad_uri(self): Severity level: essential """ - query =self.dir_path + "/queries/bad_uri.rq" + query = self.dir_path + "/queries/bad_uri.rq" with open(query, "r") as f: query_term = f.read() @@ -229,7 +227,7 @@ def test_bad_uri(self): "ESSENTIAL", "bad_rui", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "has a bad URI (entity) (regex :^http://edamontology.org/(data|topic|operation|format)_[0-9]\{4\}$)", ] ], @@ -253,7 +251,7 @@ def test_mandatory_property_missing(self): Severity level: error """ - query =self.dir_path + "/queries/mandatory_property_missing.rq" + query = self.dir_path + "/queries/mandatory_property_missing.rq" with open(query, "r") as f: query_term = f.read() @@ -269,8 +267,8 @@ def test_mandatory_property_missing(self): "ERROR", "mandatory_property_missing", r["entity"], - (f"'{r['label']}'"), - (f"is missing mandatory property: {r['property']} "), + f"'{r['label']}'", + f"is missing mandatory property: {r['property']} ", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -302,12 +300,12 @@ def test_formatting(self): Severity level: curation """ - query_dot_def =self.dir_path + "/queries/end_dot_def_missing.rq" - query_dot_label =self.dir_path + "/queries/end_dot_label.rq" - query_end_space =self.dir_path + "/queries/end_space_annotation.rq" - query_eol =self.dir_path + "/queries/eol_in_annotation.rq" - query_start_space =self.dir_path + "/queries/start_space_annotation.rq" - query_tab =self.dir_path + "/queries/tab_in_annotation.rq" + query_dot_def = self.dir_path + "/queries/end_dot_def_missing.rq" + query_dot_label = self.dir_path + "/queries/end_dot_label.rq" + query_end_space = self.dir_path + "/queries/end_space_annotation.rq" + query_eol = self.dir_path + "/queries/eol_in_annotation.rq" + query_start_space = self.dir_path + "/queries/start_space_annotation.rq" + query_tab = self.dir_path + "/queries/tab_in_annotation.rq" with open(query_dot_def, "r") as f: query_term = f.read() @@ -323,7 +321,7 @@ def test_formatting(self): "CURATION", "end_dot_def_missing", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "A dot is missing at the end of the definition.", ] ], @@ -347,7 +345,7 @@ def test_formatting(self): "CURATION", "end_dot_label", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "There is an unwanted dot at the end of the label.", ] ], @@ -371,10 +369,8 @@ def test_formatting(self): "CURATION", "end_space_annotation", r["entity"], - (f"'{r['label']}'"), - ( - f"There is an unwanted space at the end of {r['property']} : {r['value']}." - ), + f"'{r['label']}'", + f"There is an unwanted space at the end of {r['property']} : {r['value']}.", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -397,10 +393,8 @@ def test_formatting(self): "CURATION", "eol_in_annotation", r["entity"], - (f"'{r['label']}'"), - ( - f"There is an unwanted end-of-line in {r['property']} : {r['value']}." - ), + f"'{r['label']}'", + f"There is an unwanted end-of-line in {r['property']} : {r['value']}.", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -423,10 +417,8 @@ def test_formatting(self): "CURATION", "start_space_annotation", r["entity"], - (f"'{r['label']}'"), - ( - f"There is an unwanted space at the start of {r['property']} : {r['value']}." - ), + f"'{r['label']}'", + f"There is an unwanted space at the start of {r['property']} : {r['value']}.", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -449,10 +441,8 @@ def test_formatting(self): "CURATION", "tab_in_annotation", r["entity"], - (f"'{r['label']}'"), - ( - f"There is an unwanted tabulation in {r['property']} : {r['value']}." - ), + f"'{r['label']}'", + f"There is an unwanted tabulation in {r['property']} : {r['value']}.", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -476,7 +466,7 @@ def test_deprecated_replacement(self): """ - query =self.dir_path + "/queries/deprecated_replacement.rq" + query = self.dir_path + "/queries/deprecated_replacement.rq" with open(query, "r") as f: query_term = f.read() @@ -492,7 +482,7 @@ def test_deprecated_replacement(self): "ERROR", "deprecated_replacement", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "is deprecated and is missing either a replacedBy property or a consider property", ] ], @@ -522,10 +512,9 @@ def test_bad_uri_reference(self): """ - query_get_uri =self.dir_path + "/queries/get_uri.rq" - query_uri_reference =self.dir_path + "/queries/uri_reference.rq" + query_get_uri = self.dir_path + "/queries/get_uri.rq" + query_uri_reference = self.dir_path + "/queries/uri_reference.rq" - uri = [] with open(query_get_uri, "r") as f: query_term = f.read() @@ -536,7 +525,6 @@ def test_bad_uri_reference(self): for r in results: uri.append(r["entity"]) - with open(query_uri_reference, "r") as f: query_term = f.read() @@ -553,10 +541,8 @@ def test_bad_uri_reference(self): "ESSENTIAL", "bad_uri_reference", r["entity"], - (f"'{r['label']}'"), - ( - f"The property {r['property']} refers not an undeclared URI: '{r['reference']}'" - ), + f"'{r['label']}'", + f"The property {r['property']} refers not an undeclared URI: '{r['reference']}'", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -580,9 +566,8 @@ def test_missing_deprecated_property(self): """ - query =self.dir_path + "/queries/missing_deprecated_property.rq" + query = self.dir_path + "/queries/missing_deprecated_property.rq" - with open(query, "r") as f: query_term = f.read() @@ -597,8 +582,8 @@ def test_missing_deprecated_property(self): "ERROR", "missing_deprecated_property", r["entity"], - (f"'{r['label']}'"), - (f"is missing mandatory deprecated property: {r['property']}"), + f"'{r['label']}'", + f"is missing mandatory deprecated property: {r['property']}", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -622,8 +607,8 @@ def test_check_wikipedia_link(self): """ - query =self.dir_path + "/queries/check_wikipedia_link.rq" - + query = self.dir_path + "/queries/check_wikipedia_link.rq" + with open(query, "r") as f: query_term = f.read() @@ -638,7 +623,7 @@ def test_check_wikipedia_link(self): "CURATION", "check_wikipedia_link", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "Topic concept missing a wikipedia link", ] ], @@ -663,7 +648,7 @@ def test_identifier_property_missing(self): """ - query =self.dir_path + "/queries/identifier_property_missing.rq" + query = self.dir_path + "/queries/identifier_property_missing.rq" with open(query, "r") as f: query_term = f.read() @@ -679,7 +664,7 @@ def test_identifier_property_missing(self): "CURATION", "identifier_property_missing", r["entity"], - (f"'{r['label']}'"), + f"'{r['label']}'", "is missing regex property", ] ], @@ -704,19 +689,18 @@ def test_id_unique(self): """ - query =self.dir_path + "/queries/get_uri.rq" + query = self.dir_path + "/queries/get_uri.rq" - duplicate_id = check_unique_id(os.environ.get("EDAM_PATH")) # this function only returns the second of the duplicated id. If the id are not strictly identical and their subontology is different, only one line will be visible in the report table for this error (ex format_1234 is duplicate of data_1234). + duplicate_id = check_unique_id(os.environ.get( + "EDAM_PATH")) # this function only returns the second of the duplicated id. If the id are not strictly identical and their subontology is different, only one line will be visible in the report table for this error (ex format_1234 is duplicate of data_1234). nb_err = len(duplicate_id) - with open(query, "r") as f: query_term = f.read() results = self.edam_graph.query(query_term) f.close() - for id in duplicate_id: for r in results: if id in str(r["entity"]): @@ -726,8 +710,8 @@ def test_id_unique(self): "ERROR", "id_unique", r["entity"], - (f"'{r['label']}'"), - (f"numerical id is used several times"), + f"'{r['label']}'", + f"numerical id is used several times", ] ], columns=[ @@ -757,9 +741,8 @@ def test_relation_too_broad(self): """ - query =self.dir_path + "/queries/relation_too_broad.rq" + query = self.dir_path + "/queries/relation_too_broad.rq" - with open(query, "r") as f: query_term = f.read() @@ -774,10 +757,8 @@ def test_relation_too_broad(self): "CURATION", "relation_too_broad", r["entity"], - (f"'{r['label']}'"), - ( - f"linked ({r['property']}) with a concept not recommended for annotation : '{r['value']}'" - ), + f"'{r['label']}'", + f"linked ({r['property']}) with a concept not recommended for annotation : '{r['value']}'", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -793,7 +774,7 @@ def test_relation_too_broad(self): def test_duplicate_in_concept(self): """ - Checks that there is no duplicate content (case insensitive) within a concept on given properties. + Checks that there is no duplicate content (case-insensitive) within a concept on given properties. > SPARQL query available `here `_ @@ -801,9 +782,8 @@ def test_duplicate_in_concept(self): """ - query =self.dir_path + "/queries/duplicate_in_concept.rq" + query = self.dir_path + "/queries/duplicate_in_concept.rq" - with open(query, "r") as f: query_term = f.read() @@ -818,10 +798,8 @@ def test_duplicate_in_concept(self): "CURATION", "duplicate_in_concept", r["entity"], - (f"'{r['label']}'"), - ( - f"{r['property']} and {r['property2']} have the same content: '{r['value']}'" - ), + f"'{r['label']}'", + f"{r['property']} and {r['property2']} have the same content: '{r['value']}'", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -839,7 +817,7 @@ def test_duplicate_in_concept(self): def test_duplicate_all(self): """ - Checks that there is no duplicate content (case sensitive, for computational reasons) across all the ontology on given properties. + Checks that there is no duplicate content (case-sensitive, for computational reasons) across all the ontology on given properties. > SPARQL query available `here `_ @@ -848,8 +826,8 @@ def test_duplicate_all(self): """ # this is case sensitive for computational time reasons - query =self.dir_path + "/queries/duplicate_all.rq" - + query = self.dir_path + "/queries/duplicate_all.rq" + with open(query, "r") as f: query_term = f.read() @@ -864,10 +842,8 @@ def test_duplicate_all(self): "CURATION", "duplicate_all", r["entity"], - (f"'{r['label']}'"), - ( - f"have the same content on {r['property']} as {r['entity2']} '{r['label2']}' on {r['property2']}: '{r['value']}'" - ), + f"'{r['label']}'", + f"have the same content on {r['property']} as {r['entity2']} '{r['label2']}' on {r['property2']}: '{r['value']}'", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -893,8 +869,8 @@ def test_literal_links(self): """ - query =self.dir_path + "/queries/literal_links.rq" - + query = self.dir_path + "/queries/literal_links.rq" + with open(query, "r") as f: query_term = f.read() @@ -909,10 +885,8 @@ def test_literal_links(self): "CURATION", "literal_links", r["entity"], - (f"'{r['label']}'"), - ( - f"{r['property']} value is not declared as a literal: '{r['value']}'" - ), + f"'{r['label']}'", + f"{r['property']} value is not declared as a literal: '{r['value']}'", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -936,8 +910,8 @@ def test_next_id_modif(self): """ - query =self.dir_path + "/queries/get_id_and_next_id.rq" - + query = self.dir_path + "/queries/get_id_and_next_id.rq" + with open(query, "r") as f: query_term = f.read() @@ -984,7 +958,7 @@ def test_subset_id(self): """ - query =self.dir_path + "/queries/subset_id.rq" + query = self.dir_path + "/queries/subset_id.rq" with open(query, "r") as f: query_term = f.read() @@ -1000,10 +974,8 @@ def test_subset_id(self): "ERROR", "subset_id", r["entity"], - (f"'{r['label']}'"), - ( - f"Concept subset id ({r['subset']}) is different from its subclass {r['superclass']} '{r['label_sc']}'" - ), + f"'{r['label']}'", + f"Concept subset id ({r['subset']}) is different from its subclass {r['superclass']} '{r['label_sc']}'", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -1027,7 +999,7 @@ def test_object_relation_obsolete(self): """ - query =self.dir_path + "/queries/object_relation_obsolete.rq" + query = self.dir_path + "/queries/object_relation_obsolete.rq" with open(query, "r") as f: query_term = f.read() @@ -1043,10 +1015,8 @@ def test_object_relation_obsolete(self): "ERROR", "object_relation_obsolete", r["entity"], - (f"'{r['label']}'"), - ( - f"is related ({r['property']}) with {r['target']}, which is a deprecated concept" - ), + f"'{r['label']}'", + f"is related ({r['property']}) with {r['target']}, which is a deprecated concept", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -1070,21 +1040,21 @@ def test_format_property_missing(self): """ - construct =self.dir_path + "/queries/is_format_of_construct.rq" - query =self.dir_path + "/queries/format_property_missing.rq" - + construct = self.dir_path + "/queries/is_format_of_construct.rq" + query = self.dir_path + "/queries/format_property_missing.rq" + with open(construct, "r") as f: construct_term = f.read() - + results_update = self.edam_graph.query(construct_term) for r in results_update: - update_edam=self.edam_graph.add((r[0],r[1],r[2])) + update_edam = self.edam_graph.add((r[0], r[1], r[2])) f.close() - + with open(query, "r") as f: query_term = f.read() - if len(results_update)!=0: + if len(results_update) != 0: results = update_edam.query(query_term) else: results = self.edam_graph.query(query_term) @@ -1099,8 +1069,8 @@ def test_format_property_missing(self): "CURATION", "format_property_missing", r["entity"], - (f"'{r['label']}'"), - (f"is missing mandatory format property: {r['property']}"), + f"'{r['label']}'", + f"is missing mandatory format property: {r['property']}", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -1124,9 +1094,8 @@ def test_empty_property(self): """ - query =self.dir_path + "/queries/empty_property.rq" + query = self.dir_path + "/queries/empty_property.rq" - with open(query, "r") as f: query_term = f.read() @@ -1141,8 +1110,8 @@ def test_empty_property(self): "ERROR", "empty_property", r["entity"], - (f"'{r['label']}'"), - (f"{r['property']} is empty"), + f"'{r['label']}'", + f"{r['property']} is empty", ] ], columns=["Level", "Test Name", "Entity", "Label", "Debug Message"], @@ -1246,7 +1215,7 @@ def tearDownClass(cls): """ - if cls.timing.empty == False: + if not cls.timing.empty: pd.set_option( "display.max_rows", None, @@ -1263,7 +1232,7 @@ def tearDownClass(cls): ) # output = cls.report.sort('Level',) - if cls.report.empty == False: + if not cls.report.empty: pd.set_option( "display.max_rows", None,