atomict 1.2.24__tar.gz → 1.2.25__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-1.2.24 → atomict-1.2.25}/PKG-INFO +1 -1
  2. atomict-1.2.25/atomict/__version__.py +1 -0
  3. atomict-1.2.25/atomict/cli/commands/workspace.py +117 -0
  4. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/main.py +2 -1
  5. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/trajectory.py +19 -1
  6. {atomict-1.2.24 → atomict-1.2.25}/atomict.egg-info/PKG-INFO +1 -1
  7. {atomict-1.2.24 → atomict-1.2.25}/atomict.egg-info/SOURCES.txt +1 -0
  8. atomict-1.2.24/atomict/__version__.py +0 -1
  9. {atomict-1.2.24 → atomict-1.2.25}/LICENSE +0 -0
  10. {atomict-1.2.24 → atomict-1.2.25}/README.md +0 -0
  11. {atomict-1.2.24 → atomict-1.2.25}/atomict/__init__.py +0 -0
  12. {atomict-1.2.24 → atomict-1.2.25}/atomict/api.py +0 -0
  13. {atomict-1.2.24 → atomict-1.2.25}/atomict/ase/atatoms.py +0 -0
  14. {atomict-1.2.24 → atomict-1.2.25}/atomict/auth.py +0 -0
  15. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/__init__.py +0 -0
  16. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/ai_assist.py +0 -0
  17. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/common.py +0 -0
  18. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/convert.py +0 -0
  19. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/exploration/__init__.py +0 -0
  20. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/exploration/soec.py +0 -0
  21. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/exploration/sqs.py +0 -0
  22. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/helpers.py +0 -0
  23. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/k8s.py +0 -0
  24. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/login.py +0 -0
  25. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/organization.py +0 -0
  26. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/project.py +0 -0
  27. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/simulation/fhiaims.py +0 -0
  28. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/simulation/kpoint.py +0 -0
  29. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/task.py +0 -0
  30. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/token.py +0 -0
  31. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/traj.py +0 -0
  32. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/upload.py +0 -0
  33. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/commands/user.py +0 -0
  34. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/core/client.py +0 -0
  35. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/core/config.py +0 -0
  36. {atomict-1.2.24 → atomict-1.2.25}/atomict/cli/core/utils.py +0 -0
  37. {atomict-1.2.24 → atomict-1.2.25}/atomict/env.py +0 -0
  38. {atomict-1.2.24 → atomict-1.2.25}/atomict/exceptions.py +0 -0
  39. {atomict-1.2.24 → atomict-1.2.25}/atomict/infra/__init__.py +0 -0
  40. {atomict-1.2.24 → atomict-1.2.25}/atomict/infra/distwork/__init__.py +0 -0
  41. {atomict-1.2.24 → atomict-1.2.25}/atomict/infra/distwork/environment.py +0 -0
  42. {atomict-1.2.24 → atomict-1.2.25}/atomict/infra/distwork/task.py +0 -0
  43. {atomict-1.2.24 → atomict-1.2.25}/atomict/infra/logging.py +0 -0
  44. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/__init__.py +0 -0
  45. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/atoms.py +0 -0
  46. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/cif.py +0 -0
  47. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/fhiaims.py +0 -0
  48. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/formats/__init__.py +0 -0
  49. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/formats/atraj.py +0 -0
  50. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/formats/tess.py +0 -0
  51. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/formats/traj.py +0 -0
  52. {atomict-1.2.24 → atomict-1.2.25}/atomict/io/utils.py +0 -0
  53. {atomict-1.2.24 → atomict-1.2.25}/atomict/ml/__init__.py +0 -0
  54. {atomict-1.2.24 → atomict-1.2.25}/atomict/ml/model.py +0 -0
  55. {atomict-1.2.24 → atomict-1.2.25}/atomict/project/__init__.py +0 -0
  56. {atomict-1.2.24 → atomict-1.2.25}/atomict/project/link.py +0 -0
  57. {atomict-1.2.24 → atomict-1.2.25}/atomict/project/note.py +0 -0
  58. {atomict-1.2.24 → atomict-1.2.25}/atomict/project/project.py +0 -0
  59. {atomict-1.2.24 → atomict-1.2.25}/atomict/project/tags.py +0 -0
  60. {atomict-1.2.24 → atomict-1.2.25}/atomict/project/workbench.py +0 -0
  61. {atomict-1.2.24 → atomict-1.2.25}/atomict/reality/__init__.py +0 -0
  62. {atomict-1.2.24 → atomict-1.2.25}/atomict/reality/oqmd.py +0 -0
  63. {atomict-1.2.24 → atomict-1.2.25}/atomict/reality/slabs.py +0 -0
  64. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/__init__.py +0 -0
  65. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/cantera.py +0 -0
  66. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/counterfactual.py +0 -0
  67. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/defect.py +0 -0
  68. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/ea.py +0 -0
  69. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/fhi_aims.py +0 -0
  70. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/impact.py +0 -0
  71. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/kpoint.py +0 -0
  72. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/mattergen.py +0 -0
  73. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/md.py +0 -0
  74. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/mlrelax.py +0 -0
  75. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/models.py +0 -0
  76. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/phonon.py +0 -0
  77. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/qe.py +0 -0
  78. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/sh.py +0 -0
  79. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/sqs.py +0 -0
  80. {atomict-1.2.24 → atomict-1.2.25}/atomict/simulation/utils.py +0 -0
  81. {atomict-1.2.24 → atomict-1.2.25}/atomict/user/__init__.py +0 -0
  82. {atomict-1.2.24 → atomict-1.2.25}/atomict/user/files.py +0 -0
  83. {atomict-1.2.24 → atomict-1.2.25}/atomict/user/workspace.py +0 -0
  84. {atomict-1.2.24 → atomict-1.2.25}/atomict/utils/fhiaims/__init__.py +0 -0
  85. {atomict-1.2.24 → atomict-1.2.25}/atomict/utils/fhiaims/geometry.py +0 -0
  86. {atomict-1.2.24 → atomict-1.2.25}/atomict/utils/tenacity.py +0 -0
  87. {atomict-1.2.24 → atomict-1.2.25}/atomict/utils/traj.py +0 -0
  88. {atomict-1.2.24 → atomict-1.2.25}/atomict.egg-info/dependency_links.txt +0 -0
  89. {atomict-1.2.24 → atomict-1.2.25}/atomict.egg-info/entry_points.txt +0 -0
  90. {atomict-1.2.24 → atomict-1.2.25}/atomict.egg-info/requires.txt +0 -0
  91. {atomict-1.2.24 → atomict-1.2.25}/atomict.egg-info/top_level.txt +0 -0
  92. {atomict-1.2.24 → atomict-1.2.25}/pyproject.toml +0 -0
  93. {atomict-1.2.24 → atomict-1.2.25}/requirements.txt +0 -0
  94. {atomict-1.2.24 → atomict-1.2.25}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 1.2.24
3
+ Version: 1.2.25
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
@@ -0,0 +1 @@
1
+ __version__ = "1.2.25"
@@ -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
+
@@ -7,7 +7,7 @@ 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
10
+ from atomict.cli.commands import login, token, user, workspace
11
11
  from .commands import k8s, project, task, traj, upload, convert
12
12
  from .commands.exploration import soec, sqs
13
13
  from .commands.simulation import fhiaims, kpoint
@@ -101,6 +101,7 @@ cli.add_command(sqs.sqs_group)
101
101
  cli.add_command(soec.soecexploration_group)
102
102
  cli.add_command(traj.traj)
103
103
  cli.add_command(user.user_group)
104
+ cli.add_command(workspace.workspace_group)
104
105
  cli.add_command(login._login)
105
106
  cli.add_command(token._token)
106
107
 
@@ -123,7 +123,25 @@ class TrajectoryWriter:
123
123
  raise TypeError('Unsupported atoms-like object; expected ASE Atoms or compatible wrapper')
124
124
  plain = Atoms(numbers=numbers, positions=positions, cell=cell, pbc=pbc)
125
125
  # Make a copy to avoid all frames pointing to the same object after in-place modifications
126
- self._buffer.append(plain.copy())
126
+ copied = plain.copy()
127
+
128
+ # Preserve calculator results using SinglePointCalculator
129
+ # (ASE's Atoms.copy() intentionally does not copy the calculator)
130
+ if plain.calc is not None:
131
+ from ase.calculators.singlepoint import SinglePointCalculator
132
+
133
+ results = {}
134
+ for prop in ['energy', 'forces', 'stress', 'dipole', 'charges', 'magmom', 'magmoms']:
135
+ try:
136
+ val = plain.calc.get_property(prop, plain, allow_calculation=False)
137
+ if val is not None:
138
+ results[prop] = val
139
+ except Exception:
140
+ pass
141
+ if results:
142
+ copied.calc = SinglePointCalculator(copied, **results)
143
+
144
+ self._buffer.append(copied)
127
145
 
128
146
  def close(self) -> None:
129
147
  """Flush buffered frames and/or close backend."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 1.2.24
3
+ Version: 1.2.25
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
@@ -30,6 +30,7 @@ atomict/cli/commands/token.py
30
30
  atomict/cli/commands/traj.py
31
31
  atomict/cli/commands/upload.py
32
32
  atomict/cli/commands/user.py
33
+ atomict/cli/commands/workspace.py
33
34
  atomict/cli/commands/exploration/__init__.py
34
35
  atomict/cli/commands/exploration/soec.py
35
36
  atomict/cli/commands/exploration/sqs.py
@@ -1 +0,0 @@
1
- __version__ = "1.2.24"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes