atomict 0.2.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 (92) hide show
  1. {atomict-0.2.4 → atomict-1.2.4.1}/PKG-INFO +21 -16
  2. {atomict-0.2.4 → atomict-1.2.4.1}/README.md +17 -14
  3. atomict-1.2.4.1/atomict/__version__.py +1 -0
  4. {atomict-0.2.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.2.4 → atomict-1.2.4.1}/atomict/cli/core/client.py +16 -0
  7. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/main.py +16 -10
  8. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/io/cif.py +18 -5
  9. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/io/fhiaims.py +1 -1
  10. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/io/json.py +1 -1
  11. atomict-1.2.4.1/atomict/simulation/defect.py +24 -0
  12. atomict-1.2.4.1/atomict/simulation/ea.py +117 -0
  13. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/fhi_aims.py +5 -2
  14. atomict-1.2.4.1/atomict/simulation/md.py +32 -0
  15. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/mlrelax.py +22 -4
  16. atomict-1.2.4.1/atomict/simulation/sqs.py +38 -0
  17. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/utils.py +3 -3
  18. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/user/workspace.py +2 -6
  19. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/utils/fhiaims/geometry.py +1 -1
  20. atomict-1.2.4.1/atomict/utils/traj.py +0 -0
  21. {atomict-0.2.4 → atomict-1.2.4.1}/atomict.egg-info/PKG-INFO +21 -16
  22. {atomict-0.2.4 → atomict-1.2.4.1}/atomict.egg-info/SOURCES.txt +4 -0
  23. atomict-1.2.4.1/atomict.egg-info/entry_points.txt +2 -0
  24. {atomict-0.2.4 → atomict-1.2.4.1}/atomict.egg-info/requires.txt +1 -0
  25. {atomict-0.2.4 → atomict-1.2.4.1}/pyproject.toml +2 -2
  26. atomict-0.2.4/atomict/__version__.py +0 -1
  27. atomict-0.2.4/atomict/simulation/ea.py +0 -64
  28. atomict-0.2.4/atomict/simulation/sqs.py +0 -24
  29. atomict-0.2.4/atomict.egg-info/entry_points.txt +0 -2
  30. {atomict-0.2.4 → atomict-1.2.4.1}/LICENSE +0 -0
  31. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/__init__.py +0 -0
  32. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/api.py +0 -0
  33. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/auth.py +0 -0
  34. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/__init__.py +0 -0
  35. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/ai_assist.py +0 -0
  36. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/catalysis.py +0 -0
  37. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/common.py +0 -0
  38. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/exploration/__init__.py +0 -0
  39. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/exploration/soec.py +0 -0
  40. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/exploration/sqs.py +0 -0
  41. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/helpers.py +0 -0
  42. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/k8s.py +0 -0
  43. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/login.py +0 -0
  44. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/organization.py +0 -0
  45. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/project.py +0 -0
  46. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/__init__.py +0 -0
  47. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/catalysis.py +0 -0
  48. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/fhiaims.py +0 -0
  49. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/kpoint.py +0 -0
  50. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation/vibes.py +0 -0
  51. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/simulation.py +0 -0
  52. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/task.py +0 -0
  53. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/upload.py +0 -0
  54. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/commands/user.py +0 -0
  55. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/core/config.py +0 -0
  56. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/cli/core/utils.py +0 -0
  57. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/env.py +0 -0
  58. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/exceptions.py +0 -0
  59. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/infra/__init__.py +0 -0
  60. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/infra/distwork/__init__.py +0 -0
  61. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/infra/distwork/environment.py +0 -0
  62. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/infra/distwork/task.py +0 -0
  63. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/infra/logging.py +0 -0
  64. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/io/__init__.py +0 -0
  65. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/io/utils.py +0 -0
  66. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/ml/__init__.py +0 -0
  67. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/ml/model.py +0 -0
  68. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/project/__init__.py +0 -0
  69. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/project/link.py +0 -0
  70. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/project/note.py +0 -0
  71. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/project/project.py +0 -0
  72. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/project/tags.py +0 -0
  73. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/project/workbench.py +0 -0
  74. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/reality/__init__.py +0 -0
  75. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/reality/oqmd.py +0 -0
  76. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/reality/slabs.py +0 -0
  77. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/__init__.py +0 -0
  78. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/cantera.py +0 -0
  79. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/catalysis.py +0 -0
  80. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/counterfactual.py +0 -0
  81. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/kpoint.py +0 -0
  82. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/mattergen.py +0 -0
  83. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/phonon.py +0 -0
  84. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/simulation/qe.py +0 -0
  85. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/user/__init__.py +0 -0
  86. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/user/files.py +0 -0
  87. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/utils/fhiaims/__init__.py +0 -0
  88. {atomict-0.2.4 → atomict-1.2.4.1}/atomict/utils/tenacity.py +0 -0
  89. {atomict-0.2.4 → atomict-1.2.4.1}/atomict.egg-info/dependency_links.txt +0 -0
  90. {atomict-0.2.4 → atomict-1.2.4.1}/atomict.egg-info/top_level.txt +0 -0
  91. {atomict-0.2.4 → atomict-1.2.4.1}/requirements.txt +0 -0
  92. {atomict-0.2.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.2.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
@@ -25,12 +25,14 @@ Requires-Dist: rich~=13.0
25
25
  Provides-Extra: utils
26
26
  Requires-Dist: ase==3.23.0; extra == "utils"
27
27
  Requires-Dist: spglib==2.5.0; extra == "utils"
28
+ Requires-Dist: pymatgen==2025.3.10; extra == "utils"
28
29
  Provides-Extra: dev
29
30
  Requires-Dist: pytest~=8.0; extra == "dev"
30
31
  Requires-Dist: black; extra == "dev"
31
32
  Requires-Dist: isort; extra == "dev"
32
33
  Requires-Dist: mypy; extra == "dev"
33
34
  Requires-Dist: flake8; extra == "dev"
35
+ Dynamic: license-file
34
36
 
35
37
  # Atomic Tessellator - CLI package
36
38
 
@@ -40,6 +42,9 @@ pip install atomict
40
42
 
41
43
  # install utils package with scientific extensions (ase, spglib)
42
44
  pip install atomict[utils]
45
+
46
+ # ", with a git url
47
+ pip install git+https://github.com/AtomicTessellator/atomic_cli#egg=atomict[utils]
43
48
  ```
44
49
 
45
50
  ## Installation for devs
@@ -57,53 +62,53 @@ export AT_DEBUG=enabled
57
62
 
58
63
  ## Get a list of available commands
59
64
 
60
- ```$ at```
65
+ ```$ tess```
61
66
 
62
67
  ![Alt text](img/at.png?raw=true "at")
63
68
 
64
- 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.
65
70
  ## Log in and store authentication token
66
71
 
67
- ```$ at login```
72
+ ```$ tess login```
68
73
 
69
74
  This will prompt you for your username and password.
70
75
 
71
76
 
72
77
  ## Get a list of available projects
73
78
 
74
- ```$ at project get```
79
+ ```$ tess project get```
75
80
 
76
- ![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")
77
82
 
78
83
 
79
84
  ## Get a list of adsorbates
80
85
 
81
- ```$ at adsorbate get```
86
+ ```$ tess adsorbate get```
82
87
 
83
- ![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")
84
89
 
85
90
  ## Search objects for substrings
86
91
 
87
- ```$ at adsorbate get --search NH3```
92
+ ```$ tess adsorbate get --search NH3```
88
93
 
89
- ![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")
90
95
 
91
96
  ## Get a list of tasks
92
97
 
93
- ```$ at task get```
98
+ ```$ tess task get```
94
99
 
95
- ![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")
96
101
 
97
102
  ## Get tasks with a specific status
98
103
 
99
- ```$ at task get --status completed```
104
+ ```$ tess task get --status completed```
100
105
 
101
- ![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")
102
107
 
103
108
  ## Configuration
104
109
 
105
110
  Tab completion is available. Run the hidden command:
106
111
 
107
- ```at completion```
112
+ ```tess completion```
108
113
 
109
114
  This will print out the instructions for enabling tab completion for your shell.
@@ -6,6 +6,9 @@ pip install atomict
6
6
 
7
7
  # install utils package with scientific extensions (ase, spglib)
8
8
  pip install atomict[utils]
9
+
10
+ # ", with a git url
11
+ pip install git+https://github.com/AtomicTessellator/atomic_cli#egg=atomict[utils]
9
12
  ```
10
13
 
11
14
  ## Installation for devs
@@ -23,53 +26,53 @@ export AT_DEBUG=enabled
23
26
 
24
27
  ## Get a list of available commands
25
28
 
26
- ```$ at```
29
+ ```$ tess```
27
30
 
28
31
  ![Alt text](img/at.png?raw=true "at")
29
32
 
30
- You can get help for each command with `at <command> --help`. This will print the command-specific help and options.
33
+ You can get help for each command with `tess <command> --help`. This will print the command-specific help and options.
31
34
  ## Log in and store authentication token
32
35
 
33
- ```$ at login```
36
+ ```$ tess login```
34
37
 
35
38
  This will prompt you for your username and password.
36
39
 
37
40
 
38
41
  ## Get a list of available projects
39
42
 
40
- ```$ at project get```
43
+ ```$ tess project get```
41
44
 
42
- ![Alt text](img/at_project_get.png?raw=true "at project get")
45
+ ![Alt text](img/at_project_get.png?raw=true "tess project get")
43
46
 
44
47
 
45
48
  ## Get a list of adsorbates
46
49
 
47
- ```$ at adsorbate get```
50
+ ```$ tess adsorbate get```
48
51
 
49
- ![Alt text](img/at_adsorbate_get.png?raw=true "at adsorbate get")
52
+ ![Alt text](img/at_adsorbate_get.png?raw=true "tess adsorbate get")
50
53
 
51
54
  ## Search objects for substrings
52
55
 
53
- ```$ at adsorbate get --search NH3```
56
+ ```$ tess adsorbate get --search NH3```
54
57
 
55
- ![Alt text](img/at_adsorbate_get_search.png?raw=true "at adsorbate get --search")
58
+ ![Alt text](img/at_adsorbate_get_search.png?raw=true "tess adsorbate get --search")
56
59
 
57
60
  ## Get a list of tasks
58
61
 
59
- ```$ at task get```
62
+ ```$ tess task get```
60
63
 
61
- ![Alt text](img/at_task_get.png?raw=true "at task get")
64
+ ![Alt text](img/at_task_get.png?raw=true "tess task get")
62
65
 
63
66
  ## Get tasks with a specific status
64
67
 
65
- ```$ at task get --status completed```
68
+ ```$ tess task get --status completed```
66
69
 
67
- ![Alt text](img/at_task_get_completed.png?raw=true "at task get --status completed")
70
+ ![Alt text](img/at_task_get_completed.png?raw=true "tess task get --status completed")
68
71
 
69
72
  ## Configuration
70
73
 
71
74
  Tab completion is available. Run the hidden command:
72
75
 
73
- ```at completion```
76
+ ```tess completion```
74
77
 
75
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)}")
@@ -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,23 +67,23 @@ def completion(shell):
66
67
  if shell == "bash":
67
68
  completion_script = """
68
69
  # Add to ~/.bashrc:
69
- if at -v > /dev/null 2>&1; then
70
- eval "$(_AT_COMPLETE=bash_source at)"
70
+ if tess --version > /dev/null 2>&1; then
71
+ eval "$(_TESS_COMPLETE=bash_source tess)"
71
72
  fi
72
73
  """
73
74
  elif shell == "zsh":
74
75
  completion_script = """
75
76
  # Add to ~/.zshrc:
76
- if at -v > /dev/null 2>&1; then
77
- eval "$(_AT_COMPLETE=zsh_source at)"
77
+ if tess --version > /dev/null 2>&1; then
78
+ eval "$(_TESS_COMPLETE=zsh_source tess)"
78
79
  fi
79
80
  """
80
81
  elif shell == "fish":
81
82
  completion_script = """
82
83
  # Add to ~/.config/fish/config.fish:
83
- if at -v > /dev/null 2>&1; then
84
- eval "$(_AT_COMPLETE=fish_source at)"
85
- fi
84
+ if type -q tess
85
+ eval (env _TESS_COMPLETE=fish_source tess)
86
+ end
86
87
  """
87
88
  click.echo(f"# Shell completion for {shell}")
88
89
  click.echo(completion_script.strip())
@@ -106,6 +107,7 @@ cli.add_command(kpoint.kpoint_group)
106
107
  cli.add_command(catalysis.catalysis_group) # WIP
107
108
  cli.add_command(sqs.sqs_group)
108
109
  cli.add_command(soec.soecexploration_group)
110
+ cli.add_command(traj.traj)
109
111
  cli.add_command(user.user_group)
110
112
  cli.add_command(login._login)
111
113
  cli.add_command(vibes.vibes_group)
@@ -123,7 +125,11 @@ cli.add_command(vibes.vibes_group)
123
125
 
124
126
 
125
127
  def main():
126
- cli()
128
+ try:
129
+ cli()
130
+ except Exception as exc:
131
+ Console().print(f"[red]Error: {str(exc)}. Exiting...[/red]")
132
+ sys.exit(1)
127
133
 
128
134
 
129
135
  if __name__ == "__main__":
@@ -1,12 +1,13 @@
1
1
  import logging
2
-
3
2
  try:
4
3
  import ase.io
5
4
  import spglib
5
+ from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
6
+ from pymatgen.core import Structure
6
7
  except ImportError:
7
8
  raise ImportError(
8
- "The 'ase' and 'spglib' packages are required for CIF operations. "
9
- "To install the optional dependency, use atomict[utils]"
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]`"
10
11
  )
11
12
 
12
13
 
@@ -117,7 +118,17 @@ class CIFAnalyzer:
117
118
  for letter in set(dataset.wyckoffs)
118
119
  }
119
120
 
120
- 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 = {
121
132
  'symmetry': {
122
133
  'space_group_number': dataset.number,
123
134
  'space_group_international': dataset.international,
@@ -129,9 +140,11 @@ class CIFAnalyzer:
129
140
  'transformation_matrix': dataset.transformation_matrix.tolist(),
130
141
  'origin_shift': dataset.origin_shift.tolist(),
131
142
  'asymmetric_unit_atoms': len(unique_equiv),
132
- 'wyckoff_multiplicities': wyckoff_multiplicities
143
+ 'wyckoff_multiplicities': wyckoff_multiplicities,
144
+ 'bravais_lattice': bravais
133
145
  }
134
146
  }
147
+ return symmetry_info
135
148
  except Exception as e:
136
149
  logging.warning(f'Could not determine symmetry information: {str(e)}')
137
150
 
@@ -4,7 +4,7 @@ try:
4
4
  except ImportError:
5
5
  raise ImportError(
6
6
  "The 'ase' package is required for FHI-aims operations. "
7
- "To install the optional dependency, use atomict[utils]"
7
+ "To install the optional dependencies such as ase, spglib, pymatgen, use `pip install atomict[utils]`"
8
8
  )
9
9
 
10
10
 
@@ -7,7 +7,7 @@ try:
7
7
  except ImportError:
8
8
  raise ImportError(
9
9
  "The 'ase' package is required for JSON operations with Atoms objects. "
10
- "To install the optional dependency, use atomict[utils]"
10
+ "To install the optional dependencies such as ase, spglib, pymatgen, use `pip install atomict[utils]`"
11
11
  )
12
12
 
13
13
 
@@ -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,32 @@
1
+ from atomict.api import get, post, delete
2
+
3
+
4
+ def get_md_simulation(simulation_id: str):
5
+ return get(f"api/md/{simulation_id}/")
6
+
7
+
8
+ def get_md_simulation_file(file_id: str):
9
+ return get(f"api/md-file/{file_id}/")
10
+
11
+
12
+ def create_md_simulation(data: dict):
13
+ return post("api/md/", data)
14
+
15
+
16
+ def create_md_simulation_file(data: dict):
17
+ return post("api/md-file/", data)
18
+
19
+
20
+ def associate_user_upload_with_md_simulation(user_upload_id: str, simulation_id: str):
21
+ return post(
22
+ "api/md-file/",
23
+ payload={"user_upload_id": user_upload_id, "md_id": simulation_id},
24
+ )
25
+
26
+
27
+ def delete_md_simulation(simulation_id: str):
28
+ return delete(f"api/md/{simulation_id}/")
29
+
30
+
31
+ def delete_md_simulation_file(file_id: str):
32
+ return delete(f"api/md-file/{file_id}/")
@@ -5,13 +5,26 @@ COMPUTATION_TYPE_SINGLE_POINT = 1
5
5
 
6
6
  MODEL_ORB_D3_V2 = 0
7
7
  MODEL_MATTERSIM_1_0_0_5M = 1
8
+ MODEL_ORB_V3_CONSERVATIVE = 2
9
+ MODEL_ESEN_30M_OAM = 3
8
10
 
9
11
 
10
- def get_mlrelax(id: str):
12
+ def get_mlrelax(id: str, **params):
11
13
  """
12
14
  Get MLRelaxation
15
+
16
+ Args:
17
+ id: str - The ID of the MLRelaxation
18
+ **params: Additional GET parameters to pass to the API
13
19
  """
14
- result = get(f"api/mlrelax/{id}/")
20
+ # Build query string from parameters
21
+ query_string = '&'.join(f"{k}={v}" for k, v in params.items())
22
+ base_url = f"api/mlrelax/{id}/"
23
+
24
+ # Add query string if we have parameters
25
+ url = f"{base_url}?{query_string}" if query_string else base_url
26
+
27
+ result = get(url)
15
28
  return result
16
29
 
17
30
 
@@ -52,9 +65,14 @@ def create_mlrelaxation(
52
65
  "Invalid computation type. Please use COMPUTATION_TYPE_RELAXATION (0) or COMPUTATION_TYPE_SINGLE_POINT (1)."
53
66
  )
54
67
 
55
- if model not in [MODEL_ORB_D3_V2, MODEL_MATTERSIM_1_0_0_5M]:
68
+ if model not in [
69
+ MODEL_ORB_D3_V2,
70
+ MODEL_MATTERSIM_1_0_0_5M,
71
+ MODEL_ORB_V3_CONSERVATIVE,
72
+ MODEL_ESEN_30M_OAM,
73
+ ]:
56
74
  raise ValueError(
57
- "Invalid model. Please use MODEL_ORB_D3_V2 (0) or MODEL_MATTERSIM_1_0_0_5M (1)."
75
+ "Invalid model. Please use MODEL_ORB_D3_V2 (0), MODEL_MATTERSIM_1_0_0_5M (1), MODEL_ORB_V3_CONSERVATIVE (2), or MODEL_ESEN_30M_OAM (3)."
58
76
  )
59
77
 
60
78
  payload = {