From 6983ea45c7bd494fde8dfe8ab4340cc0fc59a0df Mon Sep 17 00:00:00 2001
From: Gerardo Tauriello <gerardo.tauriello@unibas.ch>
Date: Tue, 20 Dec 2016 14:14:02 +0100
Subject: [PATCH] Code cleanup - Typos and pythonicity.

---
 modelling/doc/pipeline.rst    |  2 +-
 modelling/pymod/_closegaps.py |  2 +-
 modelling/pymod/_pipeline.py  | 20 ++++++++++----------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/modelling/doc/pipeline.rst b/modelling/doc/pipeline.rst
index 2db3864d..7ae07b48 100644
--- a/modelling/doc/pipeline.rst
+++ b/modelling/doc/pipeline.rst
@@ -69,7 +69,7 @@ Build Raw Modelling Handle
     better by the convenient function :func:`SetSequenceProfiles`, 
     to ensure consistency with the seqres.
 
-  .. attribute:: psipred_prediction
+  .. attribute:: psipred_predictions
 
     List of predictions with one :class:`promod3.loop.PsipredPrediction` for 
     each chain of target protein. 
diff --git a/modelling/pymod/_closegaps.py b/modelling/pymod/_closegaps.py
index bb8bdc0a..dde6c8d7 100644
--- a/modelling/pymod/_closegaps.py
+++ b/modelling/pymod/_closegaps.py
@@ -1162,7 +1162,7 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6,
 
 
 def CloseGaps(mhandle, merge_distance=4, fragment_db=None, structure_db=None, 
-              torsion_sampler=None, chain_idx = None, resnum_range = None):
+              torsion_sampler=None, chain_idx=None, resnum_range=None):
     '''
     Tries to close all gaps in a model, except termini. It will go through
     following steps:
diff --git a/modelling/pymod/_pipeline.py b/modelling/pymod/_pipeline.py
index efc8c81c..006ab4ab 100644
--- a/modelling/pymod/_pipeline.py
+++ b/modelling/pymod/_pipeline.py
@@ -406,7 +406,7 @@ def CheckFinalModel(mhandle):
             ost.LogInfo("Stereo-chemical problem in sidechain " + \
                         "of residue " + str(res))
 
-def BuildFromRawModel(mhandle, alternative_mhandles = None, 
+def BuildFromRawModel(mhandle, alternative_mhandles=None,
                       use_amber_ff=False, extra_force_fields=list()):
     '''Build a model starting with a raw model (see :func:`BuildRawModel`).
 
@@ -475,20 +475,20 @@ def BuildFromRawModel(mhandle, alternative_mhandles = None,
         current_num_residues = mhandle.model.GetResidueCount()
         new_num_residues = None
         while current_num_residues != new_num_residues:
-          current_num_residues = mhandle.model.GetResidueCount()
-          ModelExtensions(mhandle, alternative_mhandles, 
-                          extension_strategy = "overlapping")
-          ModelExtensions(mhandle, alternative_mhandles,
-                          extension_strategy = "non-overlapping")
-          new_num_residues = mhandle.model.GetResidueCount()        
+            current_num_residues = mhandle.model.GetResidueCount()
+            ModelExtensions(mhandle, alternative_mhandles, 
+                            extension_strategy="overlapping")
+            ModelExtensions(mhandle, alternative_mhandles,
+                            extension_strategy="non-overlapping")
+            new_num_residues = mhandle.model.GetResidueCount()
 
     # remove terminal gaps
     RemoveTerminalGaps(mhandle)
 
     # close gaps
-    CloseGaps(mhandle, merge_distance = merge_distance, 
-              fragment_db = fragment_db, structure_db = structure_db, 
-              torsion_sampler = torsion_sampler)
+    CloseGaps(mhandle, merge_distance=merge_distance, 
+              fragment_db=fragment_db, structure_db=structure_db, 
+              torsion_sampler=torsion_sampler)
 
     # build sidechains
     BuildSidechains(mhandle, merge_distance, fragment_db,
-- 
GitLab