Changeset 13439


Ignore:
Timestamp:
Sep 10, 2019 3:40:23 PM (3 months ago)
Author:
Christian Andersson
Message:

Updated test after review. Related to ticket:5836

Location:
PyFMI/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • PyFMI/trunk/setup.py

    r13434 r13439  
    158158        copy_args.remove(x)
    159159    if not x.find('--debug'):
    160         static = x[8:]
    161160        if x[8:].upper() == "TRUE":
    162161            debug_flag = True
  • PyFMI/trunk/tests/test_fmi.py

    r13434 r13439  
    460460   
    461461    @testattr(stddist = True)
    462     def test_estimate_directional_derivatives_bouncing_ball(self):
     462    def test_estimate_directional_derivatives_without_structure_info(self):
    463463        full_path = os.path.join(file_path, "files", "FMUs", "XML", "ME2.0", "BouncingBall.fmu")
    464464        model = Dummy_FMUModelME2([], full_path, _connect_dll=False)
     
    478478        [A, B, C, D] = model.get_state_space_representation()
    479479       
    480         assert As.shape == A.shape
    481         assert Bs.shape == B.shape
    482         assert Cs.shape == C.shape
    483         assert Ds.shape == D.shape
    484        
    485         np.allclose(As, A.toarray())
    486         np.allclose(Bs, B.toarray())
    487         np.allclose(Cs, C.toarray())
    488         np.allclose(Ds, D.toarray())
     480        assert As.shape == A.shape, str(As.shape)+' '+str(A.shape)
     481        assert Bs.shape == B.shape, str(Bs.shape)+' '+str(B.shape)
     482        assert Cs.shape == C.shape, str(Cs.shape)+' '+str(C.shape)
     483        assert Ds.shape == D.shape, str(Ds.shape)+' '+str(D.shape)
     484       
     485        assert np.allclose(As, A.toarray()), str(As)+' '+str(A.toarray())
     486        assert np.allclose(Bs, B.toarray()), str(Bs)+' '+str(B.toarray())
     487        assert np.allclose(Cs, C.toarray()), str(Cs)+' '+str(C.toarray())
     488        assert np.allclose(Ds, D.toarray()), str(Ds)+' '+str(D.toarray())
    489489   
    490490    @testattr(stddist = True)
     
    530530        D = model._get_D(use_structure_info=True)
    531531       
    532         np.allclose(B.toarray(), np.array([[0.0],[0.0]]))
    533         np.allclose(C.toarray(), np.array([[0.0, 0.0],[0.0, 1.0], [1.0, 0.0]]))
    534         np.allclose(D.toarray(), np.array([[-1.0],[0.0], [1.0]]))
     532        assert np.allclose(B.toarray(), np.array([[0.0],[0.0]]))
     533        assert np.allclose(C.toarray(), np.array([[0.0, 0.0],[0.0, 1.0], [1.0, 0.0]]))
     534        assert np.allclose(D.toarray(), np.array([[-1.0],[0.0], [1.0]]))
    535535       
    536536        B = model._get_B(use_structure_info=False)
     
    538538        D = model._get_D(use_structure_info=False)
    539539       
    540         np.allclose(B, np.array([[0.0],[0.0]]))
    541         np.allclose(C, np.array([[0.0, 0.0],[0.0, 1.0], [1.0, 0.0]]))
    542         np.allclose(D, np.array([[-1.0],[0.0], [1.0]]))
     540        assert np.allclose(B, np.array([[0.0],[0.0]]))
     541        assert np.allclose(C, np.array([[0.0, 0.0],[0.0, 1.0], [1.0, 0.0]]))
     542        assert np.allclose(D, np.array([[-1.0],[0.0], [1.0]]))
    543543       
    544544    @testattr(stddist = True)
Note: See TracChangeset for help on using the changeset viewer.