atomict 1.2.19__py3-none-any.whl → 1.2.20__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
atomict/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.19"
1
+ __version__ = "1.2.20"
atomict/io/atoms.py CHANGED
@@ -1,10 +1,11 @@
1
+ from typing import List
1
2
  import numpy as np
2
3
  from ase import Atoms
3
4
  from ase.constraints import dict2constraint
4
5
  from ase.calculators.singlepoint import SinglePointCalculator
5
6
 
6
7
 
7
- def atoms_to_dict(atoms_list, selective=False):
8
+ def atoms_to_dict(atoms_list: List[Atoms], selective: bool = False):
8
9
  """Extract all properties from ASE Atoms objects into a standardized dictionary.
9
10
 
10
11
  Parameters:
@@ -0,0 +1,15 @@
1
+ from atomict.io.formats.atraj import (
2
+ read_atraj,
3
+ write_atraj,
4
+ )
5
+ from atomict.io.formats.tess import (
6
+ read_tess,
7
+ write_tess,
8
+ )
9
+ from atomict.io.formats.traj import (
10
+ read_traj,
11
+ write_traj,
12
+ )
13
+
14
+
15
+ __all__ = [read_atraj, write_atraj, read_tess, write_tess, read_traj, write_traj]
@@ -8,14 +8,14 @@ if TYPE_CHECKING:
8
8
  def write_atraj(atoms: Union['ase.Atoms', List['ase.Atoms']], filename: str, metadata: Dict = None):
9
9
  """Save atoms to a mpv1 file."""
10
10
 
11
- from atomict.io.msgpack import atoms_to_dict
11
+ from atomict.io.atoms import atoms_to_dict
12
12
 
13
13
  try:
14
14
  import msgpack
15
15
  import msgpack_numpy as m
16
16
  from ase import Atoms
17
17
  except ImportError:
18
- raise ImportError("You need to install with `pip install atomict[utils]` to use msgpack I/O")
18
+ raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
19
19
 
20
20
  # Enable numpy array serialization
21
21
  m.patch()
@@ -46,13 +46,13 @@ def write_atraj(atoms: Union['ase.Atoms', List['ase.Atoms']], filename: str, met
46
46
  def read_atraj(filename: str) -> Union['ase.Atoms', List['ase.Atoms']]:
47
47
 
48
48
  """Load atoms from a mpv1 file."""
49
- from atomict.io.msgpack import dict_to_atoms
49
+ from atomict.io.atoms import dict_to_atoms
50
50
 
51
51
  try:
52
52
  import msgpack
53
53
  import msgpack_numpy as m
54
54
  except ImportError:
55
- raise ImportError("You need to install with `pip install atomict[utils]` to use msgpack I/O")
55
+ raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
56
56
 
57
57
  # Enable numpy array deserialization
58
58
  m.patch()
@@ -31,7 +31,7 @@ def write_tess(
31
31
  import lz4.block
32
32
  import numpy as np
33
33
  except ImportError:
34
- raise ImportError("You need to install with `pip install atomict[utils]` to use msgpack I/O")
34
+ raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
35
35
 
36
36
  # Enable numpy array serialization
37
37
  m.patch()
@@ -164,7 +164,7 @@ def read_tess(filename: str, frames_indices: Optional[List[int]] = None) -> Tupl
164
164
  import zlib
165
165
  import lz4.block
166
166
  except ImportError:
167
- raise ImportError("You need to install with `pip install atomict[utils]` to use msgpack I/O")
167
+ raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
168
168
 
169
169
  # Enable numpy array deserialization
170
170
  m.patch()
@@ -19,7 +19,7 @@ def write_traj(atoms: Union['ase.Atoms', List['ase.Atoms']], filename: str, meta
19
19
  from ase.io.trajectory import TrajectoryWriter
20
20
  from ase import Atoms
21
21
  except ImportError:
22
- raise ImportError("You need to install ASE to use trajectory I/O")
22
+ raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
23
23
 
24
24
  # Single atoms case - convert to list
25
25
  if isinstance(atoms, Atoms):
@@ -46,7 +46,7 @@ def read_traj(filename: str) -> tuple[List['ase.Atoms'], Dict]:
46
46
  try:
47
47
  from ase.io.trajectory import TrajectoryReader
48
48
  except ImportError:
49
- raise ImportError("You need to install ASE to use trajectory I/O")
49
+ raise ImportError("You need to install with `pip install atomict[utils]` to use the newer formats")
50
50
 
51
51
  atoms_list = []
52
52
  metadata = {}
@@ -65,26 +65,6 @@ def create_mlrelaxation(
65
65
  "Invalid computation type. Please use atomict.simulation.mlrelax.COMPUTATION_TYPE_RELAXATION or atomict.simulation.mlrelax.COMPUTATION_TYPE_SINGLE_POINT."
66
66
  )
67
67
 
68
- # backwards compat
69
- if calculator:
70
- if calculator not in [
71
- MODEL_ORB_V3_CONSERVATIVE,
72
- MODEL_ESEN_30M_OAM,
73
- MODEL_UMA
74
- ]:
75
- raise ValueError(
76
- "Invalid model. Please use atomict.simulation.models.MODEL_ORB_V3_CONSERVATIVE, or atomict.simulation.models.MODEL_ESEN_30M_OAM, or atomict.simulation.models.MODEL_UMA."
77
- )
78
-
79
- else:
80
- if model not in [
81
- MODEL_ORB_V3_CONSERVATIVE,
82
- MODEL_ESEN_30M_OAM,
83
- ]:
84
- raise ValueError(
85
- "Invalid model. Please use atomict.simulation.models.MODEL_ORB_V3_CONSERVATIVE, or atomict.simulation.models.MODEL_ESEN_30M_OAM, or atomict.simulation.models.MODEL_UMA."
86
- )
87
-
88
68
  payload = {
89
69
  "project": project_id,
90
70
  "source_geometry_id": source_geometry_id,
@@ -95,11 +75,12 @@ def create_mlrelaxation(
95
75
  "f_max": f_max,
96
76
  }
97
77
 
98
- # backwards compat
99
- if calculator:
78
+ # backwards compat - accept 'model' param but always send 'calculator' to API
79
+ # (model field was renamed to calculator in the backend)
80
+ if calculator is not None:
100
81
  payload["calculator"] = calculator
101
82
  else:
102
- payload["model"] = model
83
+ payload["calculator"] = model
103
84
 
104
85
  if extra_simulation_kwargs:
105
86
  payload.update(extra_simulation_kwargs)
@@ -64,9 +64,6 @@ def create_phonon_run(project_id: str, source_geometry_id: str, action: str, nam
64
64
  name: str - The name of the Phonon Run
65
65
  """
66
66
 
67
- if model not in [MODEL_ORB_D3_V2, MODEL_MATTERSIM_1_0_0_5M, MODEL_ORB_V3_CONSERVATIVE, MODEL_ESEN_30M_OAM]:
68
- raise ValueError(f"Invalid model: {model}")
69
-
70
67
  if action not in ["LAUNCH", "DRAFT"]:
71
68
  raise ValueError(f"Invalid action: {action} (must be 'LAUNCH' or 'DRAFT')")
72
69
 
@@ -10,7 +10,8 @@ except ImportError:
10
10
  import logging
11
11
  import os
12
12
 
13
- from atomict.io.msgpack import load_msgpack_trajectory
13
+ # from atomict.io.msgpack import load_msgpack_trajectory
14
+ from atomict.io.formats.atraj import read_atraj
14
15
  from atomict.io.fhiaims import read_aims_output
15
16
  from atomict.io.utils import human_filesize
16
17
  from atomict.simulation.mlrelax import get_mlrelax, get_mlrelax_files
@@ -28,7 +29,7 @@ def fetch_source_geometry(sim: dict, workbench_dir: str) -> Atoms:
28
29
  download_file(sim["source_geometry"]["id"], workbench_dir + f"/geometry.{extension}")
29
30
 
30
31
  if extension == "atraj":
31
- atoms, _ = load_msgpack_trajectory(workbench_dir + f"/geometry.{extension}")
32
+ atoms, _ = read_atraj(workbench_dir + f"/geometry.{extension}")
32
33
  else:
33
34
  atoms = read(workbench_dir + f"/geometry.{extension}")
34
35
 
