mdkits 0.1.21__py3-none-any.whl → 0.1.23__py3-none-any.whl
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.
Potentially problematic release.
This version of mdkits might be problematic. Click here for more details.
- mdkits/build_cli/build_solution.py +43 -5
- {mdkits-0.1.21.dist-info → mdkits-0.1.23.dist-info}/METADATA +1 -1
- {mdkits-0.1.21.dist-info → mdkits-0.1.23.dist-info}/RECORD +6 -6
- {mdkits-0.1.21.dist-info → mdkits-0.1.23.dist-info}/LICENSE +0 -0
- {mdkits-0.1.21.dist-info → mdkits-0.1.23.dist-info}/WHEEL +0 -0
- {mdkits-0.1.21.dist-info → mdkits-0.1.23.dist-info}/entry_points.txt +0 -0
|
@@ -2,23 +2,59 @@ import click, os
|
|
|
2
2
|
from mdkits.util import arg_type
|
|
3
3
|
from importlib import resources
|
|
4
4
|
from mdkits.cli import convert
|
|
5
|
-
import tempfile
|
|
5
|
+
import tempfile, platform, subprocess
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@click.command(name="solution")
|
|
9
9
|
@click.argument("filename", type=click.Path(exists=True), nargs=-1)
|
|
10
10
|
@click.option('--infile', is_flag=True, help="read input mode")
|
|
11
|
-
@click.option('--
|
|
11
|
+
@click.option('--install_julia', is_flag=True, help="install julia for system")
|
|
12
|
+
@click.option('--install_packmol', is_flag=True, help="init julia install packmol")
|
|
12
13
|
@click.option('--water_number', type=int, help="number of water molecules", default=0, show_default=True)
|
|
13
14
|
@click.option('-n', type=int, multiple=True, help="number of molecules")
|
|
14
15
|
@click.option('--tolerance', type=float, help="tolerance of solution", default=3.5, show_default=True)
|
|
15
16
|
@click.option('--cell', type=arg_type.Cell, help="set cell, a list of lattice: --cell x,y,z or x,y,z,a,b,c")
|
|
16
17
|
@click.option('--gap', type=float, help="gap between solution and cell", default=1, show_default=True)
|
|
17
|
-
def main(filename, infile,
|
|
18
|
+
def main(filename, infile, install_julia, install_packmol, water_number, n, tolerance, cell, gap):
|
|
18
19
|
"""
|
|
19
20
|
build solution model
|
|
20
21
|
"""
|
|
21
|
-
|
|
22
|
+
os_name = platform.system()
|
|
23
|
+
if install_julia:
|
|
24
|
+
if os_name in ("Darwin", "Linux", "FreeBSD"):
|
|
25
|
+
try:
|
|
26
|
+
subprocess.run(
|
|
27
|
+
["curl", "-fsSL", "https://install.julialang.org", "|", "sh"],
|
|
28
|
+
shell=True,
|
|
29
|
+
check=True,
|
|
30
|
+
)
|
|
31
|
+
print("Julia installed (macOS, Linux, FreeBSD).")
|
|
32
|
+
except subprocess.CalledProcessError as e:
|
|
33
|
+
print(f"Julia install failed: {e}")
|
|
34
|
+
elif os_name == "Windows":
|
|
35
|
+
try:
|
|
36
|
+
subprocess.run(
|
|
37
|
+
[
|
|
38
|
+
"winget",
|
|
39
|
+
"install",
|
|
40
|
+
"--name",
|
|
41
|
+
"Julia",
|
|
42
|
+
"--id",
|
|
43
|
+
"9NJNWW8PVKMN",
|
|
44
|
+
"-e",
|
|
45
|
+
"-s",
|
|
46
|
+
"msstore",
|
|
47
|
+
],
|
|
48
|
+
check=True,
|
|
49
|
+
)
|
|
50
|
+
print("Julia installed (Windows).")
|
|
51
|
+
except subprocess.CalledProcessError as e:
|
|
52
|
+
print(f"Julia install failed: {e}")
|
|
53
|
+
|
|
54
|
+
else:
|
|
55
|
+
print(f"unsupport os: {os_name}")
|
|
56
|
+
|
|
57
|
+
if install_packmol:
|
|
22
58
|
import julia
|
|
23
59
|
julia.install()
|
|
24
60
|
|
|
@@ -42,7 +78,9 @@ def main(filename, infile, install, water_number, n, tolerance, cell, gap):
|
|
|
42
78
|
if len(filename) == 0 and water_number == 0:
|
|
43
79
|
raise ValueError("at least one file should be provided, or water_number should be greater than 0")
|
|
44
80
|
|
|
45
|
-
|
|
81
|
+
if os_name in ("Darwin", "Linux"):
|
|
82
|
+
Pkg.activate("Packmol", shared=True)
|
|
83
|
+
|
|
46
84
|
while True:
|
|
47
85
|
try:
|
|
48
86
|
Main.using("Packmol")
|
|
@@ -4,7 +4,7 @@ mdkits/build_cli/adsorbate.py,sha256=Zp21i-miFv5zQlYjZnZuVpMxvNVT-6RtdlaoWDMwaOg
|
|
|
4
4
|
mdkits/build_cli/build_bulk.py,sha256=o3SFov5Ggk-qKcy6-NBoIYKvZV24OhcH3-du1d0U6H4,1593
|
|
5
5
|
mdkits/build_cli/build_cli.py,sha256=sqjnq5aHWLYLbNzN5SORkEYeYaewLagFuSvspJxyh7E,725
|
|
6
6
|
mdkits/build_cli/build_interface.py,sha256=3EDxUb-vGHFuat1Ex_wojVsN8PtzHiGrnDQIEa9WZ60,2448
|
|
7
|
-
mdkits/build_cli/build_solution.py,sha256=
|
|
7
|
+
mdkits/build_cli/build_solution.py,sha256=NYEkNCA-BOD7TGpe1jbVhYmgrRqEWoXvN3kbxG-XWmk,5440
|
|
8
8
|
mdkits/build_cli/build_surface.py,sha256=cBEQ-KR_6j-Mcsxrwvzyl6p1SiY_chIytrCu7MS3q08,2794
|
|
9
9
|
mdkits/build_cli/cut_surface.py,sha256=R0Snr-y23SYLfNhdBC5VgT4KFY1SOGn5hZlVvX5CUvw,2757
|
|
10
10
|
mdkits/build_cli/supercell.py,sha256=3iTTt3DHaERWDFonhBRS0oqWhjFh6pbS5SpIR-O1gYg,1034
|
|
@@ -36,8 +36,8 @@ mdkits/util/numpy_geo.py,sha256=1Op8THoQeyqybSZAi7hVxohYCr4SzY6ndZC8_gAGXDA,3619
|
|
|
36
36
|
mdkits/util/os_operation.py,sha256=ErN2ExjX9vZRfPe3ypsj4eyoQTEePqzlEX0Xm1N4lL4,980
|
|
37
37
|
mdkits/util/out_err.py,sha256=b4eFz9kqqNReK9UCHak9k5tBlEj9yHAIADDTRbaNaNk,693
|
|
38
38
|
mdkits/util/structure_parsing.py,sha256=mRPMJeih3O-ST7HeETDvBEkfV-1psT-XgxyYgDadV0U,4152
|
|
39
|
-
mdkits-0.1.
|
|
40
|
-
mdkits-0.1.
|
|
41
|
-
mdkits-0.1.
|
|
42
|
-
mdkits-0.1.
|
|
43
|
-
mdkits-0.1.
|
|
39
|
+
mdkits-0.1.23.dist-info/entry_points.txt,sha256=xoWWZ_yL87S501AzCO2ZjpnVuYkElC6z-8J3tmuIGXQ,44
|
|
40
|
+
mdkits-0.1.23.dist-info/LICENSE,sha256=VLaqyB0r_H7y3hUntfpPWcE3OATTedHWI983htLftcQ,1081
|
|
41
|
+
mdkits-0.1.23.dist-info/METADATA,sha256=DR2d7Cuj2JWHrzqJdhuWVdCjAvTt3aJfQW36gWky_4E,6907
|
|
42
|
+
mdkits-0.1.23.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
43
|
+
mdkits-0.1.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|