B
    b                 @   st   d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
mZ ddlmZ erTesXtddd	d
dgZddd
ZdS )a  
This module is simply a namespace for all Amber topology-like classes. There are
different variants; for instance the standard Amber topology, the chamber-made
topology, and the tinker_to_amber-made topology. These classes are all defined
in their own private modules, but imported here to simplify the API.

Copyright (C) 2010 - 2014  Jason Swails

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
   
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
    )AmberFormat)	AmberParmRst7)ChamberParmConvertFromPSF)
AmoebaParmBeemanRestart)string_typesr   r   r   LoadParmr   Nc             C   s,  ddl m} ddlm} t| }d|jkr6|t}n d|jkrL|t}n
|t	}t
|tr||}t|dr||jdkrtd| |j|_t|d	r|jdk	r|dkr|j|_n||_|dk	r||_|jd
 | dkr|jdkr|jd }t|dd |d |d |d g |_|jdk	|_|S )a  
    Loads a topology file using the correct class.

    Parameters
    ----------
    parmname : ``str``
        The name of the topology file to load
    xyz : str or array, optional
        If provided, the coordinates and unit cell dimensions from the provided
        Amber inpcrd/restart file will be loaded into the molecule, or the
        coordinates will be loaded from the coordinate array
    box : array, optional
        If provided, the unit cell information will be set from the provided
        unit cell dimensions (a, b, c, alpha, beta, and gamma, respectively)

    Returns
    -------
    parm : :class:`AmberParm` (or subclass)
        This function parses the topology file, determines if it is an
        Amber-style (i.e., *traditional* Amber force field), Chamber-style
        (i.e., CHARMM force field), or Amoeba-style (i.e., Amoeba force field),
        and then returns an instance of the appropriate type.
    r   )	load_file)IFBOXZCTITLEZAMOEBA_FORCEFIELDcoordinatesNz%s does not have coordinatesboxZPOINTERSZBOX_DIMENSIONS   )Zparmedr   Zparmed.constantsr   r   Z	flag_listZview_asr   r   r   
isinstancer	   hasattrr   	TypeErrorr   Z	parm_datalistZhasbox)ZparmnameZxyzr   r   r   Zparmf r   4lib/python3.7/site-packages/parmed/amber/readparm.pyr
   &   s.    




 
()NN)__doc__Zparmed.amber.amberformatr   Zparmed.amber._amberparmr   r   Zparmed.amber._chamberparmr   r   Zparmed.amber._tinkerparmr   r   Zparmed.utils.sixr	   AssertionError__all__r
   r   r   r   r   <module>   s   