@@ -93,7 +94,7 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str) -> Atoms:
93
94
  atraj_file = os.path.join(mlrelax_dir, "relax.atraj")
94
95
 
95
96
  if os.path.exists(atraj_file):
96
- atoms, _ = load_msgpack_trajectory(atraj_file)
97
+ atoms, _ = read_atraj(atraj_file)
97
98
  else:
98
99
  atoms = read(traj_file)
99
100
 
@@ -110,7 +111,7 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str) -> Atoms:
110
111
  download_file(sim["starting_structure_userupload"]["id"], workbench_dir + f"/geometry.{extension}")
111
112
 
112
113
  if extension == "atraj":
113
- atoms, _ = load_msgpack_trajectory(workbench_dir + f"/geometry.{extension}")
114
+ atoms, _ = read_atraj(workbench_dir + f"/geometry.{extension}")
114
115
  else:
115
116
  atoms = read(workbench_dir + f"/geometry.{extension}")
116
117
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 1.2.19
3
+ Version: 1.2.20
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
@@ -124,3 +124,4 @@ Tab completion is available. Run the hidden command:
124
124
  ```tess completion```
125
125
 
126
126
  This will print out the instructions for enabling tab completion for your shell.
127
+
@@ -1,5 +1,5 @@
1
1
  atomict/__init__.py,sha256=nMXg9GFsk8gCcyBnh1MAeUPvo4Zcuv3sdwGHZrxfpPE,36
2
- atomict/__version__.py,sha256=vBqPpUxy9sFZkDmAAvQCrIqAA_ye7foz7jV5SkuJi0I,23
2
+ atomict/__version__.py,sha256=nQtXpLTEUbMtAPecTV_hZAJZb9EhWc8glRv6hgKyvG4,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
@@ -40,13 +40,14 @@ atomict/infra/distwork/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
40
40
  atomict/infra/distwork/environment.py,sha256=joydS9wA2pgWafXh_Wqgg95InaxhsusohaeWc9IOgwA,909
41
41
  atomict/infra/distwork/task.py,sha256=kflMllczaUQHDa8AAUTsLi5RJivckr1LKHAUZwqIKio,1182
42
42
  atomict/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- atomict/io/atoms.py,sha256=VrxqqQ2OWzjRBoNJz7kYij4ehJzAeDnmVyoYufYOr10,13099
43
+ atomict/io/atoms.py,sha256=kdMnto7eyiY2zmoOvLlzbuTGUCIp4ViQGwLmf2m9fGU,13144
44
44
  atomict/io/cif.py,sha256=o7oe6alug5ais2QnJhv88X7sAbZSbTkEWhHa-4Dkw1E,6040
45
45
  atomict/io/fhiaims.py,sha256=4Z5oImjZuP-k8AudrMrXqvsO0IHajDy__h5NmLr1LGY,1197
46
46
  atomict/io/utils.py,sha256=ncA8XchNN3lJT8EhJK6tLJE9TvmHmPlxizTnY5ASvEc,272
47
- atomict/io/formats/atraj.py,sha256=UpkDEbzsL4-4Mdbopk4uVnYuIGR9A4gtFhUZTVE_ZHk,3347
48
- atomict/io/formats/tess.py,sha256=-AqsA-YUtHLs8-AlSavkjBF1JhHxmeYeUz37ewEIi_Q,14032
49
- atomict/io/formats/traj.py,sha256=vrvSoJGVxB0WIueGCPOK7nBPB48P-i9AD_oPlTPdWvk,2207
47
+ atomict/io/formats/__init__.py,sha256=_wKNHpV0VZKh7mzO6kRfaETYPxg_DYbrJwH4kqduD9Q,300
48
+ atomict/io/formats/atraj.py,sha256=2aqS5Gcr_SzE-d-wG9FLr_ckyKFkLHSAqhZUR9cXyR4,3355
49
+ atomict/io/formats/tess.py,sha256=frQYIdNWE8NQL19F6BWV_lW6nJ9WwMX-yBrx_xmtSUA,14044
50
+ atomict/io/formats/traj.py,sha256=AaojyrUzTMiobt2Nhyc7UCjNX1efGnvhV6z1avPtK-4,2273
50
51
  atomict/ml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
