From b02aad4d83522f11ea854ff34fbf20e3a08a01b1 Mon Sep 17 00:00:00 2001
From: Gerardo Tauriello <gerardo.tauriello@unibas.ch>
Date: Fri, 19 May 2017 13:36:02 +0200
Subject: [PATCH] SCHWED-2349: avoid unneccessary Select statements.

---
 modules/bindings/pymod/naccess.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/bindings/pymod/naccess.py b/modules/bindings/pymod/naccess.py
index fc98f23f0..1612c503f 100644
--- a/modules/bindings/pymod/naccess.py
+++ b/modules/bindings/pymod/naccess.py
@@ -50,7 +50,10 @@ def _SetupFiles(entity, selection, scratch_dir, max_number_of_atoms):
     tmp_dir_name = tempfile.mkdtemp()
 
   # select as specified by user
-  entity_view = entity.Select(selection)
+  if selection != "":
+    entity_view = entity.Select(selection)
+  else:
+    entity_view = entity
   if len(entity_view.atoms) > max_number_of_atoms:
     raise RuntimeError, "Too much atoms for NACCESS (> %s)" % max_number_of_atoms
   if not entity_view.IsValid():
-- 
GitLab