File tree Expand file tree Collapse file tree 4 files changed +295
-3
lines changed
Expand file tree Collapse file tree 4 files changed +295
-3
lines changed Original file line number Diff line number Diff line change 1+
2+ [Inverse Distance Weighting]
3+ # This section describes the setting of idw.
4+
5+ # the power parameter
6+ power: 2
7+
8+
9+ [Control points]
10+ # This section describes the RBF control points.
11+
12+ # original control points collects the coordinates of the interpolation control
13+ # points before the deformation.
14+ original control points: -.1 0.0 0.0
15+ 0.0 0.0 1.0
16+ 0.0 1.0 0.0
17+ 1.0 0.0 0.0
18+ 0.0 1 1.0
19+ 1.0 0.0 1.0
20+ 1.0 1.0 0
21+ 1.0 1.0 1.0
22+
23+ # deformed control points collects the coordinates of the interpolation control
24+ # points after the deformation.
25+ deformed control points: 0.1 0.2 .3
26+ 0.0 0.0 1.0
27+ 0.0 1.0 0.0
28+ 1.0 0.0 0.0
29+ 0.0 .8 1.0
30+ 1.0 0.0 1.0
31+ 1.0 1.0 0.0
32+ 1.2 1.2 1.2
Original file line number Diff line number Diff line change 99
1010
1111class TestUtils (TestCase ):
12+ def cmp (self , f1 , f2 ):
13+ """
14+ Check if the two files have the same content, skipping comment lines
15+ """
16+ content1 = [line for line in open (f1 ) if not line .startswith ('#' )]
17+ content2 = [line for line in open (f1 ) if not line .startswith ('#' )]
18+ return content1 == content2
19+
1220 def test_utils_write_original_box (self ):
1321 params = pars .FFDParameters ()
1422 params .read_parameters (
@@ -45,7 +53,7 @@ def test_utils_check_vtk_original_box(self):
4553
4654 ut .write_bounding_box (params , outfilename , write_deformed = False )
4755
48- self .assertTrue (filecmp .cmp (outfilename , outfilename_expected ))
56+ self .assertTrue (self .cmp (outfilename , outfilename_expected ))
4957 os .remove (outfilename )
5058
5159 def test_utils_check_vtk_modified_box (self ):
@@ -62,7 +70,7 @@ def test_utils_check_vtk_modified_box(self):
6270
6371 ut .write_bounding_box (params , outfilename )
6472
65- self .assertTrue (filecmp .cmp (outfilename , outfilename_expected ))
73+ self .assertTrue (self .cmp (outfilename , outfilename_expected ))
6674 os .remove (outfilename )
6775
6876 def test_utils_plot_rbf_control_points (self ):
Original file line number Diff line number Diff line change 77
88
99class TestVtkHandler (TestCase ):
10+ def cmp (self , f1 , f2 ):
11+ """
12+ Check if the two files have the same content, skipping comment lines
13+ """
14+ content1 = [line for line in open (f1 ) if not line .startswith ('#' )]
15+ content2 = [line for line in open (f1 ) if not line .startswith ('#' )]
16+ return content1 == content2
17+
1018 def test_vtk_instantiation (self ):
1119 vtk_handler = vh .VtkHandler ()
1220
@@ -139,7 +147,7 @@ def test_vtk_write_comparison(self):
139147 outfilename_expected = 'tests/test_datasets/test_red_blood_cell_out_true_version6.vtk'
140148
141149 vtk_handler .write (mesh_points , outfilename )
142- self .assertTrue (filecmp .cmp (outfilename , outfilename_expected ))
150+ self .assertTrue (self .cmp (outfilename , outfilename_expected ))
143151 os .remove (outfilename )
144152
145153 def test_vtk_plot_failing_outfile_type (self ):
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments