atomict 1.2.23__py3-none-any.whl → 1.2.24__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.
@@ -1,39 +1,33 @@
1
1
  atomict/__init__.py,sha256=nMXg9GFsk8gCcyBnh1MAeUPvo4Zcuv3sdwGHZrxfpPE,36
2
- atomict/__version__.py,sha256=y_Ev8AcJxzZe4ZJWlW3Wsver97OJUqU1nFSDqHzKBDw,23
2
+ atomict/__version__.py,sha256=rRcFnLqwG22zZ399qswskAE5L_if50hEsd_TKzGcrZ4,23
3
3
  atomict/api.py,sha256=1aI2qPMm6V9VY4PLR8LBMm2WwVCBB9pAL7sEowvjhtc,6706
4
4
  atomict/auth.py,sha256=yMEaxaSg44tSDxr4x-bjwjjn9zIsqw_bVoKd01Zd9LU,987
5
5
  atomict/env.py,sha256=RqK5SUfCDJ6aMGtCPhNmSrwsNZSjlGaDQYYk41oeBDc,2115
6
6
  atomict/exceptions.py,sha256=-PT-Bw-2SoPAME0ELXCXRBsU7tBOAbHTscnvnGRto-4,146
7
7
  atomict/ase/atatoms.py,sha256=I0RnhHMi_tkl22lcuJKlyXv26rSdzXYeqkzTsCBFgrE,27737
8
8
  atomict/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- atomict/cli/main.py,sha256=F-lhRCsTFwyiBuNlAsOW4t-yAzUcfxl9DL6ku2Mpes4,8906
10
- atomict/cli/commands/adsorbate.py,sha256=fdu6m5Kx2fkQXA--BsvU5QWcq0-PKFi7bGaLJZnnqag,5836
9
+ atomict/cli/main.py,sha256=mRGjZBWHW-8Z-LXpwshaJGAB72tjCwFNNKjn9jXaqVk,3518
11
10
  atomict/cli/commands/ai_assist.py,sha256=IgZyoeL5mdwkcwxKWD7y0Enjus-wSlrYee-keyacOOY,3449
12
- atomict/cli/commands/catalysis.py,sha256=raBRBttv3R2ZQvZBnyIlnBXJyZbpISL_5_WWXHg3X_s,5502
13
11
  atomict/cli/commands/common.py,sha256=NG8hiLxUGtk-fW5uVs30nKqVciireghoczT7YsGoR1w,1630
12
+ atomict/cli/commands/convert.py,sha256=5cRtaYLnYK9Yc3462ydMCk7GLGld1RCkVEohIF-CJs8,4608
14
13
  atomict/cli/commands/helpers.py,sha256=VcfJ9g_5CQpVVr-Ptbz4Ah-kq7z5WEJxVCvJkREFjUQ,2039
15
14
  atomict/cli/commands/k8s.py,sha256=aPll70iXe5Kd4-4ZWPVDiTzwvC9r74_EOgnPBpZVojk,6712
16
15
  atomict/cli/commands/login.py,sha256=6BsyRsNLAtr2bMwYr1e5IAKqjuHI6edClCCBdJ_rZF8,1171
17
16
  atomict/cli/commands/organization.py,sha256=EIDpiue815jNi4mDyLCbHUGudNlB0RBPwWgrdBt5DCo,2106
18
17
  atomict/cli/commands/project.py,sha256=kbqTE7tUEkjE3Hm64WrHDw_sqd1jMnGOH4PIQPJfmEM,28540
19
- atomict/cli/commands/simulation.py,sha256=ywh5pIKEC2B60G_gqb9ZcDhyZyKrcXaBxGXWw8TaQ7g,5357
20
18
  atomict/cli/commands/task.py,sha256=eRZlClY4W57gKz6WiYKf9M1ZdLag37o3YxUrgOCCfsA,5453
21
19
  atomict/cli/commands/token.py,sha256=yTyH0J2xStO2cly9iifMHd8QTvHVPHL0owe4r6XUJ5s,560
22
- atomict/cli/commands/traj.py,sha256=uMOjc_gZy0MlKAbEDPDxCjLB3s2aCV_ZZ3A0mbnkBTA,1831
20
+ atomict/cli/commands/traj.py,sha256=SIgBYKKIFJ-_C37abefEO2Qzoql4GFYuIGgPmCykoj0,1675
23
21
  atomict/cli/commands/upload.py,sha256=U7OW4mrYeqfoMHXPIBNTHDTOvx_-rGiY82Sj72y8N-Q,2823
24
22
  atomict/cli/commands/user.py,sha256=7jja2At19hrMoTaRx7PrAZRS0C48BJjIN9WEmzN7Xxc,6486
25
23
  atomict/cli/commands/exploration/__init__.py,sha256=LTuDJsRPL62w-YYXx-X_GgsuD2Dovj74h-G5tTw5DaE,169
26
24
  atomict/cli/commands/exploration/soec.py,sha256=ZkKJKHz97OaswLS0hptyEquQyyATkfb8T6EI3ngkg68,18888
27
25
  atomict/cli/commands/exploration/sqs.py,sha256=AVyiU25SvOv1I-lYfCqgnnaEmCiFNDggsP1GLcmliS8,14593
28
- atomict/cli/commands/simulation/__init__.py,sha256=WN3nfhsjbebyJhG_XcMB6rp2r-vqK5F5k7jxVpYFJCo,518
29
- atomict/cli/commands/simulation/catalysis.py,sha256=cmQDdy-c6fF7jVjieKSOZOK5Wv9LY62Lf5Ui7f1Dn5w,6995
30
26
  atomict/cli/commands/simulation/fhiaims.py,sha256=iUddj5W98gflQOkLo7FD8y7kpdtaLZQFw8LEYVha6f0,9180
31
27
  atomict/cli/commands/simulation/kpoint.py,sha256=dnmJSfhXLLOpftFnNGPFPTVfNq_93LiOxG8EeFeIN5c,12391
32
- atomict/cli/commands/simulation/vibes.py,sha256=lfGtKAE6wXhcv3pp6cW76sNHsnoAALVATVMTUX6vZbM,5410
33
28
  atomict/cli/core/client.py,sha256=oHbcCLORxjNDw-pTCzpkZPGETaXToik_3xfurMNbhW8,8402
34
29
  atomict/cli/core/config.py,sha256=MHQGo59yt3839-r1-3IXqOrN5DNLxMeQ2QBJRSbFONA,1378
35
30
  atomict/cli/core/utils.py,sha256=J8hh1F1vKERnj8JpWSmc2-UHiwFSJfCCnCjDL3-xm4E,941
36
- atomict/cli/ext/custom_classes.py,sha256=Mx68rdYk5VmgGJxjSuMNxaA6YezgdOyA0HYO8PheKsI,1761
37
31
  atomict/infra/__init__.py,sha256=qp1HP0h6G9LW0QOe_9JBgoE_Q_OJpA10dMNQXz40Ct0,89
38
32
  atomict/infra/logging.py,sha256=QC1FTCyth-Qg4rn5h3yzqqKKWYoXMn_4n9AK99rcpOE,7690
39
33
  atomict/infra/distwork/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -41,14 +35,14 @@ atomict/infra/distwork/environment.py,sha256=joydS9wA2pgWafXh_Wqgg95Inaxhsusohae
41
35
  atomict/infra/distwork/task.py,sha256=kflMllczaUQHDa8AAUTsLi5RJivckr1LKHAUZwqIKio,1182
42
36
  atomict/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
37
  atomict/io/atoms.py,sha256=kdMnto7eyiY2zmoOvLlzbuTGUCIp4ViQGwLmf2m9fGU,13144
44
- atomict/io/cif.py,sha256=o7oe6alug5ais2QnJhv88X7sAbZSbTkEWhHa-4Dkw1E,6040
45
- atomict/io/fhiaims.py,sha256=4Z5oImjZuP-k8AudrMrXqvsO0IHajDy__h5NmLr1LGY,1197
38
+ atomict/io/cif.py,sha256=s4ThgriM_yyqKUZ8_RIPHm7lz7U5-hX8Jv96JNU2QVo,5793
39
+ atomict/io/fhiaims.py,sha256=Zh_HAsv6128acSwzSeTrGN1Ra1I_RvDwJsubRODovaY,958
46
40
  atomict/io/trajectory.py,sha256=8ggVQ0zPbdicQ_sPqY7KN-TWjaN8nCfTYs5s8qQoMeo,9895
47
41
  atomict/io/utils.py,sha256=ncA8XchNN3lJT8EhJK6tLJE9TvmHmPlxizTnY5ASvEc,272
48
42
  atomict/io/formats/__init__.py,sha256=_wKNHpV0VZKh7mzO6kRfaETYPxg_DYbrJwH4kqduD9Q,300
49
- atomict/io/formats/atraj.py,sha256=2aqS5Gcr_SzE-d-wG9FLr_ckyKFkLHSAqhZUR9cXyR4,3355
50
- atomict/io/formats/tess.py,sha256=tUyMucFgfEQDBWVM1-2yGzpkvNym0v0_RfSxE5H6sW0,21952
51
- atomict/io/formats/traj.py,sha256=AaojyrUzTMiobt2Nhyc7UCjNX1efGnvhV6z1avPtK-4,2273
43
+ atomict/io/formats/atraj.py,sha256=GUw_Ic7N2msD6U2LjjR-qR55ASFdALuDmkYxOmCPGlk,3051
44
+ atomict/io/formats/tess.py,sha256=7ir8kyX0smLkO5kIAxxTYwstE6hoxxuCPocWL7ymc-c,22345
45
+ atomict/io/formats/traj.py,sha256=O5t7cgaqy2mBQ-g833eQxk4dr44Ud9V-Et64OshVsHg,1979
52
46
  atomict/ml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
47
  atomict/ml/model.py,sha256=Ug6IyRNNQ5_SHnQabFHnCCAGTHa9jxrRAUAkBsdcjgo,279
54
48
  atomict/project/__init__.py,sha256=nqVivok-9G0mZr_kOxA-5dsk5p9xPdkUSyNvB-xbveI,23
@@ -62,7 +56,6 @@ atomict/reality/oqmd.py,sha256=nmC6VZb6AGqIj_VcVZxs6ndcefQMcT9xlbYoCylJrbs,103
62
56
  atomict/reality/slabs.py,sha256=7CbVvrbbhbqojJyaZaczXy7AFqkfGTmSOXIOyqYhGJ0,114
63
57
  atomict/simulation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
58
  atomict/simulation/cantera.py,sha256=u9TTa_Zm9CPNSln4V06tyJspr3NiCCCZPW6guuOlb5o,858
65
- atomict/simulation/catalysis.py,sha256=NT7r1qPoYWxVcWQHuAaYWBOprLbZukZLezBHxqIIzRM,565
66
59
  atomict/simulation/counterfactual.py,sha256=8-Kf4wGxPvImDr0j2grmBLLwFQ4JpjhBBxIksIwblIQ,708
67
60
  atomict/simulation/defect.py,sha256=uvYLR_Ng0PFV9A_EE_EgB2SK8jqUpJtvuwLKL02Am3c,691
68
61
  atomict/simulation/ea.py,sha256=bYvYnw59F7QCuV-airnX0Wu8fqZHKlsdywgoK7pwNso,3610
@@ -77,17 +70,17 @@ atomict/simulation/phonon.py,sha256=UG6v-mpfF-STw0DK-620v26Rpc2EzAx4K-8KykzHtm8,
77
70
  atomict/simulation/qe.py,sha256=3PpqpA0Pn3FCGEgjaMnCidguhopGxFUDMaxwfIQF2FE,1700
78
71
  atomict/simulation/sh.py,sha256=YymnH9q8aD_THiielicTKgPGcRunsAcoV5bZKu__L0w,609
79
72
  atomict/simulation/sqs.py,sha256=1neQRVUy21R_UVusML6ocz6RVwxGUVh81CMr2TljGbw,1132
80
- atomict/simulation/utils.py,sha256=V7_Un6pTKUfWtdtTzFuGofDSl9m50b0swEwc7niXlK8,4433
73
+ atomict/simulation/utils.py,sha256=xipTvFC1WOskpMz0b0pNoCM4OjcR9ylhsUCnLGb5Rvg,4443
81
74
  atomict/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
75
  atomict/user/files.py,sha256=eRIxC4OeyTMwF-pu2En82qd5VtA4RM_dA1N1YgbLgZ8,964
83
76
  atomict/user/workspace.py,sha256=ihM9TTaxlQC9HYbL7qKBM6PdNRUFZn1EZRUd6CuTXlI,3921
84
77
  atomict/utils/tenacity.py,sha256=phc6YPEk7idqiFFeHeK-ngiAaqVOZFYp8S7dX1k-YXc,998
85
78
  atomict/utils/traj.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
79
  atomict/utils/fhiaims/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- atomict/utils/fhiaims/geometry.py,sha256=3Ap6gO7UsLFXBl9Ohv8Vmfpvwu0fohpzgdxOFGg6Tmc,2281
