mirror of
				https://github.com/fjosw/pyerrors.git
				synced 2025-11-04 01:25:46 +01:00 
			
		
		
		
	feat: automatic windowing procedure can now be deactivated by choosing
S=0
This commit is contained in:
		
					parent
					
						
							
								56b1b36037
							
						
					
				
			
			
				commit
				
					
						ccca4eabbf
					
				
			
		
					 3 changed files with 42 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -95,6 +95,18 @@ def test_gamma_method():
 | 
			
		|||
        assert test_obs.e_tauint['t'] - 10.5 <= test_obs.e_dtauint['t']
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_gamma_method_no_windowing():
 | 
			
		||||
    for iteration in range(50):
 | 
			
		||||
        obs = pe.Obs([np.random.normal(1.02, 0.02, 733 + np.random.randint(1000))], ['ens'])
 | 
			
		||||
        obs.gamma_method(S=0)
 | 
			
		||||
        assert obs.e_tauint['ens'] == 0.5
 | 
			
		||||
        assert np.isclose(np.sqrt(np.var(obs.deltas['ens'], ddof=1) / obs.shape['ens']), obs.dvalue)
 | 
			
		||||
        obs.gamma_method(S=1.1)
 | 
			
		||||
        assert obs.e_tauint['ens'] > 0.5
 | 
			
		||||
    with pytest.raises(Exception):
 | 
			
		||||
        obs.gamma_method(S=-0.2)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_gamma_method_persistance():
 | 
			
		||||
    my_obs = pe.Obs([np.random.rand(730)], ['t'])
 | 
			
		||||
    my_obs.gamma_method()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue