当前位置: 首页>>代码示例>>Python>>正文


Python md_common.diff_lines函数代码示例

本文整理汇总了Python中md_utils.md_common.diff_lines函数的典型用法代码示例。如果您正苦于以下问题:Python diff_lines函数的具体用法?Python diff_lines怎么用?Python diff_lines使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了diff_lines函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testOwnAtoms

 def testOwnAtoms(self):
     try:
         main(["-c", GLUE_GLUP_OWN_ATOMS_INI])
         self.assertFalse(diff_lines(GLUE_SELECT_OUT, GLUE_SELECT_OWN_OUT_GOOD))
         self.assertFalse(diff_lines(GLUP_SELECT_OUT, GLUP_SELECT_OWN_OUT_GOOD))
     finally:
         [silent_remove(o_file, disable=DISABLE_REMOVE) for o_file in [GLUE_SELECT_OUT, GLUP_SELECT_OUT]]
开发者ID:team-mayes,项目名称:md_utils,代码行数:7,代码来源:test_data_edit.py

示例2: testWaterMol

 def testWaterMol(self):
     try:
         main(["-c", WATER_MOL_INI])
         self.assertFalse(diff_lines(WATER_MOL_OUT1, GOOD_WATER_MOL_OUT1))
         self.assertFalse(diff_lines(WATER_MOL_OUT2, GOOD_WATER_MOL_OUT2))
     finally:
         silent_remove(WATER_MOL_OUT1, disable=DISABLE_REMOVE)
         silent_remove(WATER_MOL_OUT2, disable=DISABLE_REMOVE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:8,代码来源:test_evb_get_info.py

示例3: testSortFromLammps

 def testSortFromLammps(self):
     try:
         main(["-c", SORT_FROM_LAMMPS_INI])
         self.assertFalse(diff_lines(SORT_FROM_LAMMPS, SORT_FROM_LAMMPS_GOOD))
         self.assertFalse(diff_lines(SELECT_FROM_LAMMPS, SELECT_FROM_LAMMPS_GOOD))
     finally:
         silent_remove(SORT_FROM_LAMMPS, disable=DISABLE_REMOVE)
         silent_remove(SELECT_FROM_LAMMPS, disable=DISABLE_REMOVE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:8,代码来源:test_data_edit.py

示例4: testSpecOverwrite

 def testSpecOverwrite(self):
     try:
         main([str(EXP_TEMP), "-o"])
         self.assertFalse(diff_lines(ORIG_WHAM_OUT, GOOD_ORIG_WHAM_OUT))
         self.assertFalse(diff_lines(SHORT_WHAM_OUT, GOOD_SHORT_WHAM_OUT))
     finally:
         silent_remove(ORIG_WHAM_OUT, disable=DISABLE_REMOVE)
         silent_remove(SHORT_WHAM_OUT, disable=DISABLE_REMOVE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:8,代码来源:test_wham_rad.py

示例5: testGood

 def testGood(self):
     try:
         main([PB_GOOD])
         self.assertEqual(2, len(diff_lines(PB_GOOD_XYZ, PB_REF_XYZ, delimiter=" ")))
         self.assertEqual(0, len(diff_lines(PB_GOOD_LOG, PB_REF_LOG)))
     finally:
         silent_remove(PB_GOOD_LOG)
         silent_remove(PB_GOOD_XYZ)
开发者ID:team-mayes,项目名称:md_utils,代码行数:8,代码来源:test_path_bin.py

示例6: testCiInfo

 def testCiInfo(self):
     try:
         main(["-c", CI_INI])
         self.assertFalse(diff_lines(DEF_CI_OUT1, GOOD_CI_OUT1))
         self.assertEquals(1, len(diff_lines(DEF_CI_OUT2, BAD_CI_OUT2)))
         self.assertFalse(diff_lines(DEF_CI_OUT2, GOOD_CI_OUT2))
     finally:
         silent_remove(DEF_CI_OUT1)
         silent_remove(DEF_CI_OUT2)
开发者ID:team-mayes,项目名称:md_utils,代码行数:9,代码来源:test_evb_get_info.py

示例7: testGood

 def testGood(self):
     try:
         # main(["-c", DEF_INI])
         with capture_stdout(main, ["-c", DEF_INI]) as output:
             self.assertTrue("total charge" in output)
         self.assertFalse(diff_lines(VMD_OUT, GOOD_VMD_OUT))
         self.assertFalse(diff_lines(WATER_OUT, GOOD_WATER_OUT))
     finally:
         silent_remove(VMD_OUT)
         silent_remove(WATER_OUT)
开发者ID:team-mayes,项目名称:md_utils,代码行数:10,代码来源:test_evb_chk_get_info.py

示例8: testAtomNumTypeDict

 def testAtomNumTypeDict(self):
     try:
         main(["-c", GLUE_GLUP_INI])
         self.assertFalse(diff_lines(GLUP_GLUE_ATOM_NUM_DICT, GLUP_GLUE_ATOM_NUM_DICT_GOOD))
         self.assertFalse(diff_lines(GLUP_GLUE_ATOM_TYPE_DICT, GLUP_GLUE_ATOM_TYPE_DICT_GOOD))
         self.assertFalse(diff_lines(GLUP_AS_GLUE, GLUP_AS_GLUE_GOOD))
     finally:
         silent_remove(GLUP_GLUE_ATOM_NUM_DICT)
         silent_remove(GLUP_GLUE_ATOM_TYPE_DICT)
         silent_remove(GLUP_AS_GLUE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:10,代码来源:test_data2data.py

示例9: testPrintQMMM

 def testPrintQMMM(self):
     try:
         main(["-c", QMMM_OUT_INI])
         self.assertFalse(diff_lines(QMMM_PDB_OUT, QMMM_PDB_IN))
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QMMM_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_ATOMS_OUT))
     finally:
         silent_remove(QMMM_PDB_OUT)
         silent_remove(QMMM_OUT)
         silent_remove(VMD_ATOMS_OUT)
开发者ID:team-mayes,项目名称:md_utils,代码行数:10,代码来源:test_pdb_edit.py

示例10: testPrintQMMMNoExclude

 def testPrintQMMMNoExclude(self):
     try:
         main(["-c", QM_OUT_INI])
         self.assertFalse(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT))
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QM_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_QM_ATOMS_OUT))
     finally:
         silent_remove(MM_KIND_OUT)
         silent_remove(QMMM_OUT)
         silent_remove(VMD_ATOMS_OUT)
         pass
开发者ID:team-mayes,项目名称:md_utils,代码行数:11,代码来源:test_psf_edit.py

示例11: testHist

 def testHist(self):
     try:
         main(["-f", HIST_INPUT, "-n", "-d", ",", "-s"])
         for p_file in [HIST_PNG1, HIST_PNG2, HIST_PNG3]:
             self.assertGreater(os.path.getsize(p_file), 10000)
         self.assertFalse(diff_lines(HIST_OUT, GOOD_HIST_OUT))
         self.assertFalse(diff_lines(HIST_COUNT, GOOD_HIST_COUNT))
     finally:
         [silent_remove(o_file,
                        disable=DISABLE_REMOVE) for o_file in [HIST_PNG1, HIST_PNG2, HIST_PNG3,
                                                               HIST_OUT, HIST_COUNT, ]]
开发者ID:team-mayes,项目名称:md_utils,代码行数:11,代码来源:test_col_stats.py

示例12: testPrintQMMM

 def testPrintQMMM(self):
     try:
         # main(["-c", QMMM_OUT_INI])
         with capture_stdout(main, ["-c", QMMM_OUT_INI]) as output:
             self.assertTrue("Total charge from QM atoms: -1.0" in output)
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QMMM_OUT))
         self.assertFalse(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_ATOMS_OUT))
     finally:
         silent_remove(QMMM_OUT)
         silent_remove(MM_KIND_OUT)
         silent_remove(VMD_ATOMS_OUT)
开发者ID:team-mayes,项目名称:md_utils,代码行数:12,代码来源:test_psf_edit.py

示例13: testMissingRadius

 def testMissingRadius(self):
     # Tests both providing a dictionary and not having an available radius (still prints everything, just missing
     # one radius)
     try:
         with capture_stderr(main, ["-c", MISSING_RADIUS_INI]) as output:
             self.assertTrue("Did not find atom type 'XYZ' in the atom_type to radius dictionary" in output)
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QMMM_OUT))
         self.assertEqual(3, len(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT)))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_ATOMS_OUT))
     finally:
         silent_remove(QMMM_OUT)
         silent_remove(MM_KIND_OUT)
         silent_remove(VMD_ATOMS_OUT)
开发者ID:team-mayes,项目名称:md_utils,代码行数:13,代码来源:test_psf_edit.py

示例14: testOneStateEachFileCiInfo

 def testOneStateEachFileCiInfo(self):
     """
     Make sure can handle input that only has one state (such steps have a vector instead of a matrix)
     this time, printing a separate output for each file
     And, skip one-state-steps
     """
     try:
         main(["-c", CI_ONE_STATE_EACH_FILE_INI])
         self.assertFalse(diff_lines(DEF_ONE_STATE_OUT, GOOD_ONE_STATE_OUT))
         self.assertFalse(diff_lines(DEF_ONE_STATE_OUT2, GOOD_ONE_STATE_OUT2))
     finally:
         silent_remove(DEF_ONE_STATE_OUT)
         silent_remove(DEF_ONE_STATE_OUT2)
开发者ID:team-mayes,项目名称:md_utils,代码行数:13,代码来源:test_evb_get_info.py

示例15: testMultiLineSepIni

 def testMultiLineSepIni(self):
     # have different rows create different files
     # test that if the prefix is already used, number it
     # test if nothing common in the file base names, number it
     try:
         main(["-f", MULTI_LINE_CMP_LIST, "-s", "-l", SUB_DATA_DIR])
         self.assertFalse(diff_lines(LINE1_OUT, GOOD_LINE1_OUT))
         self.assertFalse(diff_lines(LINE2_OUT, GOOD_LINE2_OUT))
         self.assertFalse(diff_lines(LINE3_OUT, GOOD_LINE1_OUT))
         self.assertFalse(diff_lines(LINE4_OUT, GOOD_LINE1_OUT))
     finally:
         silent_remove(LINE1_OUT, disable=DISABLE_REMOVE)
         silent_remove(LINE2_OUT, disable=DISABLE_REMOVE)
         silent_remove(LINE3_OUT, disable=DISABLE_REMOVE)
         silent_remove(LINE4_OUT, disable=DISABLE_REMOVE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:15,代码来源:test_align_on_col.py


注:本文中的md_utils.md_common.diff_lines函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。