88
- atomict-1.2.23.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
89
- atomict-1.2.23.dist-info/METADATA,sha256=IAXk_IZpC7wP9n9A5HqB_4QxjcIM6YuTG5J-0U4WybQ,3359
90
- atomict-1.2.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
- atomict-1.2.23.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
92
- atomict-1.2.23.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
93
- atomict-1.2.23.dist-info/RECORD,,
80
+ atomict/utils/fhiaims/geometry.py,sha256=Dr8g-xTqiH5tTFncn1wZmSnbetvvDylgxL3LldtdFD0,2022
81
+ atomict-1.2.24.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
82
+ atomict-1.2.24.dist-info/METADATA,sha256=3Mb-XYJVCrYn1T3MEh9KZFoM_4P1T34Ma-knyN-jO_o,2938
83
+ atomict-1.2.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
84
+ atomict-1.2.24.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
85
+ atomict-1.2.24.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
86
+ atomict-1.2.24.dist-info/RECORD,,
@@ -1,183 +0,0 @@
1
- # cli/commands/adsorbate.py
2
- from typing import Optional, Tuple
3
-
4
- import click
5
- from rich.console import Console
6
- from rich.panel import Panel
7
-
8
- from atomict.cli.commands.common import create_table
9
- from atomict.cli.core.client import get_client
10
- from atomict.cli.core.utils import get_pagination_info
11
-
12
- console = Console()
13
-
14
-
15
- @click.group(name="adsorbate")
16
- def adsorbate_group():
17
- """Manage adsorbates"""
18
- pass
19
-
20
-
21
- @adsorbate_group.command()
22
- @click.argument("id", required=False)
23
- @click.option("--json-output", is_flag=True, help="Output in JSON format")
24
- @click.option("--search", help="Search term")
25
- @click.option("--filter", "filters", multiple=True, help="Filter in format field=value")
26
- @click.option("--ordering", help="Field to order by (prefix with - for descending)")
27
- @click.option(
28
- "--all",
29
- "fetch_all",
30
- is_flag=True,
31
- help="Fetch all results (otherwise returns first page)",
32
- )
33
- def get(
34
- id: Optional[str],
35
- search: Optional[str] = None,
36
- filters: Optional[Tuple] = None, # Fixed syntax error and moved default value
37
- ordering: Optional[str] = None,
38
- fetch_all: bool = False,
39
- json_output: bool = False,
40
- ):
41
- """List adsorbates with optional filtering and search"""
42
- client = get_client()
43
-
44
- if id:
45
- result = client.get(f"/api/adsorbate/{id}/")
46
- if json_output:
47
- console.print_json(data=result)
48
- return
49
-
50
- console.print(Panel("[bold]Adsorbate Details[/bold]"))
51
- console.print(f"ID: {result['id']}")
52
- # Add other relevant fields
53
- else:
54
- # Build query parameters
55
- params = {}
56
- if search:
57
- params["search"] = search
58
- if ordering:
59
- params["ordering"] = ordering
60
- if filters:
61
- for f in filters:
62
- try:
63
- key, value = f.split("=")
64
- params[key] = value
65
- except ValueError:
66
- click.echo(
67
- f"[red]Invalid filter format: {f}. Use field=value[/red]",
68
- err=True,
69
- )
70
- return
71
-
72
- if fetch_all:
73
- # Get all results using the paginate method
74
- results = client.get_all("/api/adsorbate/", params=params)
75
- else:
76
- # Get just the first page
77
- results = client.get("/api/adsorbate/", params=params)
78
-
79
- if json_output:
80
- console.print_json(data=results)
81
- return
82
-
83
- # Define columns with optional formatters
84
- columns = [
85
- ("ID", "id", None), # Using default str formatter
86
- ("SMILES", "smiles", None),
87
- ("Binding Indices", "binding_indices", None),
88
- ("Reaction String", "reaction_string", None),
89
- ]
90
- items, footer_string = get_pagination_info(results)
91
- # Create and display the table
92
- table = create_table(
93
- columns=columns, items=items, title="Adsorbates", caption=footer_string
94
- )
95
-
96
- console.print(table)
97
-
98
-
99
- @adsorbate_group.command()
100
- @click.option("--ase-atoms", required=True, help="ASE atoms string representation")
101
- @click.option("--smiles", help="SMILES string representation of the molecule")
102
- @click.option(
103
- "--binding-indices",
104
- multiple=True,
105
- type=int,
106
- help="Binding atom indices (can be specified multiple times)",
107
- )
108
- @click.option("--reaction-string", help="Reaction string representation")
109
- def create(
110
- ase_atoms: Optional[str] = None,
111
- smiles: Optional[str] = None,
112
- binding_indices: Optional[tuple[int, ...]] = None,
113
- reaction_string: Optional[str] = None,
114
- ):
115
- """
116
- Create a new adsorbate.
117
-
118
- Examples:
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
- """
122
- client = get_client()
123
-
124
- data = {
125
- "ase_atoms": ase_atoms, # this needs work on the server side
126
- "smiles": smiles,
127
- "binding_indices": list(binding_indices) if binding_indices else None,
128
- "reaction_string": reaction_string,
129
- }
130
- data = {k: v for k, v in data.items() if v is not None}
131
-
132
- result = client.post("/api/adsorbate/", data)
133
- console.print(f"[green]Created adsorbate {result['id']}[/green]")
134
-
135
-
136
- @adsorbate_group.command()
137
- @click.argument("id")
138
- @click.option("--ase-atoms", help="ASE atoms string representation")
139
- @click.option("--smiles", help="SMILES string representation of the molecule")
140
- @click.option(
141
- "--binding-indices",
142
- multiple=True,
143
- type=int,
144
- help="Binding atom indices (can be specified multiple times)",
145
- )
146
- @click.option("--reaction-string", help="Reaction string representation")
147
- def update(
148
- id: str,
149
- ase_atoms: Optional[str] = None,
150
- smiles: Optional[str] = None,
151
- binding_indices: Optional[tuple[int, ...]] = None,
152
- reaction_string: Optional[str] = None,
153
- ):
154
- """
155
- Update an existing adsorbate.
156
-
157
- Examples:
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
- """
161
- client = get_client()
162
-
163
- # Build update data excluding None values
164
- data = {
165
- "ase_atoms": ase_atoms,
166
- "smiles": smiles,
167
- "binding_indices": list(binding_indices) if binding_indices else None,
168
- "reaction_string": reaction_string,
169
- }
170
- data = {k: v for k, v in data.items() if v is not None}
171
-
172
- result = client.put(f"/api/adsorbate/{id}/", data)
173
- console.print(f"[green]Updated adsorbate {result['id']}[/green]")
174
-
175
-
176
- @adsorbate_group.command()
177
- @click.argument("id")
178
- def delete(id: str):
179
- """Delete an adsorbate"""
180
- client = get_client()
181
-
182
- client.delete(f"/api/adsorbate/{id}/")
183
- console.print(f"[green]Deleted adsorbate {id}[/green]")
@@ -1,171 +0,0 @@
1
- # cli/commands/exploration.py
2
- from typing import Optional, Tuple
3
-
4
- import click
5
- from rich.console import Console
6
- from rich.panel import Panel
7
-
8
- from atomict.cli.commands.common import create_table
9
- from atomict.cli.commands.helpers import format_datetime, get_status_string
10
- from atomict.cli.core.client import get_client
11
- from atomict.cli.core.utils import get_pagination_info
12
-
13
-
14
- @click.group(name="catalysis")
15
- def catalysis_group():
16
- """Manage catalysis explorations"""
17
- pass
18
-
19
-
20
- @catalysis_group.command()
21
- @click.argument("id", required=False)
22
- @click.option("--search", help="Search term")
23
- @click.option("--ordering", help="Field to order results by")
24
- @click.option("--filter", "filters", multiple=True, help="Filter in format field=value")
25
- @click.option("--json-output", is_flag=True, help="Output in JSON format")
26
- @click.option("--all", "fetch_all", is_flag=True, help="Fetch all results")
27
- def get(
28
- id: Optional[str] = None,
29
- search: Optional[str] = None,
30
- ordering: Optional[str] = None,
31
- filters: tuple = (),
32
- json_output: bool = False,
33
- fetch_all: bool = False,
34
- ):
35
- """Get catalysis exploration details or list all explorations"""
36
- # WIP
37
- client = get_client()
38
- console = Console()
39
-
40
- if id:
41
- result = client.get(f"/api/catalysis-exploration/{id}/")
42
- if json_output:
43
- console.print_json(data=result)
44
- return
45
-
46
- console.print(Panel.fit(f"[bold]Catalysis Exploration Details[/bold]"))
47
- console.print(f"ID: {result['id']}")
48
- console.print(f"Name: {result.get('name', 'N/A')}")
49
- console.print(f"Created: {format_datetime(result.get('created_at'))}")
50
- console.print(f"Status: {get_status_string(result.get('status', 'N/A'))}")
51
-
52
- if result.get("target_concentrations"):
53
- console.print("\n[bold]Target Concentrations[/bold]")
54
- columns = [
55
- ("Element", "element", None),
56
- ("Weight", "weight", None),
57
- ]
58
-
59
- table = create_table(
60
- columns=columns,
61
- items=result["target_concentrations"],
62
- title="Target Concentrations",
63
- )
64
- console.print(table)
65
-
66
- if result.get("results"):
67
- console.print("\n[bold]Exploration Results[/bold]")
68
- columns = [
69
- ("Structure ID", "id", None),
70
- ("Energy", "energy", lambda x: str(x) if x is not None else "N/A"),
71
- ("Status", "status", get_status_string),
72
- ]
73
-
74
- table = create_table(
75
- columns=columns, items=result["results"], title="Results"
76
- )
77
- console.print(table)
78
- else:
79
- params = {}
80
- if search is not None:
81
- params["search"] = search
82
- if ordering:
83
- params["ordering"] = ordering
84
-
85
- for f in filters:
86
- try:
87
- field, value = f.split("=", 1)
88
- params[field] = value
89
- except ValueError:
90
- click.echo(
91
- f"[red]Invalid filter format: {f}. Use field=value[/red]", err=True
92
- )
93
- return
94
-
95
- if fetch_all:
96
- results = client.get_all("/api/catalysis-exploration/", params=params)
97
- else:
98
- results = client.get("/api/catalysis-exploration/", params=params)
99
-
100
- if json_output:
101
- console.print_json(data=results)
102
- return
103
-
104
- columns = [
105
- ("ID", "id", None),
106
- ("Name", "name", None),
107
- ("Status", "status", get_status_string),
108
- ("Created", "created_at", format_datetime),
109
- ]
110
-
111
- items, footer_string = get_pagination_info(results)
112
-
113
- if not items:
114
- console.print(
115
- f"[white]No catalysis explorations found with the given criteria:[/white]\n[green]{params}"
116
- )
117
- return
118
-
119
- table = create_table(
120
- columns=columns,
121
- items=items,
122
- title="Catalysis Explorations",
123
- caption=footer_string,
124
- )
125
-
126
- console.print(table)
127
-
128
-
129
- @catalysis_group.command()
130
- @click.option("--name", required=True, help="Name of the exploration")
131
- @click.option("--structure", required=True, help="Starting structure ID")
132
- @click.option("--project", required=True, help="Project ID")
133
- @click.option("--element", "elements", multiple=True, help="Target elements")
134
- @click.option("--weight", "weights", multiple=True, type=float, help="Target weights")
135
- @click.option("--json-output", is_flag=True, help="Output in JSON format")
136
- def create(
137
- name: str,
138
- structure: str,
139
- project: str,
140
- elements: Tuple[str],
141
- weights: Tuple[float],
142
- json_output: bool = False,
143
- ):
144
- """Create a new catalysis exploration"""
145
- client = get_client()
146
- console = Console()
147
-
148
- if len(elements) != len(weights):
149
- console.print(
150
- "[red]Error: Number of elements must match number of weights[/red]"
151
- )
152
- return
153
-
154
- data = {
155
- "name": name,
156
- "starting_structure": structure,
157
- "project": project,
158
- "target_concentrations": [
159
- {"element": elem, "weight": weight}
160
- for elem, weight in zip(elements, weights)
161
- ],
162
- }
163
-
164
- result = client.post("/api/catalysis-exploration/", data)
165
-
166
- if json_output:
167
- console.print_json(data=result)
168
- else:
169
- console.print(
170
- f"[green]Created catalysis exploration with ID: {result['id']}[/green]"
171
- )
@@ -1,20 +0,0 @@
1
- # cli/commands/simulation/__init__.py
2
- import click
3
-
4
- from . import catalysis, fhiaims # qe,; phonon,; kpoint,
5
-
6
-
7
- @click.group(name="simulation")
8
- def simulation_group():
9
- """Manage all types of simulations"""
10
- pass
11
-
12
-
13
- # Add simulation type subcommands
14
- simulation_group.add_command(catalysis.catalysis)
15
- # simulation_group.add_command(qe.qe)
16
- simulation_group.add_command(fhiaims.fhiaims_group)
17
- # simulation_group.add_command(phonon.phonon)
18
- # simulation_group.add_command(kpoint.kpoint)
19
-
20
- simulation = simulation_group