atomict 1.2.13__py3-none-any.whl → 1.2.14__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.13"
1
+ __version__ = "1.2.14"
atomict/ase/atatoms.py CHANGED
@@ -78,20 +78,32 @@ class ATAtoms:
78
78
  and tracks diffs between Atoms states. An ATAtoms run is a collection of diffs.
79
79
  """
80
80
 
81
- def __init__(self, atoms: Atoms, batch_size: int = 20, sync_interval: float = 10.0,
82
- project_id: Optional[str] = '', batch_diffs: bool = False):
81
+ def __init__(self,
82
+ atoms: Atoms,
83
+ project_id: Optional[str] = '',
84
+ simulation_id: Optional[str] = '',
85
+ batch_size: int = 20,
86
+ sync_interval: float = 10.0,
87
+ batch_diffs: bool = False,
88
+ is_result: bool = False):
83
89
  """
84
90
  atoms: ASE Atoms object to wrap
91
+ project_id: ID of the project to associate with the atoms (env var AT_PROJECT_ID)
92
+ simulation_id: ID of simulation the object is being used in (env var AT_SIMULATION_ID)
85
93
  batch_size: Number of diffs to accumulate before sending to server in a single request
86
94
  sync_interval: Maximum time in seconds between syncs to server
87
- project_id: ID of the project to associate with the atoms
88
95
  batch_diffs: Whether to batch diffs
96
+ is_result: A (metadata) flag for indicating whether the object is the result of a simulation
89
97
  """
90
98
  if not isinstance(atoms, Atoms):
91
99
  raise TypeError(f"Expected ASE Atoms object, got {type(atoms).__name__}: {atoms}")
92
100
 
93
101
  self._atoms = atoms
94
- self._project_id = project_id
102
+ self._project_id = project_id or os.environ.get('AT_PROJECT_ID')
103
+ self._simulation_id = simulation_id or os.environ.get('AT_SIMULATION_ID')
104
+ if not self._project_id or not self._simulation_id:
105
+ raise ATAtomsInitializationError("ATAtoms requires project_id and simulation_id to be passed or set via environment variables (AT_PROJECT_ID, AT_SIMULATION_ID)")
106
+
95
107
  self._object_id = str(uuid.uuid4())
96
108
  self._batch_size = batch_size
97
109
  self._sync_interval = sync_interval
@@ -103,6 +115,7 @@ class ATAtoms:
103
115
  self._run_id = None
104
116
  self._initialized = False
105
117
  self._batch_diffs = batch_diffs
118
+ self._is_result = is_result
106
119
  self._initial_state = self._get_current_state()
107
120
  self._previous_state = self._serialize_state(self._initial_state)
108
121
  self._structure_id = self._hash_state(self._previous_state)
@@ -183,7 +196,9 @@ class ATAtoms:
183
196
  'metadata': json.dumps({
184
197
  'created_by': 'ATAtoms',
185
198
  'initial_structure_id': self._structure_id,
186
- 'timestamp': datetime.datetime.now().isoformat()
199
+ 'timestamp': datetime.datetime.now().isoformat(),
200
+ 'is_result': self._is_result,
201
+ 'simulation_id': self._simulation_id
187
202
  })
188
203
  }
189
204
  response = post(
@@ -21,7 +21,7 @@ from atomict.user.workspace import download_workspace
21
21
 
22
22
 
23
23
  def fetch_source_geometry(sim: dict, workbench_dir: str) -> Atoms:
24
- if sim["source_geometry"]:
24
+ if sim.get("source_geometry"):
25
25
 
26
26
  extension = sim["source_geometry"]["orig_name"].split(".")[-1]
27
27
 
@@ -49,7 +49,7 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str) -> Atoms:
49
49
  returns: Atoms object
50
50
  """
51
51
 
52
- if sim["starting_structure"]:
52
+ if sim.get("starting_structure"):
53
53
  previous_simulation = fhi_get_simulation(sim["starting_structure"]["id"], include_ht=True)
54
54
  logging.info(f"Previous simulation: {previous_simulation['id']}")
55
55
  files = fhi_get_simulation_files(previous_simulation["id"])
@@ -71,7 +71,7 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str) -> Atoms:
71
71
 
72
72
  return atoms[-1]
73
73
 
74
- elif sim["starting_structure_mlrelax"]:
74
+ elif sim.get("starting_structure_mlrelax"):
75
75
 
76
76
  previous_mlrelax = get_mlrelax(sim["starting_structure_mlrelax"]["id"], include_ht=True)
