mlatom 3.2.0__tar.gz → 3.4.0b0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. {mlatom-3.2.0/src/mlatom.egg-info → mlatom-3.4.0b0}/PKG-INFO +4 -4
  2. {mlatom-3.2.0 → mlatom-3.4.0b0}/README.md +3 -3
  3. {mlatom-3.2.0 → mlatom-3.4.0b0}/setup.py +1 -1
  4. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatom.py +5 -9
  5. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLtasks.py +22 -5
  6. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/__init__.py +1 -1
  7. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1.py +95 -71
  8. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/args_class.py +54 -56
  9. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/conversions.py +2 -2
  10. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/data.py +151 -1
  11. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/doc.py +1 -0
  12. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/header.py +4 -0
  13. mlatom-3.4.0b0/src/mlatom/initial_conditions.py +588 -0
  14. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/__init__.py +8 -0
  15. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/ase_interface.py +30 -15
  16. mlatom-3.4.0b0/src/mlatom/interfaces/columbus_interface.py +157 -0
  17. mlatom-3.4.0b0/src/mlatom/interfaces/dftd4_interface.py +127 -0
  18. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/gaussian_interface.py +64 -46
  19. mlatom-3.4.0b0/src/mlatom/interfaces/mndo_interface.py +435 -0
  20. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/orca_interface.py +2 -2
  21. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/torchani_interface.py +9 -4
  22. mlatom-3.4.0b0/src/mlatom/interfaces/turbomole_interface.py +213 -0
  23. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/kreg_api.py +3 -10
  24. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/log.py +6 -2
  25. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/md.py +9 -20
  26. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/md2vibr.py +9 -9
  27. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/models.py +115 -31
  28. mlatom-3.4.0b0/src/mlatom/namd.py +483 -0
  29. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/ref.json +2 -1
  30. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/simulations.py +251 -68
  31. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/utils.py +148 -0
  32. {mlatom-3.2.0 → mlatom-3.4.0b0/src/mlatom.egg-info}/PKG-INFO +4 -4
  33. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom.egg-info/SOURCES.txt +3 -0
  34. mlatom-3.2.0/src/mlatom/initial_conditions.py +0 -221
  35. mlatom-3.2.0/src/mlatom/interfaces/dftd4_interface.py +0 -120
  36. mlatom-3.2.0/src/mlatom/interfaces/mndo_interface.py +0 -187
  37. {mlatom-3.2.0 → mlatom-3.4.0b0}/LICENSE.txt +0 -0
  38. {mlatom-3.2.0 → mlatom-3.4.0b0}/setup.cfg +0 -0
  39. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLTPA.py +0 -0
  40. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/ML_NEA.py +0 -0
  41. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF +0 -0
  42. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/A_KRR.f90 +0 -0
  43. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/A_KRR_kernel.f90 +0 -0
  44. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/D_CoulombMatrix.f90 +0 -0
  45. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/D_ID.f90 +0 -0
  46. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/D_rel2eq.f90 +0 -0
  47. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/MLatomF.f90 +0 -0
  48. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/MLatomFInfo.f90 +0 -0
  49. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/MLmodel.f90 +0 -0
  50. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/Makefile +0 -0
  51. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/Makefile.intel +0 -0
  52. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/__init__.py +0 -0
  53. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/analyze.f90 +0 -0
  54. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/constants.f90 +0 -0
  55. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/cs.cpp +0 -0
  56. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/dataset.f90 +0 -0
  57. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/mathUtils.f90 +0 -0
  58. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/molDescr.f90 +0 -0
  59. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/optionsModule.f90 +0 -0
  60. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/precision.f90 +0 -0
  61. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/recover.sh +0 -0
  62. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/sampling.f90 +0 -0
  63. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/statistics.f90 +0 -0
  64. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/stopper.f90 +0 -0
  65. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/strings.f90 +0 -0
  66. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/timing.f90 +0 -0
  67. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/MLatomF_src/types.f90 +0 -0
  68. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/__init__.py +0 -0
  69. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv0.pt +0 -0
  70. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv1.pt +0 -0
  71. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv2.pt +0 -0
  72. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv3.pt +0 -0
  73. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv4.pt +0 -0
  74. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv5.pt +0 -0
  75. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv6.pt +0 -0
  76. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_cc_cv7.pt +0 -0
  77. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv0.pt +0 -0
  78. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv1.pt +0 -0
  79. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv2.pt +0 -0
  80. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv3.pt +0 -0
  81. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv4.pt +0 -0
  82. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv5.pt +0 -0
  83. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv6.pt +0 -0
  84. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/aiqm1_model/aiqm1_dft_cv7.pt +0 -0
  85. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/ccsdtstarcbs.py +0 -0
  86. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/composite_methods.py +0 -0
  87. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/constants.py +0 -0
  88. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/cs.so +0 -0
  89. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/decorators.py +0 -0
  90. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/fortran/KREG.f90 +0 -0
  91. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/fortran/__init__.py +0 -0
  92. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/fortran/compile.py +0 -0
  93. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/fortran/mathUtils.f90 +0 -0
  94. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/fortran/stopper.f90 +0 -0
  95. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interface_MLatomF.py +0 -0
  96. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/dpmd_interface.py +0 -0
  97. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/gap_interface.py +0 -0
  98. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/mace_interface.py +0 -0
  99. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/physnet_interface.py +0 -0
  100. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/pyscf_interface.py +0 -0
  101. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/sgdml_interface.py +0 -0
  102. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/sparrow_interface.py +0 -0
  103. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/interfaces/xtb_interface.py +0 -0
  104. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/md2vibr_cmd.py +0 -0
  105. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/md_cmd.py +0 -0
  106. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/mlatom_gui.py +0 -0
  107. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/mltpa/__init__.py +0 -0
  108. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/mltpa/mff.txt +0 -0
  109. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/mltpa/mltpa2022_2.pkl +0 -0
  110. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/mltpa/mltpa2022_2_new_.pkl +0 -0
  111. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/plot.py +0 -0
  112. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/shell_cmd.py +0 -0
  113. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/sliceData.py +0 -0
  114. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/stats.py +0 -0
  115. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/stopper.py +0 -0
  116. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/thermostat.py +0 -0
  117. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom/xyz.py +0 -0
  118. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom.egg-info/dependency_links.txt +0 -0
  119. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom.egg-info/entry_points.txt +0 -0
  120. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom.egg-info/requires.txt +0 -0
  121. {mlatom-3.2.0 → mlatom-3.4.0b0}/src/mlatom.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlatom
