コード例 #1
0
    def test_5ala_3_hop(self):
        """ Correct input for HOP with one basis """
        filename = "temp.inp"
        otherfile = self.fixtures + "/5ala_3_hop.fixture"
        molecule = fileToMol("tests/5ala.xyz")
        fragmentation = Fragmentation(molecule, defaults=FragItDataFMO)
        fragmentation.setFMOHOPFragmentation()
        fragmentation.setQMBasis('3-21G')
        fragmentation.beginFragmentation()
        fragmentation.doFragmentation()
        fragmentation.finishFragmentation()
        directories = {'share': 'share'}
        gamessfmo = GamessFMO(fragmentation, directories)
        gamessfmo.setCentralFragmentID(1)
        gamessfmo.setBoundariesFromString("1.0")
        gamessfmo.setup()
        gamessfmo.writeFile(filename)
        generated = ReadStringListFromFile(filename)
        fixture = ReadStringListFromFile(otherfile)

        self.assertEqual(len(generated), len(fixture))
        for i in range(len(fixture)):
            self.assertEqual(generated[i], fixture[i])

        self.delete_file(filename)
コード例 #2
0
    def test_2form8wat_2(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/2form8wat_2.fixture"
      molecule = fileToMol("tests/2form8wat.pdb")
      fragmentation = Fragmentation(molecule)
      fragmentation.beginFragmentation()
      fragmentation.doFragmentation()
      fragmentation.finishFragmentation()
      fragmentation.setFMOEFPWatersFromLayer(1)
      directories = {'share':''}
      gamessfmo = GamessFMO(fragmentation, directories)
      gamessfmo.setCentralFragmentID(1)
      gamessfmo.setBoundariesFromString("3.0")
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))

      ignoring = False
      for i in range(len(fixture)):
        if "EFRAG" in generated[i] or "EFRAG" in fixture[i]:
            ignoring = True

        if ignoring:
            if "END" in generated[i] or "END" in fixture[i]:
                ignoring = False

        if not ignoring:
            self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #3
0
    def test_5ala_3_hop(self):
      """ Regression test to make sure if only one basis
          set is specified we get the correct input file
          FMO with HOP
      """
      filename = "temp.inp"
      otherfile = self.fixtures + "/5ala_3_hop.fixture"
      molecule = fileToMol("tests/5ala.xyz")
      fragmentation = Fragmentation(molecule)
      fragmentation.setFMOHOPFragmentation()
      fragmentation.setQMBasis('3-21G')
      fragmentation.beginFragmentation()
      fragmentation.doFragmentation()
      fragmentation.finishFragmentation()
      directories = {'share':'share'}
      gamessfmo = GamessFMO(fragmentation, directories)
      gamessfmo.setCentralFragmentID(1)
      gamessfmo.setBoundariesFromString("1.0")
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #4
0
    def test_2form8wat_2(self):
        filename = "temp.inp"
        otherfile = self.fixtures + "/2form8wat_2.fixture"
        molecule = fileToMol("tests/2form8wat.pdb")
        fragmentation = Fragmentation(molecule, defaults=FragItDataFMO)
        fragmentation.beginFragmentation()
        fragmentation.doFragmentation()
        fragmentation.finishFragmentation()
        fragmentation.setFMOEFPWatersFromLayer(1)
        directories = {'share': ''}
        gamessfmo = GamessFMO(fragmentation, directories)
        gamessfmo.setCentralFragmentID(1)
        gamessfmo.setBoundariesFromString("3.0")
        gamessfmo.setup()
        gamessfmo.writeFile(filename)
        generated = ReadStringListFromFile(filename)
        fixture = ReadStringListFromFile(otherfile)

        self.assertEqual(len(generated), len(fixture))

        ignoring = False
        for i in range(len(fixture)):
            if "EFRAG" in generated[i] or "EFRAG" in fixture[i]:
                ignoring = True

            if ignoring:
                if "END" in generated[i] or "END" in fixture[i]:
                    ignoring = False

            if not ignoring:
                self.assertEqual(generated[i], fixture[i])

        self.delete_file(filename)
