mirror of
				https://github.com/fjosw/pyerrors.git
				synced 2025-11-04 01:25:46 +01:00 
			
		
		
		
	utf-8 for plain json files and a bugfix for reading arrays
This commit is contained in:
		
					parent
					
						
							
								5937a519d7
							
						
					
				
			
			
				commit
				
					
						d740f8d3c4
					
				
			
		
					 2 changed files with 15 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -19,7 +19,15 @@ def test_jsonio():
 | 
			
		|||
    arr = np.array([o3, o5])
 | 
			
		||||
    mat = np.array([[pe.pseudo_Obs(1.0, .1, 'mat'), pe.pseudo_Obs(0.3, .1, 'mat')], [pe.pseudo_Obs(0.2, .1, 'mat'), pe.pseudo_Obs(2.0, .4, 'mat')]])
 | 
			
		||||
 | 
			
		||||
    ol = [o4, do, testl, mat, arr, np.array([o])]
 | 
			
		||||
    tt1 = pe.Obs([np.random.rand(100)], ['t|r1'], idl=[range(2, 202, 2)])
 | 
			
		||||
    tt2 = pe.Obs([np.random.rand(100)], ['t|r2'], idl=[range(2, 202, 2)])
 | 
			
		||||
    tt3 = pe.Obs([np.random.rand(102)], ['qe'])
 | 
			
		||||
 | 
			
		||||
    tt = tt1 + tt2 + tt3
 | 
			
		||||
 | 
			
		||||
    tt.tag = 'Test Obs'
 | 
			
		||||
 | 
			
		||||
    ol = [o4, do, testl, mat, arr, np.array([o]), np.array([tt, tt]), [tt, tt]]
 | 
			
		||||
    fname = 'test_rw'
 | 
			
		||||
 | 
			
		||||
    jsonio.dump_to_json(ol, fname, indent=1)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue