mirror of
				https://github.com/fjosw/pyerrors.git
				synced 2025-11-04 01:25:46 +01:00 
			
		
		
		
	Impr/fix refactor sfcf read (#164)
* refactor read_sfcf * adding tests for find_corr and read_compact_file * add necessary broken data for tests * fixed appended mode reading * factored out sort_names and find_files * now also using sort_files in sfcf.py * edited tests to fit with new structure * added find_files function * shifted helpfunctions to bottom of file * removed some debug lines * linting * Fixed requested changes, added silent mode * added Exception if correlator is not found by read_append_rep * use tmp_path fixture * linting silent keyword * try to fix testing for a_bb * tests: Exception testing in test_find_corr made more explicit. --------- Co-authored-by: Fabian Joswig <fabian.joswig@ed.ac.uk>
This commit is contained in:
		
					parent
					
						
							
								991199a680
							
						
					
				
			
			
				commit
				
					
						41fec09816
					
				
			
		
					 7 changed files with 880 additions and 315 deletions
				
			
		
							
								
								
									
										9
									
								
								tests/utils_in_test.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								tests/utils_in_test.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
import pyerrors as pe
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_sort_names():
 | 
			
		||||
    my_list = ['sfqcd_r1_id5', 'sfqcd_r10_id5', 'sfqcd_r7_id5', 'sfqcd_r2_id5', 'sfqcd_r2_id9', 'sfqcd_r10_id4']
 | 
			
		||||
    presorted_list = ['sfqcd_r1_id5', 'sfqcd_r2_id5', 'sfqcd_r2_id9', 'sfqcd_r7_id5', 'sfqcd_r10_id4', 'sfqcd_r10_id5']
 | 
			
		||||
 | 
			
		||||
    sorted_list = pe.input.utils.sort_names(my_list)
 | 
			
		||||
    assert (all([sorted_list[i] == presorted_list[i] for i in range(len(sorted_list))]))
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue