• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python md_common.diff_lines函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: testDefInp

 def testDefInp(self):
     try:
         with capture_stdout(main, ["-f", DEF_INPUT, "-c", DEF_INI]) as output:
             self.assertTrue("Keeping 2 of 4 rows based on filtering criteria" in output)
         self.assertFalse(diff_lines(CSV_OUT, GOOD_CSV_OUT))
     finally:
         silent_remove(CSV_OUT)
开发者ID:team-mayes,项目名称:md_utils,代码行数:7,代码来源:test_filter_col.py


示例17: testWaterMolCombine

 def testWaterMolCombine(self):
     # Should skip the timestep with only 1 state
     try:
         main(["-c", WATER_MOL_COMB_INI])
         self.assertFalse(diff_lines(WATER_MOL_COMB_OUT, GOOD_WATER_MOL_COMB_OUT))
     finally:
         silent_remove(WATER_MOL_COMB_OUT)
开发者ID:team-mayes,项目名称:md_utils,代码行数:7,代码来源:test_evb_get_info.py


示例18: testDefInp

 def testDefInp(self):
     try:
         with capture_stdout(main, ["-f", DEF_INPUT]) as output:
             self.assertTrue(GOOD_OUT in output)
             self.assertFalse(diff_lines(CSV_OUT, GOOD_CSV_OUT))
     finally:
         silent_remove(CSV_OUT, disable=DISABLE_REMOVE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:7,代码来源:test_col_stats.py


示例19: testSubsetCiInfo

 def testSubsetCiInfo(self):
     with capture_stderr(main, ["-c", CI_SUBSET_INI]) as output:
         self.assertTrue("found no data from" in output)
         self.assertFalse(diff_lines(DEF_CI_SUBSET_OUT, GOOD_CI_SUBSET_OUT))
         silent_remove(DEF_CI_SUBSET_OUT)
         silent_remove(DEF_CI_OUT1)
         silent_remove(DEF_CI_OUT2)
开发者ID:team-mayes,项目名称:md_utils,代码行数:7,代码来源:test_evb_get_info.py


示例20: testIncompDump

 def testIncompDump(self):
     try:
         with capture_stderr(main, ["-c", INCOMP_DUMP_INI_PATH]) as output:
             self.assertTrue("WARNING" in output)
         self.assertFalse(diff_lines(DEF_GOFR_INCOMP_OUT, GOOD_HO_GOFR_OUT_PATH))
     finally:
         silent_remove(DEF_GOFR_INCOMP_OUT, disable=DISABLE_REMOVE)
开发者ID:team-mayes,项目名称:md_utils,代码行数:7,代码来源:test_lammps_proc.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python md_common.silent_remove函数代码示例发布时间:2022-05-27
下一篇:
Python md_common.capture_stderr函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap