From 9ece906903ab58d527889155897b4b4107ac4b6a Mon Sep 17 00:00:00 2001 From: skarozis Date: Fri, 31 Jul 2020 11:45:53 +0300 Subject: [PATCH] Debug atomid_data function --- CHANGELOG | 10 ++++++++++ main.py | 1 - tooba_f.py | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 26e1613..a3f26c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.0] - 2020-07-31 +### Added +- None + +### Changed +- In atomid_data function a extra check was added for residue type in order to avoid create dictionaries with empty values in keys + +### Removed +- None + ## [0.0.9] - 2020-07-30 ### Added - calculate rdf profile for all combination of molecules diff --git a/main.py b/main.py index 83082a4..3fdd30b 100644 --- a/main.py +++ b/main.py @@ -39,7 +39,6 @@ TPR=SYSTEM_NAME+'/eq_run.tpr' # [save, [TYPE], SAVE_NAME]: Save result of previous function, type: pkl, json # ################################################### -#todo save function faulty, save last result to existing pkl(s) GROUPS={'ALL':['index+ALL_ndx',['save', ['pkl'],'index'],'density',['save', ['pkl'],'dens']], 'HD_GROUP':['surf',['save', ['pkl', 'json'],'surf'],'index+HD_ndx',['save', ['pkl'],'index'],'rdf',['save', ['pkl'],'rdf']], 'TL_GROUP':['vector',['save', ['pkl'],'vec']], diff --git a/tooba_f.py b/tooba_f.py index 585077b..b3eaebf 100644 --- a/tooba_f.py +++ b/tooba_f.py @@ -382,6 +382,7 @@ def atomid_data(res_num, res_type, atom_type, atom_num, group={}): and correspond to the atom types in group list parameters: res_num=[] + res_type=[] atom_type=[] atom_num=[] group={} @@ -396,7 +397,7 @@ def atomid_data(res_num, res_type, atom_type, atom_num, group={}): for res,atom in group.items(): res_ndx[res]=[] for element in atom: - tmp=[res_num[i].strip() for i, e in enumerate(atom_type) if e.strip() == element.strip()] + tmp=[res_num[i].strip() for i, e in enumerate(atom_type) if e.strip() == element.strip() and res.strip()==res_type[i].strip()] res_ndx[res].append(tmp) #bar.next() #bar.finish() -- 2.24.1