From 696d0da5dcf8cd0ce4347b26b312184eb3924601 Mon Sep 17 00:00:00 2001 From: Tristan Kuehn Date: Fri, 19 Aug 2022 15:11:47 -0400 Subject: [PATCH 1/4] Add test to ensure test templates are valid --- test/test_templates.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/test_templates.py diff --git a/test/test_templates.py b/test/test_templates.py new file mode 100644 index 00000000..0fa62e46 --- /dev/null +++ b/test/test_templates.py @@ -0,0 +1,15 @@ +from pathlib import Path +import unittest + +from afidsvalidator import model + + +class TestTemplates(unittest.TestCase): + def test_all_templates(self): + for template_file in Path( + "afidsvalidator/afids-templates/human" + ).iterdir(): + with self.subTest(template_file=template_file): + with open(template_file, "r", encoding="utf-8") as fcsv: + afids = model.csv_to_afids(fcsv.read()) + self.assertTrue(afids.validate()) From 5c8043e79c8eba422eacc0e82fb55d5881cefa30 Mon Sep 17 00:00:00 2001 From: Tristan Kuehn Date: Fri, 19 Aug 2022 15:14:57 -0400 Subject: [PATCH 2/4] Fix broken templates --- afidsvalidator/afids-templates/human/tpl-BigBrain_afids.fcsv | 2 +- .../afids-templates/human/tpl-MNI152NLin2009bSym_afids.fcsv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/afidsvalidator/afids-templates/human/tpl-BigBrain_afids.fcsv b/afidsvalidator/afids-templates/human/tpl-BigBrain_afids.fcsv index f97f03ce..888e7e72 100644 --- a/afidsvalidator/afids-templates/human/tpl-BigBrain_afids.fcsv +++ b/afidsvalidator/afids-templates/human/tpl-BigBrain_afids.fcsv @@ -20,7 +20,7 @@ vtkMRMLMarkupsFiducialNode_16,-16.143,4.4655,25.685,0,0,0,1,1,1,0,16,L LV at AC, vtkMRMLMarkupsFiducialNode_17,19.58,-23.463,28.507,0,0,0,1,1,1,0,17,R LV at PC,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_18,-19.666,-23.452,27.885,0,0,0,1,1,1,0,18,L LV at PC,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_19,0.025,33.2105,3.1305,0,0,0,1,1,1,0,19,genu of CC,vtkMRMLScalarVolumeNode1 -vtkMRMLMarkupsFiducialNode_20,0.563,-39.4115,7.6585,0,0,0,1,1,1,0,20,splenium,vtkMRMLScalarVolumeNode1 +vtkMRMLMarkupsFiducialNode_20,0.563,-39.4115,7.6585,0,0,0,1,1,1,0,20,splenium of CC,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_21,34.341,-4.7005,-26.1515,0,0,0,1,1,1,0,21,R AL temporal horn,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_22,-33.368,-5.6025,-22.4175,0,0,0,1,1,1,0,22,L AL temporal horn,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_23,17.6445,-10.098,-18.0085,0,0,0,1,1,1,0,23,R superior AM temporal horn,vtkMRMLScalarVolumeNode1 diff --git a/afidsvalidator/afids-templates/human/tpl-MNI152NLin2009bSym_afids.fcsv b/afidsvalidator/afids-templates/human/tpl-MNI152NLin2009bSym_afids.fcsv index 82dbd2ca..3b9d48e7 100644 --- a/afidsvalidator/afids-templates/human/tpl-MNI152NLin2009bSym_afids.fcsv +++ b/afidsvalidator/afids-templates/human/tpl-MNI152NLin2009bSym_afids.fcsv @@ -20,7 +20,7 @@ vtkMRMLMarkupsFiducialNode_16,-15.43225,6.228585,24.9267,0,0,0,1,1,1,0,16,L LV a vtkMRMLMarkupsFiducialNode_17,18.54945,-22.73095,28.598,0,0,0,1,1,1,0,17,R LV at PC,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_18,-18.6767,-22.7815,28.42485,0,0,0,1,1,1,0,18,L LV at PC,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_19,0.002431,33.43875,2.52457,0,0,0,1,1,1,0,19,genu of CC,vtkMRMLScalarVolumeNode1 -vtkMRMLMarkupsFiducialNode_20,0.132994,-37.6245,6.401015,0,0,0,1,1,1,0,20,splenium,vtkMRMLScalarVolumeNode1 +vtkMRMLMarkupsFiducialNode_20,0.132994,-37.6245,6.401015,0,0,0,1,1,1,0,20,splenium of CC,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_21,34.47875,-4.880005,-26.81425,0,0,0,1,1,1,0,21,R AL temporal horn,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_22,-34.3701,-4.84792,-26.9405,0,0,0,1,1,1,0,22,L AL temporal horn,vtkMRMLScalarVolumeNode1 vtkMRMLMarkupsFiducialNode_23,17.93685,-10.93965,-17.9412,0,0,0,1,1,1,0,23,R superior AM temporal horn,vtkMRMLScalarVolumeNode1 From ade38048b791b860627dcc26eff5e37b132c6de3 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Fri, 19 Aug 2022 19:17:09 +0000 Subject: [PATCH 3/4] Fix code style issues with Black --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0ad0d221..7ffe670e 100644 --- a/setup.py +++ b/setup.py @@ -18,5 +18,5 @@ "python-dotenv~=0.17", "WTForms~=2.2", ], - version="v1.2.2-pre.5" + version="v1.2.2-pre.5", ) From 5b5e36cdca43cb1e0251e4822db069dbe8f8c9fe Mon Sep 17 00:00:00 2001 From: Tristan Kuehn Date: Fri, 19 Aug 2022 15:40:27 -0400 Subject: [PATCH 4/4] Rename human template test --- test/test_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_templates.py b/test/test_templates.py index 0fa62e46..e03f54f8 100644 --- a/test/test_templates.py +++ b/test/test_templates.py @@ -5,7 +5,7 @@ class TestTemplates(unittest.TestCase): - def test_all_templates(self): + def test_human_templates(self): for template_file in Path( "afidsvalidator/afids-templates/human" ).iterdir():