77
77
  logging.info(f"Previous MLRelaxation: {previous_mlrelax['id']}")
@@ -102,7 +102,7 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str) -> Atoms:
102
102
  else:
103
103
  return atoms
104
104
 
105
- elif sim["starting_structure_userupload"]:
105
+ elif sim.get("starting_structure_userupload"):
106
106
  logging.info(f"Previous UserUpload: {sim['starting_structure_userupload']['uuid']}")
107
107
 
108
108
  extension = sim["starting_structure_userupload"]["orig_name"].split(".")[-1]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 1.2.13
3
+ Version: 1.2.14
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
@@ -1,10 +1,10 @@
1
1
  atomict/__init__.py,sha256=nMXg9GFsk8gCcyBnh1MAeUPvo4Zcuv3sdwGHZrxfpPE,36
2
- atomict/__version__.py,sha256=rQSlPcfj4yT4krIq6epTVQyBzIX4etVOgfupVkM-RnU,23
2
+ atomict/__version__.py,sha256=mxzjGyB-ihJR05pHYcBiUe_XT5X9wj6cBHLxOXBhAeM,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
- atomict/ase/atatoms.py,sha256=LGGopVFR1jLJCSCASnpmOSeCl7TSmWXr6Nf6GqIMsSo,26852
7
+ atomict/ase/atatoms.py,sha256=jNgAb0UfAZu4AJFbGgpOfDTg2u1vDolmSBZJK0BhwRE,27736
8
8
  atomict/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  atomict/cli/main.py,sha256=M8T_cJUAwha4tnBWRRwIr3iiG2hBLyJAk-uewu3sy5A,9714
10
10
  atomict/cli/commands/adsorbate.py,sha256=fdu6m5Kx2fkQXA--BsvU5QWcq0-PKFi7bGaLJZnnqag,5836
@@ -71,7 +71,7 @@ atomict/simulation/models.py,sha256=2gBPyRo5I6TJetc8iqu7W6gF3eJr9D-zqffonooaJxs,
71
71
  atomict/simulation/phonon.py,sha256=_roteuXyV8KmlwGW1jnidSY6xu_3ReNhLtYGL0OdS8Q,2950
72
72
  atomict/simulation/qe.py,sha256=p46YiHj_HIiqxrQGs-SBuGoWk5zUiHahXIRcyjdEq3c,1702
73
73
  atomict/simulation/sqs.py,sha256=1neQRVUy21R_UVusML6ocz6RVwxGUVh81CMr2TljGbw,1132
74
- atomict/simulation/utils.py,sha256=NQU04VgoLJGh7hL8VDSdfqylRGVeLFINWiXOKAqmiKU,4412
74
+ atomict/simulation/utils.py,sha256=iYp3uVirfbLYjVmb6SqXMPe_HIJdcJKHhKORBIAcG8s,4428
75
75
  atomict/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  atomict/user/files.py,sha256=8xGPkISOIiFYsYr26k8OqGE3G7q096zdtV6uy6YTtVU,875
77
77
  atomict/user/workspace.py,sha256=qH-iF8kLj7Zpj646NFF_G3d4_P22jQjw5une-ZBiBak,3923
@@ -79,9 +79,9 @@ atomict/utils/tenacity.py,sha256=phc6YPEk7idqiFFeHeK-ngiAaqVOZFYp8S7dX1k-YXc,998
79
79
  atomict/utils/traj.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
80
  atomict/utils/fhiaims/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
81
  atomict/utils/fhiaims/geometry.py,sha256=3Ap6gO7UsLFXBl9Ohv8Vmfpvwu0fohpzgdxOFGg6Tmc,2281
82
- atomict-1.2.13.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
83
- atomict-1.2.13.dist-info/METADATA,sha256=z8xG9DD85w6q2KvnyMhEaY9C5zSPlERWtMa8teF9K4c,3270
84
- atomict-1.2.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
85
- atomict-1.2.13.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
86
- atomict-1.2.13.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
87
- atomict-1.2.13.dist-info/RECORD,,
82
+ atomict-1.2.14.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
83
+ atomict-1.2.14.dist-info/METADATA,sha256=XMCjxU1P1mvoowGL86am9_p5-mW6BclyCubCE6PaQ3k,3270
84
+ atomict-1.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
85
+ atomict-1.2.14.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
86
+ atomict-1.2.14.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
87
+ atomict-1.2.14.dist-info/RECORD,,