3
- Version: 3.2.0
3
+ Version: 3.4.0b0
4
4
  Summary: A Package for Atomistic Simulations with Machine Learning
5
5
  Home-page: http://mlatom.com
6
6
  Author: Pavlo O. Dral
@@ -27,7 +27,7 @@ Requires-Dist: tqdm
27
27
  # About Program
28
28
  MLatom: a Package for Atomistic Simulations with Machine Learning
29
29
 
30
- Version 3.2.0
30
+ Version 3.4.0
31
31
 
32
32
  **Official website**: http://mlatom.com/
33
33
  **Manual**: http://mlatom.com/manual/
@@ -60,7 +60,7 @@ When this Software or its derivatives are used in scientific publications, it sh
60
60
  * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Mario Barbatti, Olexandr Isayev, Cheng Wang, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Lina Zhang, Shuang Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou. [MLatom 3: A Platform for Machine Learning-enhanced Computational Chemistry Simulations and Workflows](https://doi.org/10.1021/acs.jctc.3c01203). *J. Chem. Theory Comput.* **2024**, *20*, 1193--1213.
61
61
  * Pavlo O. Dral, Fuchun Ge, Bao-Xin Xue, Yi-Fan Hou, Max Pinheiro Jr, Jianxing Huang, Mario Barbatti. [MLatom 2: An Integrative Platform for Atomistic Machine Learning](http://doi.org/10.1007/s41061-021-00339-5). *Top. Curr. Chem.* **2021**, *379*, 27.
62
62
  * Pavlo O. Dral. [MLatom: A Program Package for Quantum Chemical Research Assisted by Machine Learning](http://dx.doi.org/10.1002/jcc.26004). *J. Comput. Chem.* **2019**, *40*, 2339--2347.
63
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.2.0, Xiamen University, Xiamen, China, 2013-2024.
63
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.4.0, Xiamen University, Xiamen, China, 2013-2024.
64
64
  [MLatom.com](http://mlatom.com).
65
65
 
66
66
  The citations for MLatom's interfaces and features shall be eventually
@@ -109,7 +109,7 @@ Citations mentioned above should be included. For convenience, below we provide
109
109
  }
110
110
 
111
111
  @misc{MLatomProg,
112
- author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Ou, Yanchi},
112
+ author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Pios, Sebastian V. and Ou, Yanchi},
113
113
  title = {MLatom: A Package for Atomistic Simulations with Machine Learning},
114
114
  year = {2013--2024},
115
115
  type = {Computer Program}
@@ -1,7 +1,7 @@
1
1
  # About Program
2
2
  MLatom: a Package for Atomistic Simulations with Machine Learning
3
3
 
4
- Version 3.2.0
4
+ Version 3.4.0
5
5
 
6
6
  **Official website**: http://mlatom.com/
7
7
  **Manual**: http://mlatom.com/manual/
@@ -34,7 +34,7 @@ When this Software or its derivatives are used in scientific publications, it sh
34
34
  * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Mario Barbatti, Olexandr Isayev, Cheng Wang, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Lina Zhang, Shuang Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou. [MLatom 3: A Platform for Machine Learning-enhanced Computational Chemistry Simulations and Workflows](https://doi.org/10.1021/acs.jctc.3c01203). *J. Chem. Theory Comput.* **2024**, *20*, 1193--1213.
35
35
  * Pavlo O. Dral, Fuchun Ge, Bao-Xin Xue, Yi-Fan Hou, Max Pinheiro Jr, Jianxing Huang, Mario Barbatti. [MLatom 2: An Integrative Platform for Atomistic Machine Learning](http://doi.org/10.1007/s41061-021-00339-5). *Top. Curr. Chem.* **2021**, *379*, 27.
36
36
  * Pavlo O. Dral. [MLatom: A Program Package for Quantum Chemical Research Assisted by Machine Learning](http://dx.doi.org/10.1002/jcc.26004). *J. Comput. Chem.* **2019**, *40*, 2339--2347.
37
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.2.0, Xiamen University, Xiamen, China, 2013-2024.
37
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.4.0, Xiamen University, Xiamen, China, 2013-2024.
38
38
  [MLatom.com](http://mlatom.com).
39
39
 
40
40
  The citations for MLatom's interfaces and features shall be eventually
@@ -83,7 +83,7 @@ Citations mentioned above should be included. For convenience, below we provide
83
83
  }
84
84
 
85
85
  @misc{MLatomProg,
86
- author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Ou, Yanchi},
86
+ author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Pios, Sebastian V. and Ou, Yanchi},
87
87
  title = {MLatom: A Package for Atomistic Simulations with Machine Learning},
88
88
  year = {2013--2024},
89
89
  type = {Computer Program}
@@ -43,7 +43,7 @@ with open(os.path.join(here, 'README.md')) as f:
43
43
 
44
44
  setup(
45
45
  name = pkg_name,
46
- version = "3.2.0",
46
+ version = "3.4.0-beta",
47
47
  author = "Pavlo O. Dral",
48
48
  author_email = "admin@mlatom.com",
49
49
  license = 'MIT (modified)',
@@ -4,7 +4,7 @@
4
4
  !---------------------------------------------------------------------------!
5
5
  ! !
6
6
  ! MLatom: a Package for Atomistic Simulations with Machine Learning !
7
- ! MLatom 3.2.0 !
7
+ ! MLatom 3.4.0 !
8
8
  ! @ !
9
9
  ! Xiamen Atomistic Computing Suite (XACS) !
10
10
  ! !
@@ -32,15 +32,11 @@
32
32
  ! Shuang Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou. !
33
33
  ! J. Chem. Theory Comput. 2024, 20, 1193-1213. !
34
34
  ! !
35
- ! Pavlo O. Dral, Fuchun Ge, Bao-Xin Xue, Yi-Fan Hou, Max Pinheiro Jr, !
36
- ! Jianxing Huang, Mario Barbatti, Top. Curr. Chem. 2021, 379, 27 !
37
- ! Pavlo O. Dral, J. Comput. Chem. 2019, 40, 2339-2347. !
38
- ! !
39
- ! Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, !
40
- ! Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, !
41
- ! Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou, !
35
+ ! Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin!
36
+ ! Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, !
37
+ ! Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, !
42
38
  ! MLatom: A Package for Atomistic Simulations with Machine Learning, !
43
- ! version 3.2.0, Xiamen University, Xiamen, China, 2013-2024. !
39
+ ! version 3.4.0, Xiamen University, Xiamen, China, 2013-2024. !
44
40
  ! !
45
41
  ! The citations for MLatom's interfaces and features shall be eventually !
46
42
  ! included too. See header.py, ref.json and http://mlatom.com. !
@@ -367,7 +367,10 @@ def geomopt(args):
367
367
  molDB = loading_data(XYZfile=args.XYZfile, charges=args.charges, multiplicities=args.multiplicities)
368
368
  model = loading_model(args)
369
369
  fname = args.optXYZ
370
- if os.path.exists(fname): stopper.stopMLatom(f'File {fname} already exists; please delete or rename it')
370
+ # if os.path.exists(fname): stopper.stopMLatom(f'File {fname} already exists; please delete or rename it')
371
+ if os.path.exists(fname):
372
+ os.remove(fname)
373
+ print(f' * Warning * File {fname} already exists; MLatom will overwrite {fname}')
371
374
  db_opt = data.molecular_database()
372
375
  kwargs = {}
373
376
  if args.optProg: kwargs['program'] = args.optprog
@@ -375,16 +378,28 @@ def geomopt(args):
375
378
  if args.ase.fmax: kwargs['convergence_criterion_for_forces'] = float(args.ase.fmax)
376
379
  if args.ase.steps: kwargs['maximum_number_of_steps'] = int(args.ase.steps)
377
380
  if args.ase.optimizer: kwargs['optimization_algorithm'] = args.ase.optimizer
381
+ if len(molDB.molecules)<=10:
382
+ kwargs['print_properties'] = 'all'
383
+ else:
384
+ kwargs['print_properties'] = 'min'
385
+ if args.printall: kwargs['print_properties'] = 'all'
386
+ if args.printmin: kwargs['print_properties'] = None
387
+ if args.dumpopttrajs:
388
+ kwargs['dump_trajectory_interval'] = 1
389
+ else:
390
+ kwargs['dump_trajectory_interval'] = None
391
+ kwargs['format'] = 'json'
378
392
  for imol, mol in enumerate(molDB):
379
393
  mol.number = imol+1
394
+ print(' %s ' % ('='*78))
395
+ print(' Optimization of molecule %d' % (imol+1))
396
+ print(' %s \n' % ('='*78))
397
+ kwargs['filename'] = f'opttraj{imol+1}.json'
380
398
  geomopt = simulations.optimize_geometry(model=model,
381
399
  initial_molecule=mol,
382
400
  **kwargs)
383
401
  db_opt.molecules.append(geomopt.optimized_molecule)
384
- print(' %s ' % ('='*78))
385
- print(' Optimization of molecule %d' % (imol+1))
386
- print(' %s \n' % ('='*78))
387
- print(f' {"Iteration":^10s} {"Energy (Hartree)":^25s}') # units?
402
+ print(f'\n\n {"Iteration":^10s} {"Energy (Hartree)":^25s}')
388
403
  for step in geomopt.optimization_trajectory.steps:
389
404
  print(' %10d %25.13f' % (step.step+1, step.molecule.energy))
390
405
  if args.AIQM1 or args.AIQM1DFT or args.AIQM1DFTstar:
@@ -522,6 +537,8 @@ def MLTPA(args):
522
537
  # Reusable functions below. Name with -ing form
523
538
  def loading_data(XYZfile, Yfile=None, YgradXYZfile=None, charges=None, multiplicities=None):
524
539
  assert XYZfile, 'please provide data file(s) needed.'
540
+ if not os.path.exists(XYZfile):
541
+ stopper.stopMLatom(f'xyz file {XYZfile} is not found!')
525
542
  molecular_database = data.molecular_database.from_xyz_file(XYZfile)
526
543
  if Yfile:
527
544
  molecular_database.add_scalar_properties_from_file(Yfile)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- from . import data, models, plot, simulations, stats, xyz
2
+ from . import data, models, plot, simulations, stats, xyz, namd, constants
3
3
  from .simulations import optimize_geometry, irc, freq, thermochemistry, md, generate_initial_conditions, vibrational_spectrum
4
4
  from .data import atom, molecule, molecular_database
5
5
  from .models import methods
@@ -11,16 +11,13 @@ import numpy as np
11
11
  import os
12
12
  from . import data, models, stopper
13
13
 
14
- try:
15
- import torch
16
- import torchani
17
- from torchani.utils import ChemicalSymbolsToInts
18
- except:
19
- raise ValueError('Please install all Python modules required for TorchANI')
14
+ import torch
15
+ import torchani
16
+ from torchani.utils import ChemicalSymbolsToInts
20
17
 
21
18
  class aiqm1(models.torchani_model):
22
19
  """
23
- The Artificial intelligencequantum mechanical method as in the `AIQM1 paper`_.
20
+ The Artificial intelligence-quantum mechanical method as in the `AIQM1 paper`_.
24
21
 
25
22
  Arguments:
26
23
  method (str, optional): AIQM method used. Currently supports AIQM1, AIQM1\@DFT*, and AIQM1\@DFT. Default value: AIQM1.
@@ -69,50 +66,67 @@ class aiqm1(models.torchani_model):
69
66
  self.aiqm1_model = models.model_tree_node(name=modelname, children=aiqm1_children, operator='sum')
70
67
 
71
68
  def predict(self, molecular_database=None, molecule=None,
72
- calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False):
73
- if molecular_database != None:
74
- molDB = molecular_database
75
- elif molecule != None:
76
- molDB = data.molecular_database()
77
- molDB.molecules.append(molecule)
78
- else:
79
- errmsg = 'Either molecule or molecular_database should be provided in input'
80
- raise ValueError(errmsg)
81
-
69
+ calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False, nstates=1, current_state=0, **kwargs):
70
+ molDB = super().predict(molecular_database=molecular_database, molecule=molecule)
71
+ if 'nthreads' in self.__dict__: self.aiqm1_model.nthreads = self.nthreads
82
72
  for mol in molDB.molecules:
83
73
  self.predict_for_molecule(molecule=mol,
84
- calculate_energy=calculate_energy, calculate_energy_gradients=calculate_energy_gradients, calculate_hessian=calculate_hessian)
74
+ calculate_energy=calculate_energy, calculate_energy_gradients=calculate_energy_gradients, calculate_hessian=calculate_hessian, nstates=nstates,
75
+ current_state=current_state,
76
+ **kwargs)
85
77
 
86
78
  def predict_for_molecule(self, molecule=None,
87
- calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False):
79
+ calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False, nstates=1, current_state=0, **kwargs):
88
80
 
89
81
  for atom in molecule.atoms:
90
82
  if not atom.atomic_number in [1, 6, 7, 8]:
91
- print(' * Warning * Molecule contains elements other than CHNO, no calculations performed')
92
- return
83
+ errmsg = ' * Warning * Molecule contains elements other than CHNO, no calculations performed'
84
+ # print(errmsg)
85
+ raise ValueError(errmsg)
93
86
 
87
+ if nstates >1:
88
+ mol_copy = molecule.copy()
89
+ mol_copy.electronic_states = []
90
+ for _ in range(nstates - len(molecule.electronic_states)):
91
+ molecule.electronic_states.append(mol_copy.copy())
92
+
93
+ # for molecule in molecules:
94
94
  if len(molecule.atoms) == 1:
95
95
  molecule.energy = self.atomic_energies[self.method][molecule.atoms[0].atomic_number]
96
96
  standard_atom = data.atom(atomic_number=molecule.atoms[0].atomic_number)
97
97
  if molecule.charge != 0 or molecule.multiplicity != standard_atom.multiplicity:
98
98
  odm2model = models.methods(method='ODM2*', program=self.qm_program)
99
99
  mol_odm2 = molecule.copy()
100
- odm2model.predict(molecule=mol_odm2)
100
+ odm2model.predict(molecule=mol_odm2, nstates=nstates, **kwargs)
101
101
  mol_standard_odm2 = molecule.copy() ; mol_standard_odm2.charge = 0; mol_standard_odm2.multiplicity=standard_atom.multiplicity
102
- odm2model.predict(molecule=mol_standard_odm2)
102
+ odm2model.predict(molecule=mol_standard_odm2, nstates=nstates, **kwargs)
103
103
  molecule.energy = molecule.energy + mol_odm2.energy - mol_standard_odm2.energy
104
104
  else:
105
+ if nstates > 1 and isinstance(calculate_energy_gradients, list):
106
+ if any(calculate_energy_gradients):
107
+ calculate_energy_gradients = [True] * nstates
105
108
  self.aiqm1_model.predict(molecule=molecule,
106
- calculate_energy=calculate_energy, calculate_energy_gradients=calculate_energy_gradients, calculate_hessian=calculate_hessian)
109
+ calculate_energy=calculate_energy, calculate_energy_gradients=calculate_energy_gradients, calculate_hessian=calculate_hessian, nstates=nstates,
110
+ current_state=current_state,
111
+ **kwargs)
107
112
 
108
113
  properties = [] ; atomic_properties = []
114
+
115
+ calculate_energy_gradients = bool(np.array(calculate_energy_gradients).any())
116
+ calculate_hessian = bool(np.array(calculate_hessian).any())
109
117
  if calculate_energy: properties.append('energy')
110
118
  if calculate_energy_gradients: atomic_properties.append('energy_gradients')
111
119
  if calculate_hessian: properties.append('hessian')
112
120
  modelname = self.method.lower().replace('*','star').replace('@','at')
113
- molecule.__dict__[f'{modelname}_nn'].standard_deviation(properties=properties+atomic_properties)
114
121
 
115
- class atomic_energy_shift():
122
+ if nstates >1:
123
+ for mol_el_st in molecule.electronic_states:
124
+ mol_el_st.__dict__[f'{modelname}_nn'].standard_deviation(properties=properties+atomic_properties)
125
+ else:
126
+ molecule.__dict__[f'{modelname}_nn'].standard_deviation(properties=properties+atomic_properties)
127
+
128
+
129
+ class atomic_energy_shift(models.model):
116
130
  atomic_energy_shifts = {'AIQM1': {1: -4.29365862e-02, 6: -3.34329586e+01, 7: -4.69301173e+01, 8: -6.29634763e+01},
117
131
  'AIQM1@DFT': {1: -4.27888067e-02, 6: -3.34869833e+01, 7: -4.69896148e+01, 8: -6.30294433e+01}}
118
132
  atomic_energy_shifts['AIQM1@DFT*'] = atomic_energy_shifts['AIQM1@DFT']
@@ -121,30 +135,35 @@ class atomic_energy_shift():
121
135
  self.method = method
122
136
 
123
137
  def predict(self, molecular_database=None, molecule=None,
124
- calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False):
125
- if molecular_database != None:
126
- molDB = molecular_database
127
- elif molecule != None:
128
- molDB = data.molecular_database()
129
- molDB.molecules.append(molecule)
130
- else:
131
- errmsg = 'Either molecule or molecular_database should be provided in input'
132
- raise ValueError(errmsg)
138
+ calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False, nstates=1, **kwargs):
139
+ molDB = super().predict(molecular_database=molecular_database, molecule=molecule)
140
+ calculate_energy_gradients = bool(np.array(calculate_energy_gradients).any())
141
+ calculate_hessian = bool(np.array(calculate_hessian).any())
133
142
 
134
143
  for mol in molDB.molecules:
135
- if calculate_energy:
136
- sae = 0.0
137
- for atom in mol.atoms:
138
- sae += self.atomic_energy_shifts[self.method][atom.atomic_number]
139
- mol.energy = sae
140
- if calculate_energy_gradients:
141
- for atom in mol.atoms:
142
- atom.energy_gradients = np.zeros(3)
143
- if calculate_hessian:
144
- ndim = len(mol.atoms) * 3
145
- mol.hessian = np.zeros(ndim*ndim).reshape(ndim,ndim)
144
+ molecules = [mol]
146
145
 
147
- class ani_nns_in_aiqm1():
146
+ if nstates >1:
147
+ mol_copy = mol.copy()
148
+ mol_copy.electronic_states = []
149
+ for _ in range(nstates - len(mol.electronic_states)):
150
+ mol.electronic_states.append(mol_copy.copy())
151
+ molecules = mol.electronic_states
152
+
153
+ for mol in molecules:
154
+ if calculate_energy:
155
+ sae = 0.0
156
+ for atom in mol.atoms:
157
+ sae += self.atomic_energy_shifts[self.method][atom.atomic_number]
158
+ mol.energy = sae
159
+ if calculate_energy_gradients:
160
+ for atom in mol.atoms:
161
+ atom.energy_gradients = np.zeros(3)
162
+ if calculate_hessian:
163
+ ndim = len(mol.atoms) * 3
164
+ mol.hessian = np.zeros(ndim*ndim).reshape(ndim,ndim)
165
+
166
+ class ani_nns_in_aiqm1(models.torchani_model):
148
167
  species_order = [1, 6, 7, 8]
149
168
 
150
169
  def __init__(self, method='AIQM1', model_index = 0):
@@ -225,34 +244,39 @@ class ani_nns_in_aiqm1():
225
244
  self.nn = nn
226
245
 
227
246
  def predict(self, molecular_database=None, molecule=None,
228
- calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False):
229
- if molecular_database != None:
230
- molDB = molecular_database
231
- elif molecule != None:
232
- molDB = data.molecular_database()
233
- molDB.molecules.append(molecule)
234
- else:
235
- errmsg = 'Either molecule or molecular_database should be provided in input'
236
- raise ValueError(errmsg)
247
+ calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False, nstates=1, **kwargs):
248
+ molDB = super().predict(molecular_database=molecular_database, molecule=molecule)
237
249
 
250
+ calculate_energy_gradients = bool(np.array(calculate_energy_gradients).any())
251
+ calculate_hessian = bool(np.array(calculate_hessian).any())
238
252
  species_to_tensor = ChemicalSymbolsToInts(self.species_order)
239
253
 
240
254
  for mol in molDB.molecules:
241
- atomic_numbers = np.array([atom.atomic_number for atom in mol.atoms])
242
- xyz_coordinates = torch.tensor(np.array(mol.xyz_coordinates).astype('float')).to(self.device).requires_grad_(calculate_energy_gradients or calculate_hessian)
243
- xyz_coordinates = xyz_coordinates.unsqueeze(0)
244
- species = species_to_tensor(atomic_numbers).to(self.device).unsqueeze(0)
245
- ANI_NN_energy = self.model((species, xyz_coordinates)).energies
246
- if calculate_energy: mol.energy = float(ANI_NN_energy)
247
- if calculate_energy_gradients or calculate_hessian:
248
- ANI_NN_energy_gradients = torch.autograd.grad(ANI_NN_energy.sum(), xyz_coordinates, create_graph=True, retain_graph=True)[0]
249
- if calculate_energy_gradients:
250
- grads = ANI_NN_energy_gradients[0].detach().cpu().numpy()
251
- for iatom in range(len(mol.atoms)):
252
- mol.atoms[iatom].energy_gradients = grads[iatom]
253
- if calculate_hessian:
254
- ANI_NN_hessian = torchani.utils.hessian(xyz_coordinates, energies=ANI_NN_energy)
255
- mol.hessian = ANI_NN_hessian[0].detach().cpu().numpy()
255
+ molecules = [mol]
256
+
257
+ if nstates >1:
258
+ mol_copy = mol.copy()
259
+ mol_copy.electronic_states = []
260
+ for _ in range(nstates - len(mol.electronic_states)):
261
+ mol.electronic_states.append(mol_copy.copy())
262
+ molecules = mol.electronic_states
263
+
264
+ for mol in molecules:
265
+ atomic_numbers = np.array([atom.atomic_number for atom in mol.atoms])
266
+ xyz_coordinates = torch.tensor(np.array(mol.xyz_coordinates).astype('float')).to(self.device).requires_grad_(calculate_energy_gradients or calculate_hessian)
267
+ xyz_coordinates = xyz_coordinates.unsqueeze(0)
268
+ species = species_to_tensor(atomic_numbers).to(self.device).unsqueeze(0)
269
+ ANI_NN_energy = self.model((species, xyz_coordinates)).energies
270
+ if calculate_energy: mol.energy = float(ANI_NN_energy)
271
+ if calculate_energy_gradients or calculate_hessian:
272
+ ANI_NN_energy_gradients = torch.autograd.grad(ANI_NN_energy.sum(), xyz_coordinates, create_graph=True, retain_graph=True)[0]
273
+ if calculate_energy_gradients:
274
+ grads = ANI_NN_energy_gradients[0].detach().cpu().numpy()
275
+ for iatom in range(len(mol.atoms)):
276
+ mol.atoms[iatom].energy_gradients = grads[iatom]
277
+ if calculate_hessian:
278
+ ANI_NN_hessian = torchani.utils.hessian(xyz_coordinates, energies=ANI_NN_energy)
279
+ mol.hessian = ANI_NN_hessian[0].detach().cpu().numpy()
256
280
 
257
281
  if __name__ == '__main__':
258
282
  pass
@@ -202,53 +202,53 @@ class ArgsBase():
202
202
  @staticmethod
203
203
  def _args_extractor(string: str) -> List[str]:
204
204
  pair_dict = {'(': ')', '[': ']', '{': '}', '<': '>', "'": "'", '"': '"'}
205
- pair_level = 0
206
205
  pair_right: List[str] = []
207
206
  tmp = ''
208
- prev = ''
207
+ comment = False
209
208
  out_string_list: List[str] = []
210
209
  for chr in string:
211
210
  pair_right_last = pair_right[-1] if pair_right else ''
211
+ if chr == '#':
212
+ comment = True
213
+ if chr == '\n':
214
+ comment = False
215
+ if comment:
216
+ continue
212
217
  if chr in pair_dict.keys() and chr != pair_right_last:
213
- pair_level += 1
214
218
  pair_right.append(pair_dict[chr])
215
219
  elif chr == pair_right_last:
216
- pair_level -= 1
217
220
  pair_right.pop()
218
- elif chr == ' ' and pair_level == 0 and prev.strip(): # end
219
- out_string_list.append(tmp)
220
- tmp = ''
221
- prev = chr
222
- continue
223
- if '"' in pair_right or "'" in pair_right:
221
+ if pair_right:
224
222
  tmp += chr
223
+ elif chr in [' ', '\n'] and tmp: # end
224
+ out_string_list.append(tmp.strip())
225
+ tmp = ''
225
226
  else:
226
227
  tmp += chr.strip()
227
- prev = chr
228
- if pair_level:
228
+ if pair_right:
229
229
  stopper.stopMLatom(f'pair character unmatched args: "{tmp}"')
230
230
  else:
231
231
  if tmp: out_string_list.append(tmp)
232
+
232
233
  return out_string_list
233
234
 
234
235
  def parse_input_file(self, file: str):
235
- try:
236
- with open(file) as f:
237
- content = f.read().splitlines()
238
- except:
239
- self._raise_error(f'can not open file {file}! exit!'); exit()
236
+ with open(file) as f:
237
+ content = self._args_extractor(f.read())
240
238
  self.parse_input_content(content)
241
239
 
242
240
  def parse_input_content(self, content: Union[List[str], str]):
243
- help = False
244
241
  if type(content) is str:
245
- content = content.splitlines()
246
- for c in self._clean_input_content(content):
242
+ content = [content]
243
+ _content = []
244
+ for c in content:
245
+ _content.extend(self._args_extractor(c) if '\n' not in c else [c])
246
+ for c in _content:
247
247
  splitted = c.split('=')
248
248
  if len(splitted) == 1:
249
249
  key = splitted[0]
250
250
  if key.lower() in ['help', '-help', '-h', '--help']:
251
- help = True
251
+ self._print_doc()
252
252
  elif key.lower() in self.ignore_list:
253
253
  pass
254
254
  else:
@@ -265,8 +265,6 @@ class ArgsBase():
265
265
  self.data[key] = value
266
266
  else:
267
267
  self._raise_error(f'error happends at your input file, error content:\n {c}')
268
- if help:
269
- self._print_doc()
270
268
 
271
269
  @classmethod
272
270
  def _multi_level_dict(cls, key: str, value: Any) -> Tuple[str, Union[AttributeDict, Dict[str, Union[str, Dict[str, Any]]]]]:
@@ -283,19 +281,7 @@ class ArgsBase():
283
281
  try: Doc.printDoc(self.args_dict)
284
282
  except: self._warning_print('Doc not imported')
285
283
  stopper.stopMLatom('')
286
-
287
- @classmethod
288
- def _clean_input_content(cls, content: List[str]) -> List[str]:
289
- to_return: List[str] = []
290
- for c in content:
291
- usable = c.split('#')[0].strip()
292
- while usable.find(' =') != -1:
293
- usable = usable.replace(' =', '=')
294
- while usable.find('= ') != -1:
295
- usable = usable.replace('= ', '=')
296
- to_return.extend(cls._args_extractor(usable))
297
- return to_return
298
-
284
+
299
285
  @property
300
286
  def args_dict(self) -> Dict[str, Any]:
301
287
  return AttributeDict.normal_dict(self.data)
@@ -616,6 +602,14 @@ class mlatom_args(ArgsBase):
616
602
  'DOF':-6,
617
603
  'linear':0,
618
604
  })
605
+ # geomopt output
606
+ self.add_default_dict_args(
607
+ [
608
+ 'printall', # print out all information in geometry optimization
609
+ 'printmin', # print out minimal infomation in geometry optimization
610
+ 'dumpopttrajs' # whether to dump optimization trajectory
611
+ ], ''
612
+ )
619
613
 
620
614
  self.defualt_args2pass = self.args_string_list(['', None])
621
615
 
@@ -628,23 +622,35 @@ class mlatom_args(ArgsBase):
628
622
  if len(argsraw) == 0:
629
623
  Doc.printDoc({})
630
624
  stopper.stopMLatom('At least one option should be provided')
631
- elif len(argsraw) == 1:
632
- if os.path.exists(argsraw[0]):
633
- # self.parse_input_file(argsraw[0])
634
- self.argsraw = []
635
- with open(argsraw[0]) as f:
636
- content = f.read().splitlines()
637
- for c in self._clean_input_content(content):
638
- self.argsraw += [c]
639
- self.parse_input_content(self.argsraw)
640
- else:
641
- self.parse_input_content(argsraw[0])
642
- elif len(argsraw) >= 2:
625
+ elif len(argsraw) == 1 and os.path.exists(argsraw[0]):
626
+ self.parse_input_file(argsraw[0])
627
+ else:
643
628
  self.parse_input_content(argsraw)
644
629
 
645
630
  self._post_operations()
631
+
632
+ def _post_operations(self):
633
+ if not self.MLprog:
634
+ if self.MLmodelType :
635
+ try: self.MLprog = default_MLprog[self.MLmodelType.lower()]
636
+ except: stopper.stopMLatom('Unkown MLmodelType')
637
+ else:
638
+ self.MLprog = 'MLatomF'
646
639
  self._checkArgs()
647
640
  self._check_hyperopt()
641
+ self._multi_lines_to_file()
642
+
643
+ def _multi_lines_to_file(self):
644
+ import hashlib
645
+ for arg in self.args2pass:
646
+ if '\n' in arg:
647
+ key, value = arg.split('=')
648
+ tmpfile = f"{key}_{hashlib.md5(value.encode('utf-8')).hexdigest()[:6]}"
649
+ if 'xyz' in key.lower():
650
+ tmpfile += '.xyz'
651
+ with open(tmpfile, 'w') as f:
652
+ f.write(value.strip("'").strip('"').strip() + '\n')
653
+ self.parse_input_content([f'{key}={tmpfile}'])
648
654
 
649
655
  def _check_hyperopt(self):
650
656
  self.hyperparameter_optimization = {
@@ -660,14 +666,6 @@ class mlatom_args(ArgsBase):
660
666
  self._hyperopt_str_dict[key.split('.')[-1]] = value
661
667
  if self._hyperopt_str_dict:
662
668
  self.hyperparameter_optimization['optimization_algorithm'] = self.hyperopt.algorithm
663
-
664
- def _post_operations(self):
665
- if not self.MLprog:
666
- if self.MLmodelType :
667
- try: self.MLprog = default_MLprog[self.MLmodelType.lower()]
668
- except: stopper.stopMLatom('Unkown MLmodelType')
669
- else:
670
- self.MLprog = 'MLatomF'
671
669
 
672
670
  def _checkArgs(self):
673
671
  if not self._task:
@@ -2,7 +2,7 @@ import numpy as np
2
2
 
3
3
  def smi2xyz(smi_strings):
4
4
  from openbabel import pybel as pb
5
- if type(smi_strings) == str:
5
+ if isinstance(smi_strings, str):
6
6
  smi_strings = smi_strings.strip().split('\n')
7
7
  xyz_strings = []
8
8
  for smi_string in smi_strings:
@@ -13,7 +13,7 @@ def smi2xyz(smi_strings):
13
13
 
14
14
  def xyz2smi(xyz_strings):
15
15
  from openbabel import pybel as pb
16
- if type(xyz_strings) == str:
16
+ if isinstance(xyz_strings, str):
17
17
  xyz_strings = split_xyz_string(xyz_strings)
18
18
  smi_strings = []
19
19
  for string in xyz_strings: