atomict 1.2.23__py3-none-any.whl → 1.2.25__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.
- atomict/__version__.py +1 -1
- atomict/cli/commands/convert.py +100 -0
- atomict/cli/commands/traj.py +2 -6
- atomict/cli/commands/workspace.py +117 -0
- atomict/cli/main.py +8 -126
- atomict/io/cif.py +4 -10
- atomict/io/fhiaims.py +2 -8
- atomict/io/formats/atraj.py +5 -13
- atomict/io/formats/tess.py +195 -157
- atomict/io/formats/traj.py +3 -9
- atomict/io/trajectory.py +19 -1
- atomict/simulation/utils.py +7 -8
- atomict/utils/fhiaims/geometry.py +3 -10
- {atomict-1.2.23.dist-info → atomict-1.2.25.dist-info}/METADATA +9 -24
- {atomict-1.2.23.dist-info → atomict-1.2.25.dist-info}/RECORD +19 -25
- atomict/cli/commands/adsorbate.py +0 -183
- atomict/cli/commands/catalysis.py +0 -171
- atomict/cli/commands/simulation/__init__.py +0 -20
- atomict/cli/commands/simulation/catalysis.py +0 -223
- atomict/cli/commands/simulation/vibes.py +0 -161
- atomict/cli/commands/simulation.py +0 -176
- atomict/cli/ext/custom_classes.py +0 -46
- atomict/simulation/catalysis.py +0 -20
- {atomict-1.2.23.dist-info → atomict-1.2.25.dist-info}/WHEEL +0 -0
- {atomict-1.2.23.dist-info → atomict-1.2.25.dist-info}/entry_points.txt +0 -0
- {atomict-1.2.23.dist-info → atomict-1.2.25.dist-info}/licenses/LICENSE +0 -0
- {atomict-1.2.23.dist-info → atomict-1.2.25.dist-info}/top_level.txt +0 -0
atomict/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.25"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import logging
|
|
3
|
+
import click
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
from ase.io import read, write
|
|
6
|
+
from ase.io.formats import UnknownFileTypeError
|
|
7
|
+
from atomict.io.formats.atraj import read_atraj, write_atraj
|
|
8
|
+
from atomict.io.formats.tess import read_tess, write_tess
|
|
9
|
+
|
|
10
|
+
console = Console()
|
|
11
|
+
|
|
12
|
+
@click.command()
|
|
13
|
+
@click.argument("input_file", required=True)
|
|
14
|
+
@click.argument("output_file", required=True)
|
|
15
|
+
def convert(input_file: str, output_file: str):
|
|
16
|
+
"""Convert atomic structure files between supported formats (e.g. .xyz, .cif, .traj)."""
|
|
17
|
+
RW_FORMATS = [
|
|
18
|
+
'abinit-in', 'aims', 'bundletrajectory', 'castep-cell', 'castep-geom',
|
|
19
|
+
'castep-md', 'cfg', 'cif', 'crystal', 'cube', 'db', 'dftb', 'dlp4',
|
|
20
|
+
'dmol-arc', 'dmol-car', 'dmol-incoor', 'eon', 'espresso-in', 'extxyz',
|
|
21
|
+
'gaussian-in', 'gen', 'gpumd', 'gromacs', 'gromos', 'json', 'jsv',
|
|
22
|
+
'lammps-data', 'magres', 'mustem', 'mysql', 'netcdftrajectory', 'nwchem-in',
|
|
23
|
+
'onetep-in', 'postgresql', 'prismatic', 'proteindatabank', 'res',
|
|
24
|
+
'rmc6f', 'struct', 'sys', 'traj', 'turbomole', 'v-sim', 'vasp',
|
|
25
|
+
'vasp-xdatcar', 'xsd', 'xsf', 'xtd', 'xyz'
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
input_ext = os.path.splitext(input_file)[1].lower()[1:]
|
|
30
|
+
output_ext = os.path.splitext(output_file)[1].lower()[1:]
|
|
31
|
+
|
|
32
|
+
if not os.path.exists(input_file):
|
|
33
|
+
console.print(f"[red]Error: Input file '{input_file}' not found.[/red]")
|
|
34
|
+
return
|
|
35
|
+
|
|
36
|
+
traj_msgpack_formats = ["atraj", "tess"]
|
|
37
|
+
|
|
38
|
+
def _is_supported(ext: str) -> bool:
|
|
39
|
+
return (
|
|
40
|
+
ext in RW_FORMATS
|
|
41
|
+
or ext in traj_msgpack_formats
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def _print_supported_error(ext: str, action: str) -> None:
|
|
45
|
+
console.print(f"[red]Error: Format '{ext}' is not supported for {action}.[/red]")
|
|
46
|
+
console.print("[yellow]Supported read/write formats include:[/yellow]")
|
|
47
|
+
for i in range(0, len(RW_FORMATS), 5):
|
|
48
|
+
console.print("[yellow] " + ", ".join(RW_FORMATS[i:i+5]) + "[/yellow]")
|
|
49
|
+
console.print("[yellow]Special formats: atm (msgpack), atraj (msgpack trajectory), tess (msgpack trajectory)[/yellow]")
|
|
50
|
+
|
|
51
|
+
if not _is_supported(input_ext):
|
|
52
|
+
_print_supported_error(input_ext, "reading")
|
|
53
|
+
return
|
|
54
|
+
|
|
55
|
+
if not _is_supported(output_ext):
|
|
56
|
+
_print_supported_error(output_ext, "writing")
|
|
57
|
+
return
|
|
58
|
+
|
|
59
|
+
try:
|
|
60
|
+
if input_ext == "atraj":
|
|
61
|
+
atoms, _ = read_atraj(input_file)
|
|
62
|
+
elif input_ext == "tess":
|
|
63
|
+
atoms, _ = read_tess(input_file)
|
|
64
|
+
else:
|
|
65
|
+
atoms = read(input_file, index=":")
|
|
66
|
+
except UnknownFileTypeError:
|
|
67
|
+
console.print(f"[red]Error: Unknown file type for input file '{input_file}'[/red]")
|
|
68
|
+
console.print(f"[yellow]The file extension '{input_ext}' is not recognized.[/yellow]")
|
|
69
|
+
console.print("[yellow]Make sure the file has the correct extension for its format.[/yellow]")
|
|
70
|
+
return
|
|
71
|
+
except Exception as e:
|
|
72
|
+
console.print(f"[red]Error reading input file '{input_file}': {str(e)}.[/red]")
|
|
73
|
+
console.print(f"[yellow]Make sure '{input_ext}' is a valid format and the file is not corrupted.[/yellow]")
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
if output_ext == "atraj":
|
|
78
|
+
write_atraj(atoms, output_file)
|
|
79
|
+
elif output_ext == "tess":
|
|
80
|
+
write_tess(atoms, output_file)
|
|
81
|
+
else:
|
|
82
|
+
write(output_file, atoms)
|
|
83
|
+
|
|
84
|
+
console.print(f"[green]Successfully converted {input_file} to {output_file}[/green]")
|
|
85
|
+
|
|
86
|
+
except UnknownFileTypeError:
|
|
87
|
+
console.print(f"[red]Error: Unknown file type for output file '{output_file}'[/red]")
|
|
88
|
+
console.print(f"[yellow]The file extension '{output_ext}' is not recognized.[/yellow]")
|
|
89
|
+
console.print("[yellow]Make sure the file has the correct extension for its format.[/yellow]")
|
|
90
|
+
return
|
|
91
|
+
except Exception as e:
|
|
92
|
+
console.print(f"[red]Error writing output file '{output_file}': {str(e)}[/red]")
|
|
93
|
+
console.print(f"[yellow]Make sure '{output_ext}' is a valid format and you have write permissions.[/yellow]")
|
|
94
|
+
return
|
|
95
|
+
|
|
96
|
+
except Exception as e:
|
|
97
|
+
logging.debug(f"Conversion failed with error: {str(e)}", exc_info=True)
|
|
98
|
+
console.print(f"[red]Error during conversion: {str(e)}[/red]")
|
|
99
|
+
console.print("[yellow]Try running with --verbose for more detailed error information.[/yellow]")
|
|
100
|
+
|
atomict/cli/commands/traj.py
CHANGED
|
@@ -16,12 +16,8 @@ def subsample(file_path, step):
|
|
|
16
16
|
|
|
17
17
|
The output will be saved as {original_filename}_subsampled_{step}.traj
|
|
18
18
|
"""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
from ase.io.trajectory import TrajectoryWriter
|
|
22
|
-
except ImportError:
|
|
23
|
-
click.echo("Error: ASE modules not found. Please install with 'pip install atomict[utils]'")
|
|
24
|
-
raise
|
|
19
|
+
from ase.io import read, write
|
|
20
|
+
from ase.io.trajectory import TrajectoryWriter
|
|
25
21
|
|
|
26
22
|
if step <= 0:
|
|
27
23
|
click.echo("Error: Step must be a positive integer")
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# cli/commands/workspace.py
|
|
2
|
+
import base64
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
import click
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TaskProgressColumn
|
|
10
|
+
|
|
11
|
+
from atomict.cli.commands.common import create_table
|
|
12
|
+
from atomict.cli.commands.helpers import format_datetime
|
|
13
|
+
from atomict.cli.core.client import get_client
|
|
14
|
+
|
|
15
|
+
console = Console()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@click.group(name="workspace")
|
|
19
|
+
def workspace_group():
|
|
20
|
+
"""Manage workspace simulations and files"""
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@workspace_group.command()
|
|
25
|
+
@click.argument('uuid', type=str)
|
|
26
|
+
@click.argument('path', type=str, default=".", required=False)
|
|
27
|
+
def cp(uuid: str, path: str = "."):
|
|
28
|
+
"""Download simulation files by UUID to a directory
|
|
29
|
+
|
|
30
|
+
Example:
|
|
31
|
+
tess workspace cp 8f328887-62ae-4ace-b37b-2c31640baa47 .
|
|
32
|
+
"""
|
|
33
|
+
client = get_client()
|
|
34
|
+
|
|
35
|
+
# Fetch simulation metadata
|
|
36
|
+
try:
|
|
37
|
+
result = client.get(f"/simulation/lookup/{uuid}/")
|
|
38
|
+
except Exception as e:
|
|
39
|
+
console.print(f"[red]Error fetching simulation: {e}[/red]")
|
|
40
|
+
return
|
|
41
|
+
|
|
42
|
+
sim_type = result.get("type", "Unknown")
|
|
43
|
+
simulation = result.get("simulation", {})
|
|
44
|
+
files = result.get("files", [])
|
|
45
|
+
|
|
46
|
+
# Display simulation info
|
|
47
|
+
console.print(f"\n[bold cyan]Simulation Type:[/bold cyan] {sim_type}")
|
|
48
|
+
console.print(f"[bold cyan]ID:[/bold cyan] {simulation.get('id', 'N/A')}")
|
|
49
|
+
console.print(f"[bold cyan]Name:[/bold cyan] {simulation.get('name') or '(unnamed)'}")
|
|
50
|
+
|
|
51
|
+
if not files:
|
|
52
|
+
console.print("\n[yellow]No files found for this simulation[/yellow]")
|
|
53
|
+
return
|
|
54
|
+
|
|
55
|
+
# Create output directory
|
|
56
|
+
output_path = Path(path)
|
|
57
|
+
output_path.mkdir(parents=True, exist_ok=True)
|
|
58
|
+
|
|
59
|
+
console.print(f"\n[bold green]Downloading {len(files)} file(s) to: {output_path.absolute()}[/bold green]\n")
|
|
60
|
+
|
|
61
|
+
# Download files with progress bar
|
|
62
|
+
with Progress(
|
|
63
|
+
SpinnerColumn(),
|
|
64
|
+
TextColumn("[progress.description]{task.description}"),
|
|
65
|
+
BarColumn(),
|
|
66
|
+
TaskProgressColumn(),
|
|
67
|
+
console=console
|
|
68
|
+
) as progress:
|
|
69
|
+
|
|
70
|
+
download_task = progress.add_task("[cyan]Downloading files...", total=len(files))
|
|
71
|
+
download_ct = 0
|
|
72
|
+
for file_info in files:
|
|
73
|
+
# Extract user_upload info (handle nested structure)
|
|
74
|
+
user_upload = file_info.get('user_upload', {})
|
|
75
|
+
if isinstance(user_upload, dict):
|
|
76
|
+
file_id = user_upload.get('id')
|
|
77
|
+
filename = user_upload.get('orig_name', f"file-{file_id}")
|
|
78
|
+
else:
|
|
79
|
+
# If user_upload is an ID string
|
|
80
|
+
file_id = user_upload
|
|
81
|
+
filename = f"file-{file_id}"
|
|
82
|
+
|
|
83
|
+
if not file_id:
|
|
84
|
+
console.print(f"[yellow]Skipping file with no ID[/yellow]")
|
|
85
|
+
progress.advance(download_task)
|
|
86
|
+
continue
|
|
87
|
+
|
|
88
|
+
progress.update(download_task, description=f"[cyan]Downloading: {filename}")
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
# Fetch file with content
|
|
92
|
+
file_data = client.get(
|
|
93
|
+
f"/api/user-upload/{file_id}/",
|
|
94
|
+
params={"include_content": "true"}
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
file_content_b64 = file_data.get("file_content_base64")
|
|
98
|
+
if not file_content_b64:
|
|
99
|
+
console.print(f"[red]✗ No content received for: {filename}[/red]")
|
|
100
|
+
progress.advance(download_task)
|
|
101
|
+
continue
|
|
102
|
+
|
|
103
|
+
# Decode and save file
|
|
104
|
+
file_path = output_path / filename
|
|
105
|
+
with open(file_path, "wb") as f:
|
|
106
|
+
f.write(base64.b64decode(file_content_b64))
|
|
107
|
+
|
|
108
|
+
progress.advance(download_task)
|
|
109
|
+
|
|
110
|
+
except Exception as e:
|
|
111
|
+
console.print(f"[red]✗ Error downloading {filename}: {e}[/red]")
|
|
112
|
+
progress.advance(download_task)
|
|
113
|
+
|
|
114
|
+
download_ct += 1
|
|
115
|
+
|
|
116
|
+
console.print(f"\n[bold {'green' if download_ct else 'red'}]Downloaded {download_ct} file(s)[/bold {'green' if download_ct else 'red'}]")
|
|
117
|
+
|
atomict/cli/main.py
CHANGED
|
@@ -7,15 +7,10 @@ import click
|
|
|
7
7
|
from rich.console import Console
|
|
8
8
|
|
|
9
9
|
from atomict.__version__ import __version__
|
|
10
|
-
from atomict.cli.commands import login, token, user
|
|
11
|
-
from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
from .commands import adsorbate, catalysis, k8s, project, task, traj, upload
|
|
15
|
-
from .commands.exploration import soec, sqs
|
|
16
|
-
from .commands.simulation import fhiaims, kpoint, vibes
|
|
17
|
-
except ImportError:
|
|
18
|
-
sys.exit(1)
|
|
10
|
+
from atomict.cli.commands import login, token, user, workspace
|
|
11
|
+
from .commands import k8s, project, task, traj, upload, convert
|
|
12
|
+
from .commands.exploration import soec, sqs
|
|
13
|
+
from .commands.simulation import fhiaims, kpoint
|
|
19
14
|
|
|
20
15
|
|
|
21
16
|
console = Console()
|
|
@@ -41,7 +36,7 @@ def setup_logging(verbose: bool):
|
|
|
41
36
|
)
|
|
42
37
|
|
|
43
38
|
|
|
44
|
-
@click.group(
|
|
39
|
+
@click.group(invoke_without_command=True)
|
|
45
40
|
@click.option(
|
|
46
41
|
"-v", "--verbose", is_flag=True, default=False, help="Enable verbose output"
|
|
47
42
|
)
|
|
@@ -49,124 +44,12 @@ def setup_logging(verbose: bool):
|
|
|
49
44
|
@click.pass_context
|
|
50
45
|
def cli(ctx, verbose: bool):
|
|
51
46
|
"""Atomic Tessellator CLI - Manage simulations and computational resources
|
|
52
|
-
|
|
53
|
-
Default behavior: when called with two file arguments, converts between file formats.
|
|
54
47
|
"""
|
|
55
48
|
setup_logging(verbose)
|
|
56
|
-
|
|
57
|
-
if ctx.invoked_subcommand is None and len(sys.argv) <= 1:
|
|
49
|
+
if ctx.invoked_subcommand is None:
|
|
58
50
|
click.echo(ctx.get_help())
|
|
59
51
|
|
|
60
52
|
|
|
61
|
-
@cli.command(default_command=True)
|
|
62
|
-
@click.argument("input_file", required=True)
|
|
63
|
-
@click.argument("output_file", required=True)
|
|
64
|
-
def convert(input_file, output_file):
|
|
65
|
-
"""Convert between atomic structure file formats using ASE
|
|
66
|
-
|
|
67
|
-
Supports all formats that ASE can read/write, with special handling for .atm and .atraj files.
|
|
68
|
-
Usage examples:
|
|
69
|
-
tess input.cif output.xyz
|
|
70
|
-
tess input.xyz output.atm
|
|
71
|
-
tess input.traj output.atraj
|
|
72
|
-
|
|
73
|
-
"""
|
|
74
|
-
try:
|
|
75
|
-
import os.path
|
|
76
|
-
from ase.io import read, write
|
|
77
|
-
from ase.io.formats import UnknownFileTypeError
|
|
78
|
-
from atomict.io.formats.atraj import read_atraj, write_atraj
|
|
79
|
-
from atomict.io.formats.tess import read_tess, write_tess
|
|
80
|
-
except ImportError:
|
|
81
|
-
console.print("[red]Error: ASE (Atomic Simulation Environment) is required for file conversion.[/red]")
|
|
82
|
-
console.print("[yellow]Install it with: pip install ase[/yellow]")
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
RW_FORMATS = [
|
|
86
|
-
'abinit-in', 'aims', 'bundletrajectory', 'castep-cell', 'castep-geom',
|
|
87
|
-
'castep-md', 'cfg', 'cif', 'crystal', 'cube', 'db', 'dftb', 'dlp4',
|
|
88
|
-
'dmol-arc', 'dmol-car', 'dmol-incoor', 'eon', 'espresso-in', 'extxyz',
|
|
89
|
-
'gaussian-in', 'gen', 'gpumd', 'gromacs', 'gromos', 'json', 'jsv',
|
|
90
|
-
'lammps-data', 'magres', 'mustem', 'mysql', 'netcdftrajectory', 'nwchem-in',
|
|
91
|
-
'onetep-in', 'postgresql', 'prismatic', 'proteindatabank', 'res',
|
|
92
|
-
'rmc6f', 'struct', 'sys', 'traj', 'turbomole', 'v-sim', 'vasp',
|
|
93
|
-
'vasp-xdatcar', 'xsd', 'xsf', 'xtd', 'xyz'
|
|
94
|
-
]
|
|
95
|
-
|
|
96
|
-
try:
|
|
97
|
-
input_ext = os.path.splitext(input_file)[1].lower()[1:]
|
|
98
|
-
output_ext = os.path.splitext(output_file)[1].lower()[1:]
|
|
99
|
-
|
|
100
|
-
if not os.path.exists(input_file):
|
|
101
|
-
console.print(f"[red]Error: Input file '{input_file}' not found.[/red]")
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
traj_msgpack_formats = ["atraj", "tess"]
|
|
105
|
-
|
|
106
|
-
def _is_supported(ext: str) -> bool:
|
|
107
|
-
return (
|
|
108
|
-
ext in RW_FORMATS
|
|
109
|
-
or ext in traj_msgpack_formats
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
def _print_supported_error(ext: str, action: str) -> None:
|
|
113
|
-
console.print(f"[red]Error: Format '{ext}' is not supported for {action}.[/red]")
|
|
114
|
-
console.print("[yellow]Supported read/write formats include:[/yellow]")
|
|
115
|
-
for i in range(0, len(RW_FORMATS), 5):
|
|
116
|
-
console.print("[yellow] " + ", ".join(RW_FORMATS[i:i+5]) + "[/yellow]")
|
|
117
|
-
console.print("[yellow]Special formats: atm (msgpack), atraj (msgpack trajectory), tess (msgpack trajectory)[/yellow]")
|
|
118
|
-
|
|
119
|
-
if not _is_supported(input_ext):
|
|
120
|
-
_print_supported_error(input_ext, "reading")
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
if not _is_supported(output_ext):
|
|
124
|
-
_print_supported_error(output_ext, "writing")
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
try:
|
|
128
|
-
if input_ext == "atraj":
|
|
129
|
-
atoms, _ = read_atraj(input_file)
|
|
130
|
-
elif input_ext == "tess":
|
|
131
|
-
atoms, _ = read_tess(input_file)
|
|
132
|
-
else:
|
|
133
|
-
atoms = read(input_file, index=":")
|
|
134
|
-
except UnknownFileTypeError:
|
|
135
|
-
console.print(f"[red]Error: Unknown file type for input file '{input_file}'[/red]")
|
|
136
|
-
console.print(f"[yellow]The file extension '{input_ext}' is not recognized.[/yellow]")
|
|
137
|
-
console.print("[yellow]Make sure the file has the correct extension for its format.[/yellow]")
|
|
138
|
-
return
|
|
139
|
-
except Exception as e:
|
|
140
|
-
console.print(f"[red]Error reading input file '{input_file}': {str(e)}.[/red]")
|
|
141
|
-
console.print(f"[yellow]Make sure '{input_ext}' is a valid format and the file is not corrupted.[/yellow]")
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
try:
|
|
145
|
-
if output_ext == "atraj":
|
|
146
|
-
write_atraj(atoms, output_file)
|
|
147
|
-
elif output_ext == "tess":
|
|
148
|
-
write_tess(atoms, output_file)
|
|
149
|
-
else:
|
|
150
|
-
write(output_file, atoms)
|
|
151
|
-
|
|
152
|
-
console.print(f"[green]Successfully converted {input_file} to {output_file}[/green]")
|
|
153
|
-
|
|
154
|
-
except UnknownFileTypeError:
|
|
155
|
-
console.print(f"[red]Error: Unknown file type for output file '{output_file}'[/red]")
|
|
156
|
-
console.print(f"[yellow]The file extension '{output_ext}' is not recognized.[/yellow]")
|
|
157
|
-
console.print("[yellow]Make sure the file has the correct extension for its format.[/yellow]")
|
|
158
|
-
return
|
|
159
|
-
except Exception as e:
|
|
160
|
-
console.print(f"[red]Error writing output file '{output_file}': {str(e)}[/red]")
|
|
161
|
-
console.print(f"[yellow]Make sure '{output_ext}' is a valid format and you have write permissions.[/yellow]")
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
except Exception as e:
|
|
165
|
-
logging.debug(f"Conversion failed with error: {str(e)}", exc_info=True)
|
|
166
|
-
console.print(f"[red]Error during conversion: {str(e)}[/red]")
|
|
167
|
-
console.print("[yellow]Try running with --verbose for more detailed error information.[/yellow]")
|
|
168
|
-
|
|
169
|
-
|
|
170
53
|
@cli.command(hidden=True)
|
|
171
54
|
@click.argument("shell", type=click.Choice(["bash", "zsh", "fish"]), required=False)
|
|
172
55
|
def completion(shell):
|
|
@@ -207,21 +90,20 @@ end
|
|
|
207
90
|
|
|
208
91
|
|
|
209
92
|
cli.add_command(completion)
|
|
93
|
+
cli.add_command(convert.convert)
|
|
210
94
|
cli.add_command(task.task_group)
|
|
211
95
|
cli.add_command(upload.upload_group)
|
|
212
96
|
cli.add_command(project.project_group)
|
|
213
97
|
cli.add_command(k8s.k8s_group)
|
|
214
|
-
cli.add_command(adsorbate.adsorbate_group)
|
|
215
98
|
cli.add_command(fhiaims.fhiaims_group)
|
|
216
99
|
cli.add_command(kpoint.kpoint_group)
|
|
217
|
-
cli.add_command(catalysis.catalysis_group)
|
|
218
100
|
cli.add_command(sqs.sqs_group)
|
|
219
101
|
cli.add_command(soec.soecexploration_group)
|
|
220
102
|
cli.add_command(traj.traj)
|
|
221
103
|
cli.add_command(user.user_group)
|
|
104
|
+
cli.add_command(workspace.workspace_group)
|
|
222
105
|
cli.add_command(login._login)
|
|
223
106
|
cli.add_command(token._token)
|
|
224
|
-
cli.add_command(vibes.vibes_group)
|
|
225
107
|
|
|
226
108
|
|
|
227
109
|
def main():
|
atomict/io/cif.py
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
from pymatgen.core import Structure
|
|
7
|
-
except ImportError:
|
|
8
|
-
raise ImportError(
|
|
9
|
-
"The 'ase' package is required for FHI-aims operations. "
|
|
10
|
-
"To install the optional dependencies such as ase, spglib, pymatgen, use `pip install atomict[utils]`"
|
|
11
|
-
)
|
|
2
|
+
import ase.io
|
|
3
|
+
import spglib
|
|
4
|
+
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
|
|
5
|
+
from pymatgen.core import Structure
|
|
12
6
|
|
|
13
7
|
|
|
14
8
|
class CIFAnalyzer:
|
atomict/io/fhiaims.py
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from ase.utils import reader
|
|
4
|
-
except ImportError:
|
|
5
|
-
raise ImportError(
|
|
6
|
-
"The 'ase' package is required for FHI-aims operations. "
|
|
7
|
-
"To install the optional dependencies such as ase, spglib, pymatgen, use `pip install atomict[utils]`"
|
|
8
|
-
)
|
|
1
|
+
from ase.io.aims import check_convergence, get_aims_out_chunks, get_header_chunk
|
|
2
|
+
from ase.utils import reader
|
|
9
3
|
|
|
10
4
|
|
|
11
5
|
# We have to write our own function because he read_aims_output function inside ASE only supports
|
atomict/io/formats/atraj.py
CHANGED
|
@@ -9,13 +9,9 @@ def write_atraj(atoms: Union['ase.Atoms', List['ase.Atoms']], filename: str, met
|
|
|
9
9
|
"""Save atoms to a mpv1 file."""
|
|
10
10
|
|
|
11
11
|
from atomict.io.atoms import atoms_to_dict
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import msgpack_numpy as m
|
|
16
|
-
from ase import Atoms
|
|
17
|
-
except ImportError:
|
|
18
|
-
raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
|
|
12
|
+
import msgpack
|
|
13
|
+
import msgpack_numpy as m
|
|
14
|
+
from ase import Atoms
|
|
19
15
|
|
|
20
16
|
# Enable numpy array serialization
|
|
21
17
|
m.patch()
|
|
@@ -47,12 +43,8 @@ def read_atraj(filename: str) -> Union['ase.Atoms', List['ase.Atoms']]:
|
|
|
47
43
|
|
|
48
44
|
"""Load atoms from a mpv1 file."""
|
|
49
45
|
from atomict.io.atoms import dict_to_atoms
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import msgpack
|
|
53
|
-
import msgpack_numpy as m
|
|
54
|
-
except ImportError:
|
|
55
|
-
raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
|
|
46
|
+
import msgpack
|
|
47
|
+
import msgpack_numpy as m
|
|
56
48
|
|
|
57
49
|
# Enable numpy array deserialization
|
|
58
50
|
m.patch()
|