atomict 0.1.4__tar.gz → 1.2.4.1__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 (94) hide show
  1. {atomict-0.1.4 → atomict-1.2.4.1}/PKG-INFO +27 -18
  2. atomict-1.2.4.1/README.md +78 -0
  3. atomict-1.2.4.1/atomict/__version__.py +1 -0
  4. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/adsorbate.py +4 -4
  5. atomict-1.2.4.1/atomict/cli/commands/traj.py +57 -0
  6. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/upload.py +8 -3
  7. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/core/client.py +16 -0
  8. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/main.py +18 -6
  9. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/io/cif.py +24 -4
  10. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/io/fhiaims.py +8 -2
  11. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/io/json.py +8 -2
  12. atomict-1.2.4.1/atomict/simulation/defect.py +24 -0
  13. atomict-1.2.4.1/atomict/simulation/ea.py +117 -0
  14. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/fhi_aims.py +5 -2
  15. atomict-1.2.4.1/atomict/simulation/mattergen.py +20 -0
  16. atomict-1.2.4.1/atomict/simulation/md.py +32 -0
  17. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/mlrelax.py +22 -4
  18. atomict-1.2.4.1/atomict/simulation/sqs.py +38 -0
  19. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/utils.py +11 -4
  20. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/user/workspace.py +2 -6
  21. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/utils/fhiaims/geometry.py +12 -4
  22. atomict-1.2.4.1/atomict/utils/traj.py +0 -0
  23. {atomict-0.1.4 → atomict-1.2.4.1}/atomict.egg-info/PKG-INFO +27 -18
  24. {atomict-0.1.4 → atomict-1.2.4.1}/atomict.egg-info/SOURCES.txt +5 -0
  25. atomict-1.2.4.1/atomict.egg-info/entry_points.txt +2 -0
  26. {atomict-0.1.4 → atomict-1.2.4.1}/atomict.egg-info/requires.txt +5 -2
  27. {atomict-0.1.4 → atomict-1.2.4.1}/pyproject.toml +3 -1
  28. atomict-1.2.4.1/requirements.txt +8 -0
  29. atomict-0.1.4/README.md +0 -72
  30. atomict-0.1.4/atomict/__version__.py +0 -1
  31. atomict-0.1.4/atomict/simulation/ea.py +0 -64
  32. atomict-0.1.4/atomict/simulation/sqs.py +0 -24
  33. atomict-0.1.4/atomict.egg-info/entry_points.txt +0 -2
  34. atomict-0.1.4/requirements.txt +0 -10
  35. {atomict-0.1.4 → atomict-1.2.4.1}/LICENSE +0 -0
  36. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/__init__.py +0 -0
  37. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/api.py +0 -0
  38. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/auth.py +0 -0
  39. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/__init__.py +0 -0
  40. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/ai_assist.py +0 -0
  41. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/catalysis.py +0 -0
  42. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/common.py +0 -0
  43. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/exploration/__init__.py +0 -0
  44. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/exploration/soec.py +0 -0
  45. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/exploration/sqs.py +0 -0
  46. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/helpers.py +0 -0
  47. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/k8s.py +0 -0
  48. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/login.py +0 -0
  49. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/organization.py +0 -0
  50. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/project.py +0 -0
  51. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/__init__.py +0 -0
  52. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/catalysis.py +0 -0
  53. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/fhiaims.py +0 -0
  54. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/kpoint.py +0 -0
  55. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/vibes.py +0 -0
  56. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation.py +0 -0
  57. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/task.py +0 -0
  58. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/commands/user.py +0 -0
  59. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/core/config.py +0 -0
  60. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/cli/core/utils.py +0 -0
  61. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/env.py +0 -0
  62. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/exceptions.py +0 -0
  63. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/infra/__init__.py +0 -0
  64. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/infra/distwork/__init__.py +0 -0
  65. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/infra/distwork/environment.py +0 -0
  66. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/infra/distwork/task.py +0 -0
  67. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/infra/logging.py +0 -0
  68. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/io/__init__.py +0 -0
  69. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/io/utils.py +0 -0
  70. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/ml/__init__.py +0 -0
  71. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/ml/model.py +0 -0
  72. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/project/__init__.py +0 -0
  73. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/project/link.py +0 -0
  74. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/project/note.py +0 -0
  75. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/project/project.py +0 -0
  76. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/project/tags.py +0 -0
  77. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/project/workbench.py +0 -0
  78. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/reality/__init__.py +0 -0
  79. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/reality/oqmd.py +0 -0
  80. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/reality/slabs.py +0 -0
  81. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/__init__.py +0 -0
  82. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/cantera.py +0 -0
  83. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/catalysis.py +0 -0
  84. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/counterfactual.py +0 -0
  85. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/kpoint.py +0 -0
  86. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/phonon.py +0 -0
  87. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/simulation/qe.py +0 -0
  88. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/user/__init__.py +0 -0
  89. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/user/files.py +0 -0
  90. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/utils/fhiaims/__init__.py +0 -0
  91. {atomict-0.1.4 → atomict-1.2.4.1}/atomict/utils/tenacity.py +0 -0
  92. {atomict-0.1.4 → atomict-1.2.4.1}/atomict.egg-info/dependency_links.txt +0 -0
  93. {atomict-0.1.4 → atomict-1.2.4.1}/atomict.egg-info/top_level.txt +0 -0
  94. {atomict-0.1.4 → atomict-1.2.4.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 0.1.4
3
+ Version: 1.2.4.1
4
4
  Summary: The client application for the https://atomictessellator.com/
5
5
  Author-email: Steven Anderson <steven@atomictessellator.com>, Alain Richardt <alain@atomictessellator.com>
6
6
  License: MIT
@@ -18,24 +18,33 @@ Requires-Python: >=3.10
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: requests
21
- Requires-Dist: ase>=3.23.0
22
21
  Requires-Dist: tenacity~=9.0
23
- Requires-Dist: spglib==2.5.0
24
22
  Requires-Dist: httpx
25
23
  Requires-Dist: click~=8.0
26
24
  Requires-Dist: rich~=13.0
25
+ Provides-Extra: utils
26
+ Requires-Dist: ase==3.23.0; extra == "utils"
27
+ Requires-Dist: spglib==2.5.0; extra == "utils"
28
+ Requires-Dist: pymatgen==2025.3.10; extra == "utils"
27
29
  Provides-Extra: dev
28
30
  Requires-Dist: pytest~=8.0; extra == "dev"
29
31
  Requires-Dist: black; extra == "dev"
30
32
  Requires-Dist: isort; extra == "dev"
31
33
  Requires-Dist: mypy; extra == "dev"
32
34
  Requires-Dist: flake8; extra == "dev"
35
+ Dynamic: license-file
33
36
 
34
37
  # Atomic Tessellator - CLI package
35
38
 
36
39
  ## Installation
37
40
  ```
38
41
  pip install atomict
42
+
43
+ # install utils package with scientific extensions (ase, spglib)
44
+ pip install atomict[utils]
45
+
46
+ # ", with a git url
47
+ pip install git+https://github.com/AtomicTessellator/atomic_cli#egg=atomict[utils]
39
48
  ```
40
49
 
41
50
  ## Installation for devs
@@ -53,53 +62,53 @@ export AT_DEBUG=enabled
53
62
 
54
63
  ## Get a list of available commands
55
64
 
56
- ```$ at```
65
+ ```$ tess```
57
66
 
58
67
  ![Alt text](img/at.png?raw=true "at")
59
68
 
60
- You can get help for each command with `at <command> --help`. This will print the command-specific help and options.
69
+ You can get help for each command with `tess <command> --help`. This will print the command-specific help and options.
61
70
  ## Log in and store authentication token
62
71
 
63
- ```$ at login```
72
+ ```$ tess login```
64
73
 
65
74
  This will prompt you for your username and password.
66
75
 
67
76
 
68
77
  ## Get a list of available projects
69
78
 
70
- ```$ at project get```
79
+ ```$ tess project get```
71
80
 
72
- ![Alt text](img/at_project_get.png?raw=true "at project get")
81
+ ![Alt text](img/at_project_get.png?raw=true "tess project get")
73
82
 
74
83
 
75
84
  ## Get a list of adsorbates
76
85
 
77
- ```$ at adsorbate get```
86
+ ```$ tess adsorbate get```
78
87
 
79
- ![Alt text](img/at_adsorbate_get.png?raw=true "at adsorbate get")
88
+ ![Alt text](img/at_adsorbate_get.png?raw=true "tess adsorbate get")
80
89
 
81
90
  ## Search objects for substrings
82
91
 
83
- ```$ at adsorbate get --search NH3```
92
+ ```$ tess adsorbate get --search NH3```
84
93
 
85
- ![Alt text](img/at_adsorbate_get_search.png?raw=true "at adsorbate get --search")
94
+ ![Alt text](img/at_adsorbate_get_search.png?raw=true "tess adsorbate get --search")
86
95
 
87
96
  ## Get a list of tasks
88
97
 
89
- ```$ at task get```
98
+ ```$ tess task get```
90
99
 
91
- ![Alt text](img/at_task_get.png?raw=true "at task get")
100
+ ![Alt text](img/at_task_get.png?raw=true "tess task get")
92
101
 
93
102
  ## Get tasks with a specific status
94
103
 
95
- ```$ at task get --status completed```
104
+ ```$ tess task get --status completed```
96
105
 
97
- ![Alt text](img/at_task_get_completed.png?raw=true "at task get --status completed")
106
+ ![Alt text](img/at_task_get_completed.png?raw=true "tess task get --status completed")
98
107
 
99
108
  ## Configuration
100
109
 
101
110
  Tab completion is available. Run the hidden command:
102
111
 
103
- ```at completion```
112
+ ```tess completion```
104
113
 
105
114
  This will print out the instructions for enabling tab completion for your shell.
@@ -0,0 +1,78 @@
1
+ # Atomic Tessellator - CLI package
2
+
3
+ ## Installation
4
+ ```
5
+ pip install atomict
6
+
7
+ # install utils package with scientific extensions (ase, spglib)
8
+ pip install atomict[utils]
9
+
10
+ # ", with a git url
11
+ pip install git+https://github.com/AtomicTessellator/atomic_cli#egg=atomict[utils]
12
+ ```
13
+
14
+ ## Installation for devs
15
+ ```
16
+ pip install -e ".[dev]"
17
+ ```
18
+
19
+ Enable verbose logging for debugging:
20
+
21
+ ```
22
+ export AT_DEBUG=enabled
23
+ ```
24
+
25
+ # CLI Usage
26
+
27
+ ## Get a list of available commands
28
+
29
+ ```$ tess```
30
+
31
+ ![Alt text](img/at.png?raw=true "at")
32
+
33
+ You can get help for each command with `tess <command> --help`. This will print the command-specific help and options.
34
+ ## Log in and store authentication token
35
+
36
+ ```$ tess login```
37
+
38
+ This will prompt you for your username and password.
39
+
40
+
41
+ ## Get a list of available projects
42
+
43
+ ```$ tess project get```
44
+
45
+ ![Alt text](img/at_project_get.png?raw=true "tess project get")
46
+
47
+
48
+ ## Get a list of adsorbates
49
+
50
+ ```$ tess adsorbate get```
51
+
52
+ ![Alt text](img/at_adsorbate_get.png?raw=true "tess adsorbate get")
53
+
54
+ ## Search objects for substrings
55
+
56
+ ```$ tess adsorbate get --search NH3```
57
+
58
+ ![Alt text](img/at_adsorbate_get_search.png?raw=true "tess adsorbate get --search")
59
+
60
+ ## Get a list of tasks
61
+
62
+ ```$ tess task get```
63
+
64
+ ![Alt text](img/at_task_get.png?raw=true "tess task get")
65
+
66
+ ## Get tasks with a specific status
67
+
68
+ ```$ tess task get --status completed```
69
+
70
+ ![Alt text](img/at_task_get_completed.png?raw=true "tess task get --status completed")
71
+
72
+ ## Configuration
73
+
74
+ Tab completion is available. Run the hidden command:
75
+
76
+ ```tess completion```
77
+
78
+ This will print out the instructions for enabling tab completion for your shell.
@@ -0,0 +1 @@
1
+ __version__ = "1.2.4.1"
@@ -116,8 +116,8 @@ def create(
116
116
  Create a new adsorbate.
117
117
 
118
118
  Examples:
119
- at adsorbate create --smiles "CC(=O)O" --binding-indices 1 --binding-indices 2
120
- at adsorbate create --ase-atoms "Atoms(...)" --reaction-string "A + B -> C"
119
+ tess adsorbate create --smiles "CC(=O)O" --binding-indices 1 --binding-indices 2
120
+ tess adsorbate create --ase-atoms "Atoms(...)" --reaction-string "A + B -> C"
121
121
  """
122
122
  client = get_client()
123
123
 
@@ -155,8 +155,8 @@ def update(
155
155
  Update an existing adsorbate.
156
156
 
157
157
  Examples:
158
- at adsorbate update 123 --smiles "CC(=O)O" --binding-indices 1 --binding-indices 2
159
- at adsorbate update 456 --ase-atoms "Atoms(...)" --reaction-string "A + B -> C"
158
+ tess adsorbate update 123 --smiles "CC(=O)O" --binding-indices 1 --binding-indices 2
159
+ tess adsorbate update 456 --ase-atoms "Atoms(...)" --reaction-string "A + B -> C"
160
160
  """
161
161
  client = get_client()
162
162
 
@@ -0,0 +1,57 @@
1
+ import click
2
+ from pathlib import Path
3
+
4
+
5
+ try:
6
+ from ase.io import read, write
7
+ from ase.io.trajectory import TrajectoryWriter
8
+ except ImportError:
9
+ click.echo("Error: ASE modules not found. Please install with 'pip install atomict[utils]'")
10
+ raise
11
+
12
+
13
+ @click.group()
14
+ def traj():
15
+ """Operations on trajectory files."""
16
+ pass
17
+
18
+
19
+ @traj.command()
20
+ @click.argument('file_path', type=click.Path(exists=True))
21
+ @click.option('-s', '--step', type=int, required=True, help='Subsample every Nth frame')
22
+ def subsample(file_path, step):
23
+ """Subsample a trajectory file by taking every Nth frame.
24
+
25
+ The output will be saved as {original_filename}_subsampled_{step}.traj
26
+ """
27
+ if step <= 0:
28
+ click.echo("Error: Step must be a positive integer")
29
+ return
30
+
31
+ try:
32
+ # Parse the input file path
33
+ input_path = Path(file_path)
34
+
35
+ # Read all frames from the trajectory file
36
+ atoms_list = read(file_path, index=":")
37
+
38
+ # Subsample the frames with the given step
39
+ subsampled_atoms = atoms_list[::step]
40
+
41
+ if not subsampled_atoms:
42
+ click.echo("Warning: No frames were selected with the given step size")
43
+ return
44
+
45
+ # Create output filename
46
+ stem = input_path.stem
47
+ output_file = input_path.with_name(f"{stem}_subsampled_{step}.traj")
48
+
49
+ # Write the subsampled trajectory
50
+ write(str(output_file), subsampled_atoms)
51
+
52
+ click.echo(f"Successfully subsampled trajectory with step {step}")
53
+ click.echo(f"Wrote {len(subsampled_atoms)} frames to {output_file}")
54
+ click.echo(f"Original trajectory had {len(atoms_list)} frames")
55
+
56
+ except Exception as e:
57
+ click.echo(f"Error processing trajectory file: {str(e)}")
@@ -53,8 +53,9 @@ def upload():
53
53
  @click.option("--limit", type=int, help="Number of results to return")
54
54
  @click.option("--type", "file_type", help="Filter by file type")
55
55
  @click.option("--json-output", is_flag=True, help="Output in JSON format")
56
- def list(limit: Optional[int], file_type: Optional[str], json_output: bool):
57
- """List uploaded files"""
56
+ @click.option("--all", "fetch_all", is_flag=True, help="Fetch all results")
57
+ def get(limit: Optional[int], file_type: Optional[str], json_output: bool = False, fetch_all: bool = False):
58
+ """Get uploaded files"""
58
59
  params = {}
59
60
  if limit:
60
61
  params["limit"] = limit
@@ -62,7 +63,11 @@ def list(limit: Optional[int], file_type: Optional[str], json_output: bool):
62
63
  params["type"] = file_type
63
64
 
64
65
  client = get_client()
65
- results = client.get_all("/api/user-upload/", params)
66
+
67
+ if fetch_all:
68
+ results = client.get_all("/api/user-upload/", params)
69
+ else:
70
+ results = client.get("/api/user-upload/", params)
66
71
 
67
72
  if json_output:
68
73
  console.print_json(data=results)
@@ -4,6 +4,7 @@ import os
4
4
  import sys
5
5
  from functools import wraps
6
6
  from typing import Any, Dict, Iterator, List, Optional, Union
7
+ from urllib.parse import urlparse
7
8
 
8
9
  import httpx
9
10
  from rich.console import Console
@@ -35,6 +36,21 @@ def handle_connection_errors(func):
35
36
  class APIClient:
36
37
  def __init__(self, config: Config = None, base_url: str = "https://api.atomictessellator.com"):
37
38
  self.base_url = os.getenv("AT_SERVER", base_url)
39
+
40
+ try:
41
+ parsed_url = urlparse(self.base_url)
42
+ if not all([parsed_url.scheme in ('http', 'https'), parsed_url.netloc]):
43
+ console.print(
44
+ f"[red]Invalid URL format: {self.base_url}[/red]"
45
+ )
46
+ console.print(
47
+ "[yellow]AT_SERVER URL must start with http:// or https:// and include a valid domain.[/yellow]"
48
+ )
49
+ sys.exit(1)
50
+ except Exception as e:
51
+ console.print(f"[red]URL validation error: {str(e)}[/red]")
52
+ sys.exit(1)
53
+
38
54
  self.params = {"limit": 20}
39
55
  self.client = httpx.Client(base_url=self.base_url, timeout=30.0)
40
56
  self.username = None
@@ -1,6 +1,7 @@
1
1
  # cli/main.py
2
2
  import logging
3
3
  import os
4
+ import sys
4
5
 
5
6
  import click
6
7
  from rich.console import Console
@@ -9,7 +10,7 @@ from atomict.__version__ import __version__
9
10
  from atomict.cli.commands import login, user
10
11
 
11
12
  # Import command groups
12
- from .commands import adsorbate, catalysis, k8s, project, task, upload
13
+ from .commands import adsorbate, catalysis, k8s, project, task, traj, upload
13
14
  from .commands.exploration import soec, sqs
14
15
  from .commands.simulation import fhiaims, kpoint, vibes
15
16
 
@@ -45,7 +46,7 @@ def setup_logging(verbose: bool):
45
46
  @click.option(
46
47
  "-v", "--verbose", is_flag=True, default=False, help="Enable verbose output"
47
48
  )
48
- @click.version_option(prog_name="at", version=__version__)
49
+ @click.version_option(prog_name="tess", version=__version__)
49
50
  def cli(verbose: bool):
50
51
  """Atomic Tessellator CLI - Manage simulations and computational resources"""
51
52
  setup_logging(verbose)
@@ -66,17 +67,23 @@ def completion(shell):
66
67
  if shell == "bash":
67
68
  completion_script = """
68
69
  # Add to ~/.bashrc:
69
- eval "$(_AT_COMPLETE=bash_source at)"
70
+ if tess --version > /dev/null 2>&1; then
71
+ eval "$(_TESS_COMPLETE=bash_source tess)"
72
+ fi
70
73
  """
71
74
  elif shell == "zsh":
72
75
  completion_script = """
73
76
  # Add to ~/.zshrc:
74
- eval "$(_AT_COMPLETE=zsh_source at)"
77
+ if tess --version > /dev/null 2>&1; then
78
+ eval "$(_TESS_COMPLETE=zsh_source tess)"
79
+ fi
75
80
  """
76
81
  elif shell == "fish":
77
82
  completion_script = """
78
83
  # Add to ~/.config/fish/config.fish:
79
- eval "$(_AT_COMPLETE=fish_source at)"
84
+ if type -q tess
85
+ eval (env _TESS_COMPLETE=fish_source tess)
86
+ end
80
87
  """
81
88
  click.echo(f"# Shell completion for {shell}")
82
89
  click.echo(completion_script.strip())
@@ -100,6 +107,7 @@ cli.add_command(kpoint.kpoint_group)
100
107
  cli.add_command(catalysis.catalysis_group) # WIP
101
108
  cli.add_command(sqs.sqs_group)
102
109
  cli.add_command(soec.soecexploration_group)
110
+ cli.add_command(traj.traj)
103
111
  cli.add_command(user.user_group)
104
112
  cli.add_command(login._login)
105
113
  cli.add_command(vibes.vibes_group)
@@ -117,7 +125,11 @@ cli.add_command(vibes.vibes_group)
117
125
 
118
126
 
119
127
  def main():
120
- cli()
128
+ try:
129
+ cli()
130
+ except Exception as exc:
131
+ Console().print(f"[red]Error: {str(exc)}. Exiting...[/red]")
132
+ sys.exit(1)
121
133
 
122
134
 
123
135
  if __name__ == "__main__":
@@ -1,6 +1,14 @@
1
1
  import logging
2
- import ase.io
3
- import spglib
2
+ try:
3
+ import ase.io
4
+ import spglib
5
+ from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
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
+ )
4
12
 
5
13
 
6
14
  class CIFAnalyzer:
@@ -110,7 +118,17 @@ class CIFAnalyzer:
110
118
  for letter in set(dataset.wyckoffs)
111
119
  }
112
120
 
113
- return {
121
+ # Convert ASE atoms to pymatgen Structure for SpacegroupAnalyzer
122
+ lattice = self.atoms.get_cell()
123
+ species = self.atoms.get_chemical_symbols()
124
+ coords = self.atoms.get_scaled_positions()
125
+ structure = Structure(lattice, species, coords)
126
+
127
+ # Now use SpacegroupAnalyzer with the pymatgen Structure
128
+ analyzer = SpacegroupAnalyzer(structure)
129
+ bravais = analyzer.get_lattice_type()
130
+
131
+ symmetry_info = {
114
132
  'symmetry': {
115
133
  'space_group_number': dataset.number,
116
134
  'space_group_international': dataset.international,
@@ -122,9 +140,11 @@ class CIFAnalyzer:
122
140
  'transformation_matrix': dataset.transformation_matrix.tolist(),
123
141
  'origin_shift': dataset.origin_shift.tolist(),
124
142
  'asymmetric_unit_atoms': len(unique_equiv),
125
- 'wyckoff_multiplicities': wyckoff_multiplicities
143
+ 'wyckoff_multiplicities': wyckoff_multiplicities,
144
+ 'bravais_lattice': bravais
126
145
  }
127
146
  }
147
+ return symmetry_info
128
148
  except Exception as e:
129
149
  logging.warning(f'Could not determine symmetry information: {str(e)}')
130
150
 
@@ -1,5 +1,11 @@
1
- from ase.io.aims import check_convergence, get_aims_out_chunks, get_header_chunk
2
- from ase.utils import reader
1
+ try:
2
+ from ase.io.aims import check_convergence, get_aims_out_chunks, get_header_chunk
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
+ )
3
9
 
4
10
 
5
11
  # We have to write our own function because he read_aims_output function inside ASE only supports
@@ -1,8 +1,14 @@
1
1
  import io
2
2
  import json
3
3
 
4
- from ase import Atoms
5
- from ase.io import read, write
4
+ try:
5
+ from ase import Atoms
6
+ from ase.io import read, write
7
+ except ImportError:
8
+ raise ImportError(
9
+ "The 'ase' package is required for JSON operations with Atoms objects. "
10
+ "To install the optional dependencies such as ase, spglib, pymatgen, use `pip install atomict[utils]`"
11
+ )
6
12
 
7
13
 
8
14
  def atoms_to_json(atoms: Atoms) -> str:
@@ -0,0 +1,24 @@
1
+ from atomict.api import get, post
2
+
3
+
4
+ def get_defect_exploration(exploration_id: str):
5
+ return get(f"api/defect-exploration/{exploration_id}/")
6
+
7
+
8
+ def get_defect_exploration_file(file_id: str):
9
+ return get(f"api/defect-exploration-file/{file_id}/")
10
+
11
+
12
+ def create_defect_exploration(data: dict):
13
+ return post("api/defect-exploration/", data)
14
+
15
+
16
+ def create_defect_exploration_file(data: dict):
17
+ return post("api/defect-exploration-file/", data)
18
+
19
+
20
+ def associate_user_upload_with_defect_exploration(user_upload_id: str, exploration_id: str):
21
+ return post(
22
+ "api/defect-exploration-file/",
23
+ payload={"user_upload_id": user_upload_id, "analysis_id": exploration_id},
24
+ )
@@ -0,0 +1,117 @@
1
+ from atomict.api import get, post
2
+
3
+
4
+ def get_ea_exploration(exploration_id: str, **params):
5
+ """
6
+ Get EA exploration
7
+
8
+ Args:
9
+ exploration_id: str - The ID of the exploration
10
+ **params: Additional GET parameters to pass to the API
11
+ """
12
+ query_string = '&'.join(f"{k}={v}" for k, v in params.items())
13
+ base_url = f"api/ea-exploration/{exploration_id}/"
14
+ url = f"{base_url}?{query_string}" if query_string else base_url
15
+ return get(url)
16
+
17
+
18
+ def get_ea_exploration_sample(sample_id: str, **params):
19
+ """
20
+ Get EA exploration sample
21
+
22
+ Args:
23
+ sample_id: str - The ID of the sample
24
+ **params: Additional GET parameters to pass to the API
25
+ """
26
+ query_string = '&'.join(f"{k}={v}" for k, v in params.items())
27
+ base_url = f"api/ea-exploration-sample/{sample_id}/"
28
+ url = f"{base_url}?{query_string}" if query_string else base_url
29
+ return get(url)
30
+
31
+
32
+ def get_ea_exploration_samples(exploration_id: str, **params):
33
+ """
34
+ Get EA exploration samples
35
+
36
+ Args:
37
+ exploration_id: str - The ID of the exploration
38
+ **params: Additional GET parameters to pass to the API
39
+ """
40
+ # Start with the required exploration parameter
41
+ query_params = params.copy()
42
+ query_params['exploration'] = exploration_id
43
+
44
+ query_string = '&'.join(f"{k}={v}" for k, v in query_params.items())
45
+ url = f"api/ea-exploration-sample/?{query_string}"
46
+ return get(url)
47
+
48
+
49
+ def get_ea_exploration_analysis(analysis_id: str, **params):
50
+ """
51
+ Get EA exploration analysis
52
+
53
+ Args:
54
+ analysis_id: str - The ID of the analysis
55
+ **params: Additional GET parameters to pass to the API
56
+ """
57
+ query_string = '&'.join(f"{k}={v}" for k, v in params.items())
58
+ base_url = f"api/ea-exploration-analysis/{analysis_id}/"
59
+ url = f"{base_url}?{query_string}" if query_string else base_url
60
+ return get(url)
61
+
62
+
63
+ def get_ea_exploration_analysis_file(analysis_file_id: str, **params):
64
+ """
65
+ Get EA exploration analysis file
66
+
67
+ Args:
68
+ analysis_file_id: str - The ID of the analysis file
69
+ **params: Additional GET parameters to pass to the API
70
+ """
71
+ query_string = '&'.join(f"{k}={v}" for k, v in params.items())
72
+ base_url = f"api/ea-exploration-analysis-file/{analysis_file_id}/"
73
+ url = f"{base_url}?{query_string}" if query_string else base_url
74
+ return get(url)
75
+
76
+
77
+ def associate_user_upload_with_ea_exploration(user_upload_id: str, analysis_id: str):
78
+ return post(
79
+ "api/ea-exploration-analysis-file/",
80
+ payload={"user_upload_id": user_upload_id, "analysis_id": analysis_id},
81
+ )
82
+
83
+
84
+ def create_exploration_sample(
85
+ exploration_id: str,
86
+ simulation_id: str = None,
87
+ mlrelax_id: str = None,
88
+ strain: float = None,
89
+ matrix: int = None,
90
+ ):
91
+ """
92
+ Create an exploration sample
93
+
94
+ exploration_id: str - The ID of the exploration to associate the sample with
95
+ simulation_id: str - The ID of the simulation to associate with the exploration
96
+ strain: float - The strain to associate with the sample
97
+ matrix: int - The matrix to associate with the sample
98
+ """
99
+
100
+ if simulation_id is None and mlrelax_id is None:
101
+ raise ValueError("Either simulation_id or mlrelax_id must be provided")
102
+
103
+ payload = {
104
+ "exploration_id": exploration_id,
105
+ "strain": strain,
106
+ "matrix": matrix,
107
+ }
108
+
109
+ if simulation_id:
110
+ payload["simulation_id"] = simulation_id
111
+ elif mlrelax_id:
112
+ payload["mlrelax_id"] = mlrelax_id
113
+
114
+ return post(
115
+ "api/ea-exploration-sample/",
116
+ payload=payload,
117
+ )
@@ -35,11 +35,14 @@ def create_simulation(
35
35
  return result
36
36
 
37
37
 
38
- def get_simulation(simulation_id: str):
38
+ def get_simulation(simulation_id: str, **params):
39
39
  """
40
40
  Get a FHI aims simulation
41
41
  """
42
- result = get(f"api/fhiaims-simulation/{simulation_id}/")
42
+ query_string = '&'.join(f"{k}={v}" for k, v in params.items())
43
+ base_url = f"api/fhiaims-simulation/{simulation_id}/"
44
+ url = f"{base_url}?{query_string}" if query_string else base_url
45
+ result = get(url)
43
46
  return result
44
47
 
45
48
 
@@ -0,0 +1,20 @@
1
+ from atomict.api import get, post
2
+
3
+
4
+ def get_mattergen(id: str):
5
+ """
6
+ Get MatterGen
7
+ """
8
+ result = get(f"api/mattergen-exploration/{id}/")
9
+ return result
10
+
11
+
12
+ def associate_user_upload_with_mattergen(user_upload_id: str, exploration_id: str):
13
+ """
14
+ Associate a user upload with a MatterGen
15
+ """
16
+ result = post(
17
+ "api/mattergen-exploration-file/",
18
+ payload={"user_upload_id": user_upload_id, "exploration_id": exploration_id},
19
+ )
20
+ return result