From a33169d59e397ff2d5a2825fb89fc74217a3a7e8 Mon Sep 17 00:00:00 2001 From: David Minton Date: Tue, 11 Oct 2022 23:14:45 -0400 Subject: [PATCH] Fixed inconsistent indentation --- python/swiftest/swiftest/io.py | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index 644c155a4..916c9a5f0 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -910,33 +910,33 @@ def swiftest_particle_2xr(param): Returns ------- - infoxr : xarray dataset + infoxr : xarray dataset """ - veclab = ['time_origin', 'xhx_origin', 'py_origin', 'pz_origin', 'vhx_origin', 'vhy_origin', 'vhz_origin'] - id_list = [] - origin_type_list = [] - origin_vec_list = [] - - try: - with FortranFile(param['PARTICLE_OUT'], 'r') as f: - for id, origin_type, origin_vec in swiftest_particle_stream(f): - id_list.append(id) - origin_type_list.append(origin_type) - origin_vec_list.append(origin_vec) - except IOError: - print(f"Error reading in {param['PARTICLE_OUT']} ") - - id_list = np.asarray(id_list)[:,0] - origin_type_list = np.asarray(origin_type_list) - origin_vec_list = np.vstack(origin_vec_list) - - typeda = xr.DataArray(origin_type_list, dims=['id'], coords={'id' : id_list}) - vecda = xr.DataArray(origin_vec_list, dims=['id', 'vec'], coords={'id' : id_list, 'vec' : veclab}) - - infoxr = vecda.to_dataset(dim='vec') - infoxr['origin_type'] = typeda - - return infoxr + veclab = ['time_origin', 'xhx_origin', 'py_origin', 'pz_origin', 'vhx_origin', 'vhy_origin', 'vhz_origin'] + id_list = [] + origin_type_list = [] + origin_vec_list = [] + + try: + with FortranFile(param['PARTICLE_OUT'], 'r') as f: + for id, origin_type, origin_vec in swiftest_particle_stream(f): + id_list.append(id) + origin_type_list.append(origin_type) + origin_vec_list.append(origin_vec) + except IOError: + print(f"Error reading in {param['PARTICLE_OUT']} ") + + id_list = np.asarray(id_list)[:,0] + origin_type_list = np.asarray(origin_type_list) + origin_vec_list = np.vstack(origin_vec_list) + + typeda = xr.DataArray(origin_type_list, dims=['id'], coords={'id' : id_list}) + vecda = xr.DataArray(origin_vec_list, dims=['id', 'vec'], coords={'id' : id_list, 'vec' : veclab}) + + infoxr = vecda.to_dataset(dim='vec') + infoxr['origin_type'] = typeda + + return infoxr def select_active_from_frame(ds, param, framenum=-1): """