# IODATA is an input and output module for quantum chemistry.# Copyright (C) 2011-2019 The IODATA Development Team## This file is part of IODATA.## IODATA 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 3# of the License, or (at your option) any later version.## IODATA 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, see <http://www.gnu.org/licenses/># --"""Test iodata.formats.orcalog module."""fromimportlib.resourcesimportas_file,filesfromnumpy.testingimportassert_allclose,assert_equalfrom..apiimportload_onefrom..utilsimportamu,angstrom
[docs]deftest_load_crambin():# test CHARMM crd file of crambinwithas_file(files("iodata.test.data").joinpath("crambin.crd"))asfn_crd:mol=load_one(str(fn_crd))assertlen(mol.title)==125assertmol.atcoords.shape==(648,3)assert_allclose(mol.atcoords[-1]/angstrom,[7.35403,-5.09628,2.73659])assertmol.atffparams["attypes"].shape==(648,)assertmol.atffparams["resnums"].shape==(648,)assertmol.atffparams["resnames"].shape==(648,)assertmol.atffparams["attypes"][-1]=="OT2"assert_equal(mol.atffparams["resnums"][46:48],[4,4])assertmol.atffparams["resnames"][-1]=="ASN"assertmol.extra["segid"].shape==(648,)assertmol.extra["resid"].shape==(648,)assertmol.extra["segid"][-1]=="MAIN"assertmol.extra["resid"][-1]==46assertmol.atmasses[-1]==15.99900*amu