pierrepo / grodecoder

GroDecoder extracts and identifies the molecular components of a structure file (PDB or GRO) issued from a molecular dynamics simulation.
https://grodecoder.streamlit.app/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Refactor function #29

Closed pierrepo closed 3 months ago

pierrepo commented 3 months ago

In the get_ion_solvant_info function:

https://github.com/pierrepo/grodecoder/blob/1a4bb0fa6b62cd8066634b92ea01e18cf6b459c0/grodecoder.py#L375C1-L401C20

Could rename arguments as:

Also, it could be possible to refactor the function with something like:

for molecule in (mol_def.IONS_LIST + mol_def.SOLVANTS_LIST):
    if molecule["res_name"] == residue_name:
        return molecule[target_field]
return None