52
  atomict/ml/model.py,sha256=Ug6IyRNNQ5_SHnQabFHnCCAGTHa9jxrRAUAkBsdcjgo,279
52
53
  atomict/project/__init__.py,sha256=nqVivok-9G0mZr_kOxA-5dsk5p9xPdkUSyNvB-xbveI,23
@@ -69,13 +70,13 @@ atomict/simulation/impact.py,sha256=b5RL--cFeg6gPtxN5xwX_M4LkvYn_lRLi1OWz-uimPA,
69
70
  atomict/simulation/kpoint.py,sha256=8Dc1F9xqubK1HBCQa7GeRtIhs28302sRnuUK0Rns9Q4,1739
70
71
  atomict/simulation/mattergen.py,sha256=ybzJy0nwIAZhG8IIuhlmi-_J6lLyci3aVo35h2ni_w0,488
71
72
  atomict/simulation/md.py,sha256=C32Sh2sv9PQ1lyGaWYFmG5evKk3Jqw0wel2ml4uPnJw,770
72
- atomict/simulation/mlrelax.py,sha256=k-78fl9135VmuTP5viQIlvHGxnws41EltveHvlms3bY,3461
73
+ atomict/simulation/mlrelax.py,sha256=ZS9WoO9efHeSNXM-MxuqQMSWN54qDKLscBgxL4monfI,2841
73
74
  atomict/simulation/models.py,sha256=RSVLldNurx7F-ijlrLuVyljMS06bsZCBFMXNcdzdOuU,115
74
- atomict/simulation/phonon.py,sha256=_roteuXyV8KmlwGW1jnidSY6xu_3ReNhLtYGL0OdS8Q,2950
75
+ atomict/simulation/phonon.py,sha256=Mmk0LveKHGkw0Jo7GJCphKXsxbZCFZE9tKRkGGwNcUs,2785
75
76
  atomict/simulation/qe.py,sha256=3PpqpA0Pn3FCGEgjaMnCidguhopGxFUDMaxwfIQF2FE,1700
76
77
  atomict/simulation/sh.py,sha256=YymnH9q8aD_THiielicTKgPGcRunsAcoV5bZKu__L0w,609
77
78
  atomict/simulation/sqs.py,sha256=1neQRVUy21R_UVusML6ocz6RVwxGUVh81CMr2TljGbw,1132
78
- atomict/simulation/utils.py,sha256=LLWzQPdohbkLOZvbF8r5paICCY1canfUeiR4XgKEQCE,4422
79
+ atomict/simulation/utils.py,sha256=V7_Un6pTKUfWtdtTzFuGofDSl9m50b0swEwc7niXlK8,4433
79
80
  atomict/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
81
  atomict/user/files.py,sha256=eRIxC4OeyTMwF-pu2En82qd5VtA4RM_dA1N1YgbLgZ8,964
81
82
  atomict/user/workspace.py,sha256=ihM9TTaxlQC9HYbL7qKBM6PdNRUFZn1EZRUd6CuTXlI,3921
@@ -83,9 +84,9 @@ atomict/utils/tenacity.py,sha256=phc6YPEk7idqiFFeHeK-ngiAaqVOZFYp8S7dX1k-YXc,998
83
84
  atomict/utils/traj.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
85
  atomict/utils/fhiaims/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
86
  atomict/utils/fhiaims/geometry.py,sha256=3Ap6gO7UsLFXBl9Ohv8Vmfpvwu0fohpzgdxOFGg6Tmc,2281
86
- atomict-1.2.19.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
87
- atomict-1.2.19.dist-info/METADATA,sha256=MqPvH4s1jZALsphh7wI4hq8Y_zd1vw5umkyrTTruUvI,3358
88
- atomict-1.2.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
89
- atomict-1.2.19.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
90
- atomict-1.2.19.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
91
- atomict-1.2.19.dist-info/RECORD,,
87
+ atomict-1.2.20.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
88
+ atomict-1.2.20.dist-info/METADATA,sha256=Sk30hOT87B04NfvZjw-rYasA_Xkf03tA_swSWn2aH3A,3359
89
+ atomict-1.2.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
90
+ atomict-1.2.20.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
91
+ atomict-1.2.20.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
92
+ atomict-1.2.20.dist-info/RECORD,,