mirror of
				https://github.com/fjosw/pyerrors.git
				synced 2025-10-31 15:55:45 +01:00 
			
		
		
		
	test_roots added
This commit is contained in:
		
					parent
					
						
							
								112890c9d2
							
						
					
				
			
			
				commit
				
					
						1b63f5dd3b
					
				
			
		
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								tests/test_roots.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								tests/test_roots.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| import numpy as np | ||||
| import pyerrors as pe | ||||
| import pytest | ||||
| 
 | ||||
| def test_find_root(): | ||||
| 
 | ||||
|     def root_function(x, d): | ||||
|         return x - d | ||||
| 
 | ||||
|     value = np.random.normal(0, 100) | ||||
|     my_obs = pe.pseudo_Obs(value, 0.1, 't') | ||||
|     my_root = pe.roots.find_root(my_obs, root_function) | ||||
| 
 | ||||
|     assert np.isclose(my_root.value, value) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue