mirror of
				https://github.com/fjosw/pyerrors.git
				synced 2025-11-04 01:25:46 +01:00 
			
		
		
		
	tests: tests for linalg and obs extended.
This commit is contained in:
		
					parent
					
						
							
								c9e1cd10af
							
						
					
				
			
			
				commit
				
					
						cd2f361a3e
					
				
			
		
					 2 changed files with 32 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -51,6 +51,12 @@ def test_Obs_exceptions():
 | 
			
		|||
    my_obs.gamma_method()
 | 
			
		||||
    my_obs.details()
 | 
			
		||||
 | 
			
		||||
    obs = pe.Obs([np.random.normal(1.0, 0.1, 100)], ['t'])
 | 
			
		||||
    one = obs / obs
 | 
			
		||||
    one.gamma_method()
 | 
			
		||||
    with pytest.raises(Exception):
 | 
			
		||||
        one.plot_piechart()
 | 
			
		||||
 | 
			
		||||
def test_dump():
 | 
			
		||||
    value = np.random.normal(5, 10)
 | 
			
		||||
    dvalue = np.abs(np.random.normal(0, 1))
 | 
			
		||||
| 
						 | 
				
			
			@ -86,6 +92,8 @@ def test_comparison():
 | 
			
		|||
    assert test_obs2 != value2
 | 
			
		||||
    assert test_obs1 != test_obs2
 | 
			
		||||
    assert test_obs2 != test_obs1
 | 
			
		||||
    assert +test_obs1 == test_obs1
 | 
			
		||||
    assert -test_obs1 == 0 - test_obs1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_function_overloading():
 | 
			
		||||
| 
						 | 
				
			
			@ -367,6 +375,8 @@ def test_cobs():
 | 
			
		|||
    obs2 = pe.pseudo_Obs(-0.2, 0.03, 't')
 | 
			
		||||
 | 
			
		||||
    my_cobs = pe.CObs(obs1, obs2)
 | 
			
		||||
    assert +my_cobs == my_cobs
 | 
			
		||||
    assert -my_cobs == 0 - my_cobs
 | 
			
		||||
    my_cobs == my_cobs
 | 
			
		||||
    str(my_cobs)
 | 
			
		||||
    repr(my_cobs)
 | 
			
		||||
| 
						 | 
				
			
			@ -758,3 +768,15 @@ def test_merge_idx():
 | 
			
		|||
    assert(new_idx[-1] > new_idx[0])
 | 
			
		||||
    for i in range(1, len(new_idx)):
 | 
			
		||||
        assert(new_idx[i - 1] < new_idx[i])
 | 
			
		||||
 | 
			
		||||
def test_cobs_array():
 | 
			
		||||
    cobs = pe.Obs([np.random.normal(1.0, 0.1, 100)], ['t']) * (1 + 2j)
 | 
			
		||||
    np.identity(4) + cobs
 | 
			
		||||
    cobs + np.identity(4)
 | 
			
		||||
    np.identity(4) - cobs
 | 
			
		||||
    cobs - np.identity(4)
 | 
			
		||||
    np.identity(4) * cobs
 | 
			
		||||
    cobs * np.identity(4)
 | 
			
		||||
    np.identity(4) / cobs
 | 
			
		||||
    cobs / np.ones((4, 4))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue