1111from tests .matlab_test_data_collectors .python_testers .utils .record_reader import TestRecordReader
1212
1313
14- def test_element_is_close ():
14+ def test_element_is_approximately_equal ():
1515 base_element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1 ])
1616
1717 # Test cases
@@ -23,24 +23,24 @@ def test_element_is_close():
2323 assert not base_element .is_close (Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , float ('inf' )]))
2424 assert not base_element .is_close (Element (group_id = 0 , type = "annular" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1 ]))
2525
26- def test_element_is_close_nan ():
26+ def test_element_is_approximately_equal_nan ():
2727 nan_element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , float ('nan' )])
2828 assert nan_element .is_close (nan_element , equal_nan = True )
2929 assert not nan_element .is_close (nan_element , equal_nan = False )
3030
31- def test_element_is_close_boundary ():
31+ def test_element_is_approximately_equal_boundary ():
3232 base_element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1 ])
3333 boundary_element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1 + 1.1e-5 ])
3434 assert not base_element .is_close (boundary_element )
3535 assert base_element .is_close (boundary_element , rtol = 1.2e-5 )
3636
37- def test_element_is_close_consistency ():
37+ def test_element_is_approximately_equal_consistency ():
3838 base_element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1 ])
3939 other_element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1.000001 ])
4040 assert base_element .is_close (other_element ) == np .allclose (base_element .position , other_element .position )
4141 assert base_element .is_close (other_element ) == base_element .is_close (other_element , rtol = 1e-05 , atol = 1e-08 , equal_nan = False )
4242
43- def test_element_is_close_type_error ():
43+ def test_element_is_approximately_equal_type_error ():
4444 element = Element (group_id = 0 , type = "rect" , dim = 2 , active = True , measure = 1 , position = [1 , 1 , 1 ])
4545
4646 with pytest .raises (TypeError , match = r"not an element with <class 'str'> is not of type Element" ):
0 commit comments