From ea70eb99e9181193d420d4d15addeb025512cc45 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 11 Aug 2023 11:54:42 +1200 Subject: [PATCH 1/2] Optimise imports in zinchelper. --- src/sparc/client/zinchelper.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sparc/client/zinchelper.py b/src/sparc/client/zinchelper.py index b348597..a027f09 100644 --- a/src/sparc/client/zinchelper.py +++ b/src/sparc/client/zinchelper.py @@ -2,9 +2,12 @@ import os import re +from cmlibs.utils.zinc.field import get_group_list from cmlibs.zinc.context import Context from cmlibs.zinc.result import RESULT_OK -from cmlibs.utils.zinc.field import get_group_list +from mbfxml2ex.app import read_xml +from mbfxml2ex.zinc import load, write_ex + from scaffoldmaker import scaffolds from scaffoldmaker.annotation.bladder_terms import get_bladder_term from scaffoldmaker.annotation.body_terms import get_body_term @@ -15,13 +18,12 @@ from scaffoldmaker.annotation.lung_terms import get_lung_term from scaffoldmaker.annotation.muscle_terms import get_muscle_term from scaffoldmaker.annotation.nerve_terms import get_nerve_term -from scaffoldmaker.annotation.smallintestine_terms import get_smallintestine_term +from scaffoldmaker.annotation.smallintestine_terms import \ + get_smallintestine_term from scaffoldmaker.annotation.stellate_terms import get_stellate_term from scaffoldmaker.annotation.stomach_terms import get_stomach_term from scaffoldmaker.utils.exportvtk import ExportVtk from sparc.client.services.pennsieve import PennsieveService -from mbfxml2ex.app import read_xml -from mbfxml2ex.zinc import load, write_ex class ZincHelper: From a1bd549e150dee6e745d3952e0fe5445f9d84913 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 11 Aug 2023 11:58:09 +1200 Subject: [PATCH 2/2] Address reviewdog formatting issues. --- src/sparc/client/zinchelper.py | 4 +--- tests/test_zinc.py | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sparc/client/zinchelper.py b/src/sparc/client/zinchelper.py index a027f09..edf90e3 100644 --- a/src/sparc/client/zinchelper.py +++ b/src/sparc/client/zinchelper.py @@ -7,7 +7,6 @@ from cmlibs.zinc.result import RESULT_OK from mbfxml2ex.app import read_xml from mbfxml2ex.zinc import load, write_ex - from scaffoldmaker import scaffolds from scaffoldmaker.annotation.bladder_terms import get_bladder_term from scaffoldmaker.annotation.body_terms import get_body_term @@ -18,8 +17,7 @@ from scaffoldmaker.annotation.lung_terms import get_lung_term from scaffoldmaker.annotation.muscle_terms import get_muscle_term from scaffoldmaker.annotation.nerve_terms import get_nerve_term -from scaffoldmaker.annotation.smallintestine_terms import \ - get_smallintestine_term +from scaffoldmaker.annotation.smallintestine_terms import get_smallintestine_term from scaffoldmaker.annotation.stellate_terms import get_stellate_term from scaffoldmaker.annotation.stomach_terms import get_stomach_term from scaffoldmaker.utils.exportvtk import ExportVtk diff --git a/tests/test_zinc.py b/tests/test_zinc.py index e3ac6ea..22b594c 100644 --- a/tests/test_zinc.py +++ b/tests/test_zinc.py @@ -92,8 +92,10 @@ def test_analyse_with_input_file_without_group(zinc): # Test file that has no group input_file_name = "test_input.xml" organ = "stomach" - expected = f"The data file {input_file_name} doesn't have any groups, " \ - f"therefore this data file is not suitable for mapping." + expected = ( + f"The data file {input_file_name} doesn't have any groups, " + f"therefore this data file is not suitable for mapping." + ) with open(input_file_name, "w") as f: f.write("Test data") # Call the analyse function and assert that it succeeds