From 117bf4ba1b93abc96e4b77388d88222fd2a6bef6 Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Thu, 16 May 2019 14:53:58 +0200
Subject: [PATCH] document restrictions of PDB format causing exceptions to be
 thrown in SavePDB

---
 modules/io/doc/io.rst        | 4 +++-
 modules/io/pymod/__init__.py | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/io/doc/io.rst b/modules/io/doc/io.rst
index 0b5bbc7bb..35e71011f 100644
--- a/modules/io/doc/io.rst
+++ b/modules/io/doc/io.rst
@@ -144,12 +144,14 @@ file:
 
 .. function:: EntityToPDBStr(ent, profile=IOProfile())
 
-  Return entity as a string in PDB format.
+  Return entity as a string in PDB format. 
 
   :param entity: The :class:`~ost.mol.EntityHandle` or :class:`~ost.mol.EntityView`
 
   :param profile: The IO Profile to read the entity with. For more information
       on the IO Profiles available, see :doc:`profile`.
+  :raises: IOException if the restrictions of the PDB format are not satisfied
+           (see :meth:`ost.io.SavePDB`)
 
   :rtype: string.
 
diff --git a/modules/io/pymod/__init__.py b/modules/io/pymod/__init__.py
index 302b8fb4f..70a196663 100644
--- a/modules/io/pymod/__init__.py
+++ b/modules/io/pymod/__init__.py
@@ -184,6 +184,15 @@ def SavePDB(models, filename, dialect=None,  pqr=False, profile='DEFAULT'):
   :param models: The entity or list of entities (handles or views) to be saved
   :param filename: The filename
   :type  filename: string
+  :raises: IOException if the restrictions of the PDB format are not satisfied
+           (with the exception of atom numbers, see above):
+
+             * Chain names with more than one character
+             * Atom positions with coordinates outside range [-999.99, 9999.99]
+             * Residue names longer than three characters
+             * Atom names longer than four characters
+             * Numeric part of :class:`ost.mol.ResNum` outside range [-999, 9999] 
+             * Alternative atom indicators longer than one character
   """
   if not getattr(models, '__len__', None):
     models=[models]
-- 
GitLab