atomict 1.2.27__py3-none-any.whl → 1.2.29__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.27"
1
+ __version__ = "1.2.29"
@@ -7,6 +7,7 @@ from ase.io.formats import UnknownFileTypeError
7
7
  from atomict.io.formats.atraj import read_atraj, write_atraj
8
8
  from atomict.io.formats.tess import read_tess, write_tess
9
9
 
10
+ logger = logging.getLogger(__name__)
10
11
  console = Console()
11
12
 
12
13
  @click.command()
@@ -94,7 +95,7 @@ def convert(input_file: str, output_file: str):
94
95
  return
95
96
 
96
97
  except Exception as e:
97
- logging.debug(f"Conversion failed with error: {str(e)}", exc_info=True)
98
+ logger.debug(f"Conversion failed with error: {str(e)}", exc_info=True)
98
99
  console.print(f"[red]Error during conversion: {str(e)}[/red]")
99
100
  console.print("[yellow]Try running with --verbose for more detailed error information.[/yellow]")
100
101
 
atomict/cli/main.py CHANGED
@@ -13,6 +13,7 @@ from .commands.exploration import soec, sqs
13
13
  from .commands.simulation import fhiaims, kpoint, qe
14
14
 
15
15
 
16
+ logger = logging.getLogger(__name__)
16
17
  console = Console()
17
18
 
18
19
 
@@ -26,9 +27,9 @@ def setup_logging(verbose: bool):
26
27
  )
27
28
  logging.getLogger("httpx").setLevel(logging.DEBUG)
28
29
  logging.getLogger("httpcore").setLevel(logging.DEBUG)
29
- logging.debug("Debug mode enabled via AT_DEBUG")
30
- logging.debug(f'Python path: {os.getenv("PYTHONPATH")}')
31
- logging.debug(f"Working directory: {os.getcwd()}")
30
+ logger.debug("Debug mode enabled via AT_DEBUG")
31
+ logger.debug(f'Python path: {os.getenv("PYTHONPATH")}')
32
+ logger.debug(f"Working directory: {os.getcwd()}")
32
33
  else:
33
34
  level = logging.DEBUG if verbose else logging.ERROR
34
35
  logging.basicConfig(
@@ -42,8 +42,9 @@ def update_task_status(
42
42
  *,
43
43
  api_root: str = None,
44
44
  token: str = None,
45
+ **kwargs,
45
46
  ):
46
- payload = {}
47
+ payload = dict(kwargs)
47
48
 
48
49
  if status:
49
50
  payload["status"] = status.value
atomict/infra/logging.py CHANGED
@@ -193,11 +193,17 @@ def config_loggers(
193
193
  prefix: Prefix to add to log messages
194
194
  task_id: Task ID to include in Loki labels for filtering
195
195
  """
196
+ prefix_part = f"{prefix} " if prefix else ""
197
+ log_format = (
198
+ f"%(asctime)s %(levelname)s {prefix_part}%(name)s %(message)s"
199
+ )
200
+
196
201
  # Base configuration with console handler
197
202
  logging_config = dict(
198
203
  version=1,
204
+ disable_existing_loggers=False,
199
205
  formatters={
200
- "verbose": {"format": f"%(levelname)s %(asctime)s {prefix} %(message)s"}
206
+ "verbose": {"format": log_format}
201
207
  },
202
208
  handlers={
203
209
  "console": {"class": "logging.StreamHandler", "formatter": "verbose"}
@@ -226,7 +232,7 @@ def config_loggers(
226
232
  batch_size=batch_size,
227
233
  flush_interval=flush_interval,
228
234
  )
229
- loki_handler.setFormatter(logging.Formatter(f"%(asctime)s %(levelname)s {prefix} %(message)s"))
235
+ loki_handler.setFormatter(logging.Formatter(log_format))
230
236
 
231
237
  # Add to root logger
232
238
  logging.getLogger().addHandler(loki_handler)
atomict/io/cif.py CHANGED
@@ -5,6 +5,9 @@ from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
5
5
  from pymatgen.core import Structure
6
6
 
7
7
 
8
+ logger = logging.getLogger(__name__)
9
+
10
+
8
11
  class CIFAnalyzer:
9
12
  def __init__(self, file_path):
10
13
  self.file_path = file_path
@@ -43,7 +46,7 @@ class CIFAnalyzer:
43
46
  info['chemical_formula'] = self.atoms.get_chemical_formula()
44
47
  except Exception as e:
45
48
  info['chemical_formula'] = 'Unknown'
46
- logging.warning(f'Could not determine chemical formula: {str(e)}')
49
+ logger.warning(f'Could not determine chemical formula: {str(e)}')
47
50
 
48
51
  try:
49
52
  info['volume'] = float(self.atoms.get_volume())
@@ -66,7 +69,7 @@ class CIFAnalyzer:
66
69
  }
67
70
  }
68
71
  except Exception as e:
69
- logging.warning(f'Could not determine cell parameters: {str(e)}')
72
+ logger.warning(f'Could not determine cell parameters: {str(e)}')
70
73
  return {'cell_parameters': None}
71
74
 
72
75
  def _get_atomic_info(self):
@@ -88,7 +91,7 @@ class CIFAnalyzer:
88
91
 
89
92
  return info
90
93
  except Exception as e:
91
- logging.warning(f'Could not get complete atomic information: {str(e)}')
94
+ logger.warning(f'Could not get complete atomic information: {str(e)}')
92
95
  return {
93
96
  'num_atoms': 0,
94
97
  'atomic_numbers': [],
@@ -140,6 +143,6 @@ class CIFAnalyzer:
140
143
  }
141
144
  return symmetry_info
142
145
  except Exception as e:
143
- logging.warning(f'Could not determine symmetry information: {str(e)}')
146
+ logger.warning(f'Could not determine symmetry information: {str(e)}')
144
147
 
145
148
  return {'symmetry': None}
@@ -16,6 +16,9 @@ from atomict.user.files import download_file
16
16
  from atomict.user.workspace import download_workspace
17
17
 
18
18
 
19
+ logger = logging.getLogger(__name__)
20
+
21
+
19
22
  def _read_geometry_file(filepath: str, extension: str) -> Atoms:
20
23
  if extension == "atraj":
21
24
  atoms, _ = read_atraj(filepath)
@@ -45,7 +48,7 @@ def get_source_geometry(sim: dict, workbench_dir: str, *, api_root: str = None,
45
48
  extension = sim["source_geometry"]["orig_name"].split(".")[-1]
46
49
  filepath = workbench_dir + f"/geometry.{extension}"
47
50
  if os.path.exists(filepath):
48
- logging.info(f"Source geometry already on disk, skipping download: {filepath}")
51
+ logger.info(f"Source geometry already on disk, skipping download: {filepath}")
49
52
  return _read_geometry_file(filepath, extension)
50
53
  return fetch_source_geometry(sim, workbench_dir, api_root=api_root, token=token)
51
54
  else:
@@ -63,14 +66,14 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str, *, api_root: str = Non
63
66
 
64
67
  if sim.get("starting_structure"):
65
68
  previous_simulation = fhi_get_simulation(sim["starting_structure"]["id"], include_ht=True, api_root=api_root, token=token)
66
- logging.info(f"Previous simulation: {previous_simulation['id']}")
69
+ logger.info(f"Previous simulation: {previous_simulation['id']}")
67
70
  files = fhi_get_simulation_files(previous_simulation["id"], api_root=api_root, token=token)
68
71
 
69
72
  total_size = 0
70
73
  for file in files["results"]:
71
74
  total_size += file["user_upload"]["size"]
72
75
 
73
- logging.info(
76
+ logger.info(
74
77
  f"Previous simulation: Downloading {len(files['results'])} files, Total size: {human_filesize(total_size)}"
75
78
  )
76
79
 
@@ -86,14 +89,14 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str, *, api_root: str = Non
86
89
  elif sim.get("starting_structure_mlrelax"):
87
90
 
88
91
  previous_mlrelax = get_mlrelax(sim["starting_structure_mlrelax"]["id"], include_ht=True, api_root=api_root, token=token)
89
- logging.info(f"Previous MLRelaxation: {previous_mlrelax['id']}")
92
+ logger.info(f"Previous MLRelaxation: {previous_mlrelax['id']}")
90
93
  files = get_mlrelax_files(previous_mlrelax["id"], api_root=api_root, token=token)
91
94
 
92
95
  total_size = 0
93
96
  for file in files["results"]:
94
97
  total_size += file["user_upload"]["size"]
95
98
 
96
- logging.info(
99
+ logger.info(
97
100
  f"Previous MLRelaxation: Downloading {len(files['results'])} files, Total size: {human_filesize(total_size)}"
98
101
  )
99
102
 
@@ -109,7 +112,7 @@ def fetch_relaxed_geometry(sim: dict, workbench_dir: str, *, api_root: str = Non
109
112
  raise FileNotFoundError(f"No relaxation output found in {mlrelax_dir}")
110
113
 
111
114
  elif sim.get("starting_structure_userupload"):
112
- logging.info(f"Previous UserUpload: {sim['starting_structure_userupload']['id']}")
115
+ logger.info(f"Previous UserUpload: {sim['starting_structure_userupload']['id']}")
113
116
 
114
117
  extension = sim["starting_structure_userupload"]["orig_name"].split(".")[-1]
115
118
 
atomict/user/workspace.py CHANGED
@@ -7,6 +7,9 @@ from atomict.io.utils import human_filesize
7
7
  from atomict.user.files import download_file, upload_single_file
8
8
 
9
9
 
10
+ logger = logging.getLogger(__name__)
11
+
12
+
10
13
  def display_name(user_upload):
11
14
  if "users_name" in user_upload and user_upload["users_name"] not in ["", None]:
12
15
  return user_upload["users_name"]
@@ -18,7 +21,7 @@ def clear_workspace(sim, base_path: str = "./workspace"):
18
21
  target_dir = os.path.join(base_path, sim["id"])
19
22
 
20
23
  if os.path.exists(target_dir):
21
- logging.warning(f"Removing existing workspace folder {target_dir}")
24
+ logger.warning(f"Removing existing workspace folder {target_dir}")
22
25
  shutil.rmtree(target_dir)
23
26
 
24
27
 
@@ -37,7 +40,7 @@ def download_workspace(workspace_files, target_directory: str, *, api_root: str
37
40
  total_bytes = sum([f["user_upload"]["size"] for f in workspace_files])
38
41
  finished_bytes = 0
39
42
  for sim_file in workspace_files:
40
- logging.info(
43
+ logger.info(
41
44
  f"Downloading file {display_name(sim_file['user_upload'])} ({human_filesize(sim_file['user_upload']['size'])})"
42
45
  )
43
46
 
@@ -60,7 +63,7 @@ def download_workspace(workspace_files, target_directory: str, *, api_root: str
60
63
  )
61
64
 
62
65
  finished_bytes += sim_file["user_upload"]["size"]
63
- logging.info(
66
+ logger.info(
64
67
  f"Downloaded {human_filesize(finished_bytes)} of {human_filesize(total_bytes)} ({finished_bytes/total_bytes*100:.1f}%)"
65
68
  )
66
69
 
@@ -110,14 +113,14 @@ def upload_workspace(
110
113
  try:
111
114
  result = upload_single_file(file_path, inner_workspace, api_root=api_root, token=token)
112
115
  if result["status"] != "OK":
113
- logging.error(f"Failed to upload {inner_workspace}")
114
- logging.error(result)
116
+ logger.error(f"Failed to upload {inner_workspace}")
117
+ logger.error(result)
115
118
  raise Exception(f"Failed to upload {inner_workspace} {result}")
116
119
  else:
117
- logging.info(f"Uploaded {inner_workspace} OK")
120
+ logger.info(f"Uploaded {inner_workspace} OK")
118
121
  except Exception as e:
119
- logging.error(f"Failed to upload {inner_workspace}")
120
- logging.error(e)
122
+ logger.error(f"Failed to upload {inner_workspace}")
123
+ logger.error(e)
121
124
  raise
122
125
 
123
126
  associate_function(result["UserUpload"]["id"], simulation_id)
@@ -7,6 +7,9 @@ from ase.io.formats import UnknownFileTypeError
7
7
  from atomict.io.fhiaims import read_aims_output
8
8
 
9
9
 
10
+ logger = logging.getLogger(__name__)
11
+
12
+
10
13
  def read_final_geometry(workspace_dir: str, simulation_id: str):
11
14
  """Read the starting structure from the workspace directory
12
15
 
@@ -18,7 +21,7 @@ def read_final_geometry(workspace_dir: str, simulation_id: str):
18
21
  try:
19
22
  return read(next_step_path, foramt='aims')
20
23
  except UnknownFileTypeError:
21
- logging.warning(f"Could not read {next_step_path}, falling back to output file")
24
+ logger.warning(f"Could not read {next_step_path}, falling back to output file")
22
25
 
23
26
  return read_aims_output(
24
27
  f"{workspace_dir}/starting_structure/{simulation_id}.out"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 1.2.27
3
+ Version: 1.2.29
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
@@ -24,7 +24,7 @@ Requires-Dist: click~=8.0
24
24
  Requires-Dist: rich~=13.0
25
25
  Requires-Dist: ase>=3.23.0
26
26
  Requires-Dist: spglib==2.5.0
27
- Requires-Dist: pymatgen==2025.3.10
27
+ Requires-Dist: pymatgen==2025.10.7
28
28
  Requires-Dist: msgpack==1.1.0
29
29
  Requires-Dist: msgpack_numpy==0.4.8
30
30
  Requires-Dist: deepdiff
@@ -1,15 +1,15 @@
1
1
  atomict/__init__.py,sha256=nMXg9GFsk8gCcyBnh1MAeUPvo4Zcuv3sdwGHZrxfpPE,36
2
- atomict/__version__.py,sha256=JKArgvnX6ljUI_WxYnXTejXGdjsA4KJ3Cy2xBcK4vh4,23
2
+ atomict/__version__.py,sha256=kkc0PkaP1QFrTEPI8N5OtZ0p2wkfpteTOMyPLNGAXgk,23
3
3
  atomict/api.py,sha256=pYPKSxNgqyS36sqDR7bEtBf2SWwofDRXrLV8Cc2sebc,7129
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=sP0e864YSn3e0fiUXpREfBrlaYbRTzyxxlzOZAebvm4,3605
9
+ atomict/cli/main.py,sha256=jjanGZmIvgB4KA_CQa54VNyTmzqtpLwaX6GI110nJZA,3639
10
10
  atomict/cli/commands/ai_assist.py,sha256=IgZyoeL5mdwkcwxKWD7y0Enjus-wSlrYee-keyacOOY,3449
11
11
  atomict/cli/commands/common.py,sha256=NG8hiLxUGtk-fW5uVs30nKqVciireghoczT7YsGoR1w,1630
12
- atomict/cli/commands/convert.py,sha256=5cRtaYLnYK9Yc3462ydMCk7GLGld1RCkVEohIF-CJs8,4608
12
+ atomict/cli/commands/convert.py,sha256=uT29yEDu-6BP4exvKTkR9DIV9EYad_3iry-cjMWvk8Y,4644
13
13
  atomict/cli/commands/helpers.py,sha256=VcfJ9g_5CQpVVr-Ptbz4Ah-kq7z5WEJxVCvJkREFjUQ,2039
14
14
  atomict/cli/commands/k8s.py,sha256=YBIGQpGXwlKVOPjiYfOk7GHf4jC-6EoEJcaT3pu1km4,6733
15
15
  atomict/cli/commands/login.py,sha256=6BsyRsNLAtr2bMwYr1e5IAKqjuHI6edClCCBdJ_rZF8,1171
@@ -31,13 +31,13 @@ atomict/cli/core/client.py,sha256=oHbcCLORxjNDw-pTCzpkZPGETaXToik_3xfurMNbhW8,84
31
31
  atomict/cli/core/config.py,sha256=MHQGo59yt3839-r1-3IXqOrN5DNLxMeQ2QBJRSbFONA,1378
32
32
  atomict/cli/core/utils.py,sha256=J8hh1F1vKERnj8JpWSmc2-UHiwFSJfCCnCjDL3-xm4E,941
33
33
  atomict/infra/__init__.py,sha256=qp1HP0h6G9LW0QOe_9JBgoE_Q_OJpA10dMNQXz40Ct0,89
34
- atomict/infra/logging.py,sha256=0UBaEO9sbxhGSl_jrxzF1c2Q0N5OYB2rP-CMo2E5iMs,8102
34
+ atomict/infra/logging.py,sha256=uiP6MLREiZZcxGoR9OlrRMgQ0zXk0Ulxg55bi8eL844,8209
35
35
  atomict/infra/distwork/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  atomict/infra/distwork/environment.py,sha256=joydS9wA2pgWafXh_Wqgg95InaxhsusohaeWc9IOgwA,909
37
- atomict/infra/distwork/task.py,sha256=DIvLWmT_erH_p3hYiR4mke-1Ii2v5pQ6P4oBdr4GSuA,1515
37
+ atomict/infra/distwork/task.py,sha256=Tby-3Rr6IVxRQr7MgIyal9-R7z2Kbwde_WxE_ENgzP4,1539
38
38
  atomict/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  atomict/io/atoms.py,sha256=kdMnto7eyiY2zmoOvLlzbuTGUCIp4ViQGwLmf2m9fGU,13144
40
- atomict/io/cif.py,sha256=s4ThgriM_yyqKUZ8_RIPHm7lz7U5-hX8Jv96JNU2QVo,5793
40
+ atomict/io/cif.py,sha256=mYKXpd4fCIVRsjgnpIaeq7PDEEkdsZsetKA1fxoNKzU,5828
41
41
  atomict/io/fhiaims.py,sha256=Zh_HAsv6128acSwzSeTrGN1Ra1I_RvDwJsubRODovaY,958
42
42
  atomict/io/trajectory.py,sha256=YPse0IQROaWGXY1LzKNVAzwWhMHzvq17bSkhHUxZYco,10701
43
43
  atomict/io/utils.py,sha256=ncA8XchNN3lJT8EhJK6tLJE9TvmHmPlxizTnY5ASvEc,272
@@ -67,21 +67,20 @@ atomict/simulation/kpoint.py,sha256=iwNPIOKRdm6W10UOFSGjQetVP1ZuFBY59xo4da7ajoE,
67
67
  atomict/simulation/md.py,sha256=C32Sh2sv9PQ1lyGaWYFmG5evKk3Jqw0wel2ml4uPnJw,770
68
68
  atomict/simulation/mlrelax.py,sha256=sLODM31FQCQXJ1ezvekzIdnjHcN7YxNrgTgRak4IQYE,3249
69
69
  atomict/simulation/models.py,sha256=RSVLldNurx7F-ijlrLuVyljMS06bsZCBFMXNcdzdOuU,115
70
- atomict/simulation/phonon.py,sha256=UG6v-mpfF-STw0DK-620v26Rpc2EzAx4K-8KykzHtm8,3080
71
70
  atomict/simulation/qe.py,sha256=p46YiHj_HIiqxrQGs-SBuGoWk5zUiHahXIRcyjdEq3c,1702
72
71
  atomict/simulation/sh.py,sha256=YymnH9q8aD_THiielicTKgPGcRunsAcoV5bZKu__L0w,609
73
72
  atomict/simulation/sqs.py,sha256=1neQRVUy21R_UVusML6ocz6RVwxGUVh81CMr2TljGbw,1132
74
- atomict/simulation/utils.py,sha256=X2BBZo86rj08z6TFxrVjfy3vIkrwAq6l0e5RqY4JBX4,5473
73
+ atomict/simulation/utils.py,sha256=6ze0nOeSBp5V4lH7Hn0PXZTdy7APuWuhzk8J90KfV_I,5506
75
74
  atomict/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
75
  atomict/user/files.py,sha256=k5xOkhnVX9t_8ND3hqAdEUQ4-_-viuDxnH9abmydAcs,1142
77
- atomict/user/workspace.py,sha256=n-Q4zsAGg8CnbcG4raB_94xabetfCDi6haFbnJayu70,4858
76
+ atomict/user/workspace.py,sha256=VKvsi5dfopNlIHW-YJT_pgsfH7gEqkpiReBDvJ5R9_A,4889
78
77
  atomict/utils/tenacity.py,sha256=phc6YPEk7idqiFFeHeK-ngiAaqVOZFYp8S7dX1k-YXc,998
79
78
  atomict/utils/traj.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
79
  atomict/utils/fhiaims/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
- atomict/utils/fhiaims/geometry.py,sha256=Dr8g-xTqiH5tTFncn1wZmSnbetvvDylgxL3LldtdFD0,2022
82
- atomict-1.2.27.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
83
- atomict-1.2.27.dist-info/METADATA,sha256=oAc_PHTlYy8mOvDPU6PSE0DhhMUZ1kDRyIUYQZmAhXQ,2938
84
- atomict-1.2.27.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
85
- atomict-1.2.27.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
86
- atomict-1.2.27.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
87
- atomict-1.2.27.dist-info/RECORD,,
80
+ atomict/utils/fhiaims/geometry.py,sha256=s1B57ye8gwMzX4-YafYS97SFx18nRbwYsvidld_bipk,2060
81
+ atomict-1.2.29.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
82
+ atomict-1.2.29.dist-info/METADATA,sha256=sz7K4xs6sAagCM-57n0jkgu73uIeK5qL3-miiE4Ry58,2938
83
+ atomict-1.2.29.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
84
+ atomict-1.2.29.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
85
+ atomict-1.2.29.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
86
+ atomict-1.2.29.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,98 +0,0 @@
1
- from atomict.api import get, post
2
- from atomict.simulation.models import MODEL_ORB_D3_V2, MODEL_MATTERSIM_1_0_0_5M, MODEL_ORB_V3_CONSERVATIVE, MODEL_ESEN_30M_OAM
3
-
4
-
5
- def get_phonon_run(id: str, **params):
6
- """
7
- Get Phonon Run
8
-
9
- A Phonon Run is a collection of Phonon Simulations.
10
-
11
- Args:
12
- id: str - The ID of the Phonon Run
13
- **params: Additional GET parameters to pass to the API
14
- """
15
- # Build query string from parameters
16
- query_string = '&'.join(f"{k}={v}" for k, v in params.items())
17
- base_url = f"api/phonon-run/{id}/"
18
-
19
- # Add query string if we have parameters
20
- url = f"{base_url}?{query_string}" if query_string else base_url
21
-
22
- result = get(url)
23
- return result
24
-
25
-
26
- def get_phonon_sim_run(id: str, **params):
27
- """
28
- Get Phonon Simulation Run
29
-
30
- Args:
31
- id: str - The ID of the Phonon Simulation Run
32
- **params: Additional GET parameters to pass to the API
33
- """
34
- # Build query string from parameters
35
- query_string = '&'.join(f"{k}={v}" for k, v in params.items())
36
- base_url = f"api/phonon-run-simulation/{id}/"
37
-
38
- # Add query string if we have parameters
39
- url = f"{base_url}?{query_string}" if query_string else base_url
40
-
41
- result = get(url)
42
- return result
43
-
44
-
45
- def associate_user_upload_with_phonon_sim_run(user_upload_id: str, phonon_run_id: str):
46
- """
47
- Associate a user upload with a Phonon Simulation Run
48
- """
49
- result = post(
50
- "api/phonon-run-simulation-file/",
51
- payload={"user_upload_id": user_upload_id, "phono3py_run_simulation_id": phonon_run_id},
52
- )
53
- return result
54
-
55
-
56
- def create_phonon_run(project_id: str, source_geometry_id: str, action: str, name: str = None, description: str = None, model: int = MODEL_ORB_D3_V2, extra_simulation_kwargs: dict = None):
57
- """
58
- Create a Phonon Run
59
-
60
- Args:
61
- project_id: str - The ID of the Project
62
- source_geometry_id: str - The ID of the Source Geometry
63
- action: str - The action to perform
64
- name: str - The name of the Phonon Run
65
- """
66
-
67
- if action not in ["LAUNCH", "DRAFT"]:
68
- raise ValueError(f"Invalid action: {action} (must be 'LAUNCH' or 'DRAFT')")
69
-
70
- # Validate model is one of the supported constants
71
- valid_models = [
72
- MODEL_ORB_D3_V2,
73
- MODEL_MATTERSIM_1_0_0_5M,
74
- MODEL_ORB_V3_CONSERVATIVE,
75
- MODEL_ESEN_30M_OAM,
76
- ]
77
- if model not in valid_models:
78
- raise ValueError(f"Invalid model: {model}")
79
-
80
- payload = {
81
- "project_id": project_id,
82
- "source_geometry_id": source_geometry_id,
83
- "action": action,
84
- "name": name,
85
- "description": description,
86
- "model": model,
87
- "extra_simulation_kwargs": extra_simulation_kwargs,
88
- }
89
- result = post("api/phonon-run/", payload=payload)
90
- return result
91
-
92
-
93
- def get_phonon_sim_run_files(phonon_sim_run_id: str):
94
- """
95
- Get the files associated with a Phonon Simulation Run
96
- """
97
- result = get(f"api/phonon-run-simulation-file/?phono3py_run_simulation__id={phonon_sim_run_id}")
98
- return result