コード例 #5
0
    def test_water_1(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/water_1.fixture"
      gamessfmo = GamessFMO(self.fragmentation)
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #6
0
    def test_water_1(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/water_1.fixture"
      molecule = fileToMol("tests/watercluster4.xyz")
      fragmentation = Fragmentation(molecule)
      directories = {'share':''}
      gamessfmo = GamessFMO(fragmentation, directories)
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #7
0
    def test_water_1(self):
        filename = "temp.inp"
        otherfile = self.fixtures + "/water_1.fixture"
        molecule = fileToMol("tests/watercluster4.xyz")
        fragmentation = Fragmentation(molecule, defaults=FragItDataFMO)
        directories = {'share': ''}
        gamessfmo = GamessFMO(fragmentation, directories)
        gamessfmo.setup()
        gamessfmo.writeFile(filename)
        generated = ReadStringListFromFile(filename)
        fixture = ReadStringListFromFile(otherfile)

        self.assertEqual(len(generated), len(fixture))
        for i in range(len(fixture)):
            self.assertEqual(generated[i], fixture[i])

        self.delete_file(filename)
コード例 #8
0
    def test_water_4(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/water_4.fixture"
      self.fragmentation.beginFragmentation()
      self.fragmentation.doFragmentation()
      self.fragmentation.finishFragmentation()
      gamessfmo = GamessFMO(self.fragmentation)
      gamessfmo.setCentralFragmentID(1)
      gamessfmo.setBoundariesFromString("1.0")
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #9
0
    def test_5ala_1_hop(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/5ala_1_hop.fixture"
      molecule = fileToMol("tests/5ala.xyz")
      fragmentation = Fragmentation(molecule)
      fragmentation.setFMOHOPFragmentation()
      fragmentation.beginFragmentation()
      fragmentation.doFragmentation()
      fragmentation.finishFragmentation()
      directories = {'share':'share'}
      gamessfmo = GamessFMO(fragmentation, directories)
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #10
0
    def test_5ala_1_hop(self):
        filename = "temp.inp"
        otherfile = self.fixtures + "/5ala_1_hop.fixture"
        molecule = fileToMol("tests/5ala.xyz")
        fragmentation = Fragmentation(molecule, defaults=FragItDataFMO)
        fragmentation.setFMOHOPFragmentation()
        fragmentation.beginFragmentation()
        fragmentation.doFragmentation()
        fragmentation.finishFragmentation()
        directories = {'share': 'share'}
        gamessfmo = GamessFMO(fragmentation, directories)
        gamessfmo.setup()
        gamessfmo.writeFile(filename)
        generated = ReadStringListFromFile(filename)
        fixture = ReadStringListFromFile(otherfile)

        self.assertEqual(len(generated), len(fixture))
        for i in range(len(fixture)):
            self.assertEqual(generated[i], fixture[i])

        self.delete_file(filename)
コード例 #11
0
    def test_5ala_2_afo(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/5ala_2_afo.fixture"
      molecule = fileToMol("tests/5ala.xyz")
      fragmentation = Fragmentation(molecule)
      fragmentation.setQMBasis('3-21G:6-31G(d)')
      fragmentation.beginFragmentation()
      fragmentation.doFragmentation()
      fragmentation.finishFragmentation()
      directories = {'share':'share'}
      gamessfmo = GamessFMO(fragmentation, directories)
      gamessfmo.setCentralFragmentID(1)
      gamessfmo.setBoundariesFromString("1.0")
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #12
0
    def test_water_5(self):
      filename = "temp.inp"
      otherfile = self.fixtures + "/water_5.fixture"
      molecule = fileToMol("tests/watercluster4.xyz")
      fragmentation = Fragmentation(molecule)
      fragmentation.beginFragmentation()
      fragmentation.doFragmentation()
      fragmentation.finishFragmentation()
      directories = {'share':''}
      gamessfmo = GamessFMO(fragmentation, directories)
      gamessfmo.setCentralFragmentID(1)
      gamessfmo.setBoundariesFromString("1.0")
      gamessfmo.setActiveAtomsDistance(1.0)
      gamessfmo.setBufferMaxDistance(1.0)
      gamessfmo.setup()
      gamessfmo.writeFile(filename)
      generated = ReadStringListFromFile(filename)
      fixture = ReadStringListFromFile(otherfile)

      self.assertEqual(len(generated), len(fixture))
      for i in range(len(fixture)):
        self.assertEqual(generated[i], fixture[i])

      self.delete_file(filename)
コード例 #13
0
    def test_water_5(self):
        filename = "temp.inp"
        otherfile = self.fixtures + "/water_5.fixture"
        molecule = fileToMol("tests/watercluster4.xyz")
        fragmentation = Fragmentation(molecule, defaults=FragItDataFMO)
        fragmentation.beginFragmentation()
        fragmentation.doFragmentation()
        fragmentation.finishFragmentation()
        directories = {'share': ''}
        gamessfmo = GamessFMO(fragmentation, directories)
        gamessfmo.setCentralFragmentID(1)
        gamessfmo.setBoundariesFromString("1.0")
        gamessfmo.setActiveAtomsDistance(1.0)
        gamessfmo.setBufferMaxDistance(1.0)
        gamessfmo.setup()
        gamessfmo.writeFile(filename)
        generated = ReadStringListFromFile(filename)
        fixture = ReadStringListFromFile(otherfile)

        self.assertEqual(len(generated), len(fixture))
        for i in range(len(fixture)):
            self.assertEqual(generated[i], fixture[i])

        self.delete_file(filename)