atomict 1.2.25__py3-none-any.whl → 1.2.28__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/user/workspace.py CHANGED
@@ -22,12 +22,14 @@ def clear_workspace(sim, base_path: str = "./workspace"):
22
22
  shutil.rmtree(target_dir)
23
23
 
24
24
 
25
- def download_workspace(workspace_files, target_directory: str):
25
+ def download_workspace(workspace_files, target_directory: str, *, api_root: str = None, token: str = None):
26
26
  """Download a workspace to a target directory
27
27
 
28
28
  Args:
29
29
  workspace_files list of UserUpload objects: List of files to download
30
30
  target_directory (str): The directory to download the files to
31
+ api_root (str): Optional API root URL (defaults to AT_SERVER env var)
32
+ token (str): Optional API token (defaults to AT_TOKEN env var)
31
33
  """
32
34
 
33
35
  os.makedirs(target_directory, exist_ok=True)
@@ -39,10 +41,23 @@ def download_workspace(workspace_files, target_directory: str):
39
41
  f"Downloading file {display_name(sim_file['user_upload'])} ({human_filesize(sim_file['user_upload']['size'])})"
40
42
  )
41
43
 
42
- download_file(
43
- sim_file["user_upload"]["id"],
44
- f"{target_directory}/{sim_file['user_upload']['users_name']}",
45
- )
44
+ destination_path = f"{target_directory}/{sim_file['user_upload']['users_name']}"
45
+
46
+ if sim_file['user_upload']['size'] == 0:
47
+ # Make intermediate dirs
48
+ destination_dir = os.path.dirname(destination_path)
49
+ if destination_dir:
50
+ os.makedirs(destination_dir, exist_ok=True)
51
+
52
+ with open(destination_path, "w") as f:
53
+ pass # Will create a 0 byte file
54
+ else:
55
+ download_file(
56
+ sim_file["user_upload"]["id"],
57
+ destination_path,
58
+ api_root=api_root,
59
+ token=token,
60
+ )
46
61
 
47
62
  finished_bytes += sim_file["user_upload"]["size"]
48
63
  logging.info(
@@ -51,7 +66,13 @@ def download_workspace(workspace_files, target_directory: str):
51
66
 
52
67
 
53
68
  def upload_workspace(
54
- sim, associate_function, workspace_folder: str, starting_percent: int = 80
69
+ sim,
70
+ associate_function,
71
+ workspace_folder: str,
72
+ starting_percent: int = 80,
73
+ *,
74
+ api_root: str = None,
75
+ token: str = None,
55
76
  ):
56
77
  """
57
78
  Uploads a workspace folder to the Atomic platform, and associates the uploaded files with the given simulation.
@@ -61,6 +82,8 @@ def upload_workspace(
61
82
  associate_function: The function to associate the uploaded files with the simulation (e.g. associate_user_upload_with_qe_simulation)
62
83
  workspace_folder: The folder to upload
63
84
  starting_percent: The starting percentage to use when updating the task status
85
+ api_root (str): Optional API root URL (defaults to AT_SERVER env var)
86
+ token (str): Optional API token (defaults to AT_TOKEN env var)
64
87
  """
65
88
 
66
89
  simulation_id = sim["id"]
@@ -85,7 +108,7 @@ def upload_workspace(
85
108
  file_size = os.path.getsize(file_path)
86
109
 
87
110
  try:
88
- result = upload_single_file(file_path, inner_workspace)
111
+ result = upload_single_file(file_path, inner_workspace, api_root=api_root, token=token)
89
112
  if result["status"] != "OK":
90
113
  logging.error(f"Failed to upload {inner_workspace}")
91
114
  logging.error(result)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomict
3
- Version: 1.2.25
3
+ Version: 1.2.28
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,39 +1,40 @@
1
1
  atomict/__init__.py,sha256=nMXg9GFsk8gCcyBnh1MAeUPvo4Zcuv3sdwGHZrxfpPE,36
2
- atomict/__version__.py,sha256=9j001fhDZzLSWs6YCbGQFuK5ERX5EUWz3RKLN8l5JS8,23
3
- atomict/api.py,sha256=1aI2qPMm6V9VY4PLR8LBMm2WwVCBB9pAL7sEowvjhtc,6706
2
+ atomict/__version__.py,sha256=sZoYrdh97RjbwC1rg-3mt6kqvjxTxWL7ejhDDrG6mVM,23
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=wasnTCE1VFQSes3m2qVRjk-jIFMjYt_Zeurd0812e3E,3572
9
+ atomict/cli/main.py,sha256=sP0e864YSn3e0fiUXpREfBrlaYbRTzyxxlzOZAebvm4,3605
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
12
  atomict/cli/commands/convert.py,sha256=5cRtaYLnYK9Yc3462ydMCk7GLGld1RCkVEohIF-CJs8,4608
13
13
  atomict/cli/commands/helpers.py,sha256=VcfJ9g_5CQpVVr-Ptbz4Ah-kq7z5WEJxVCvJkREFjUQ,2039
14
- atomict/cli/commands/k8s.py,sha256=aPll70iXe5Kd4-4ZWPVDiTzwvC9r74_EOgnPBpZVojk,6712
14
+ atomict/cli/commands/k8s.py,sha256=YBIGQpGXwlKVOPjiYfOk7GHf4jC-6EoEJcaT3pu1km4,6733
15
15
  atomict/cli/commands/login.py,sha256=6BsyRsNLAtr2bMwYr1e5IAKqjuHI6edClCCBdJ_rZF8,1171
16
16
  atomict/cli/commands/organization.py,sha256=EIDpiue815jNi4mDyLCbHUGudNlB0RBPwWgrdBt5DCo,2106
17
- atomict/cli/commands/project.py,sha256=kbqTE7tUEkjE3Hm64WrHDw_sqd1jMnGOH4PIQPJfmEM,28540
18
- atomict/cli/commands/task.py,sha256=eRZlClY4W57gKz6WiYKf9M1ZdLag37o3YxUrgOCCfsA,5453
17
+ atomict/cli/commands/project.py,sha256=eiidnM_n_wJG-PqFdL3IkcRyEmP-l6xTOhXG_vp8kGE,28487
18
+ atomict/cli/commands/task.py,sha256=nXb2C4OUxMf9L9NC4KJ5a1gKbHuiHk4T0wS5JGzBQlE,5556
19
19
  atomict/cli/commands/token.py,sha256=yTyH0J2xStO2cly9iifMHd8QTvHVPHL0owe4r6XUJ5s,560
20
20
  atomict/cli/commands/traj.py,sha256=SIgBYKKIFJ-_C37abefEO2Qzoql4GFYuIGgPmCykoj0,1675
21
21
  atomict/cli/commands/upload.py,sha256=U7OW4mrYeqfoMHXPIBNTHDTOvx_-rGiY82Sj72y8N-Q,2823
22
22
  atomict/cli/commands/user.py,sha256=7jja2At19hrMoTaRx7PrAZRS0C48BJjIN9WEmzN7Xxc,6486
23
23
  atomict/cli/commands/workspace.py,sha256=tAchOx4ycIwHsV-9uIAXdIyCz0Umdf5mBO38fy7jO28,4169
24
24
  atomict/cli/commands/exploration/__init__.py,sha256=LTuDJsRPL62w-YYXx-X_GgsuD2Dovj74h-G5tTw5DaE,169
25
- atomict/cli/commands/exploration/soec.py,sha256=ZkKJKHz97OaswLS0hptyEquQyyATkfb8T6EI3ngkg68,18888
26
- atomict/cli/commands/exploration/sqs.py,sha256=AVyiU25SvOv1I-lYfCqgnnaEmCiFNDggsP1GLcmliS8,14593
27
- atomict/cli/commands/simulation/fhiaims.py,sha256=iUddj5W98gflQOkLo7FD8y7kpdtaLZQFw8LEYVha6f0,9180
28
- atomict/cli/commands/simulation/kpoint.py,sha256=dnmJSfhXLLOpftFnNGPFPTVfNq_93LiOxG8EeFeIN5c,12391
25
+ atomict/cli/commands/exploration/soec.py,sha256=c2BrqemlFdSEPjOsB9Z3UHDOO4JNcIsLbK5YfAbATQo,19597
26
+ atomict/cli/commands/exploration/sqs.py,sha256=t1UDfD4fZE7EIn4E7fItA7xWBs1QcdIaDp4g-VUkz98,14529
27
+ atomict/cli/commands/simulation/fhiaims.py,sha256=7w4jI4N5v4ChPw5qC_kMk_pIRd8ZEwEOC8Q19sJA-us,8416
28
+ atomict/cli/commands/simulation/kpoint.py,sha256=C3TNOP8Pm_PI0j1obA5V2xCk_xvkrR5Zpfuk9ZbBcHs,12555
29
+ atomict/cli/commands/simulation/qe.py,sha256=0HuuCIF1zRaN63IHJ2IDDWeX6TzHBJ0jpuobIjOV8ik,12666
29
30
  atomict/cli/core/client.py,sha256=oHbcCLORxjNDw-pTCzpkZPGETaXToik_3xfurMNbhW8,8402
30
31
  atomict/cli/core/config.py,sha256=MHQGo59yt3839-r1-3IXqOrN5DNLxMeQ2QBJRSbFONA,1378
31
32
  atomict/cli/core/utils.py,sha256=J8hh1F1vKERnj8JpWSmc2-UHiwFSJfCCnCjDL3-xm4E,941
32
33
  atomict/infra/__init__.py,sha256=qp1HP0h6G9LW0QOe_9JBgoE_Q_OJpA10dMNQXz40Ct0,89
33
- atomict/infra/logging.py,sha256=QC1FTCyth-Qg4rn5h3yzqqKKWYoXMn_4n9AK99rcpOE,7690
34
+ atomict/infra/logging.py,sha256=0UBaEO9sbxhGSl_jrxzF1c2Q0N5OYB2rP-CMo2E5iMs,8102
34
35
  atomict/infra/distwork/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
36
  atomict/infra/distwork/environment.py,sha256=joydS9wA2pgWafXh_Wqgg95InaxhsusohaeWc9IOgwA,909
36
- atomict/infra/distwork/task.py,sha256=kflMllczaUQHDa8AAUTsLi5RJivckr1LKHAUZwqIKio,1182
37
+ atomict/infra/distwork/task.py,sha256=Tby-3Rr6IVxRQr7MgIyal9-R7z2Kbwde_WxE_ENgzP4,1539
37
38
  atomict/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
39
  atomict/io/atoms.py,sha256=kdMnto7eyiY2zmoOvLlzbuTGUCIp4ViQGwLmf2m9fGU,13144
39
40
  atomict/io/cif.py,sha256=s4ThgriM_yyqKUZ8_RIPHm7lz7U5-hX8Jv96JNU2QVo,5793
@@ -59,29 +60,27 @@ atomict/simulation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
59
60
  atomict/simulation/cantera.py,sha256=u9TTa_Zm9CPNSln4V06tyJspr3NiCCCZPW6guuOlb5o,858
60
61
  atomict/simulation/counterfactual.py,sha256=8-Kf4wGxPvImDr0j2grmBLLwFQ4JpjhBBxIksIwblIQ,708
61
62
  atomict/simulation/defect.py,sha256=uvYLR_Ng0PFV9A_EE_EgB2SK8jqUpJtvuwLKL02Am3c,691
62
- atomict/simulation/ea.py,sha256=bYvYnw59F7QCuV-airnX0Wu8fqZHKlsdywgoK7pwNso,3610
63
- atomict/simulation/fhi_aims.py,sha256=FRIqmZ_2AMpjFW_ow6vfe611vgElrENNOGmgIzXj908,2037
63
+ atomict/simulation/ea.py,sha256=i67Gwe-Oh_bEUlLAf3PcoTGU5LMjQVN2Yyp-sPK_vPY,4898
64
+ atomict/simulation/fhi_aims.py,sha256=0qev3Xu4DKt_lt80ID7PV810_MT3z3QnUG8yK74EsVA,2478
64
65
  atomict/simulation/impact.py,sha256=b5RL--cFeg6gPtxN5xwX_M4LkvYn_lRLi1OWz-uimPA,1161
65
- atomict/simulation/kpoint.py,sha256=8Dc1F9xqubK1HBCQa7GeRtIhs28302sRnuUK0Rns9Q4,1739
66
- atomict/simulation/mattergen.py,sha256=ybzJy0nwIAZhG8IIuhlmi-_J6lLyci3aVo35h2ni_w0,488
66
+ atomict/simulation/kpoint.py,sha256=iwNPIOKRdm6W10UOFSGjQetVP1ZuFBY59xo4da7ajoE,3060
67
67
  atomict/simulation/md.py,sha256=C32Sh2sv9PQ1lyGaWYFmG5evKk3Jqw0wel2ml4uPnJw,770
68
- atomict/simulation/mlrelax.py,sha256=ZS9WoO9efHeSNXM-MxuqQMSWN54qDKLscBgxL4monfI,2841
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
- atomict/simulation/qe.py,sha256=3PpqpA0Pn3FCGEgjaMnCidguhopGxFUDMaxwfIQF2FE,1700
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=xipTvFC1WOskpMz0b0pNoCM4OjcR9ylhsUCnLGb5Rvg,4443
73
+ atomict/simulation/utils.py,sha256=X2BBZo86rj08z6TFxrVjfy3vIkrwAq6l0e5RqY4JBX4,5473
75
74
  atomict/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
- atomict/user/files.py,sha256=eRIxC4OeyTMwF-pu2En82qd5VtA4RM_dA1N1YgbLgZ8,964
77
- atomict/user/workspace.py,sha256=ihM9TTaxlQC9HYbL7qKBM6PdNRUFZn1EZRUd6CuTXlI,3921
75
+ atomict/user/files.py,sha256=k5xOkhnVX9t_8ND3hqAdEUQ4-_-viuDxnH9abmydAcs,1142
76
+ atomict/user/workspace.py,sha256=n-Q4zsAGg8CnbcG4raB_94xabetfCDi6haFbnJayu70,4858
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
80
  atomict/utils/fhiaims/geometry.py,sha256=Dr8g-xTqiH5tTFncn1wZmSnbetvvDylgxL3LldtdFD0,2022
82
- atomict-1.2.25.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
83
- atomict-1.2.25.dist-info/METADATA,sha256=O0F0BhL-KI0M3koXlP_MDc8AwuljEj0PqlvYt23pBd0,2938
84
- atomict-1.2.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
85
- atomict-1.2.25.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
86
- atomict-1.2.25.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
87
- atomict-1.2.25.dist-info/RECORD,,
81
+ atomict-1.2.28.dist-info/licenses/LICENSE,sha256=fzvTkxUzi2u1cea_aRtmg5_mRk6ZyLWJJRr49K28qKg,1075
82
+ atomict-1.2.28.dist-info/METADATA,sha256=C4LnsAy8zsZUqeKTG-xUVWgIHg3vgD19hbEbhnXCUwE,2938
83
+ atomict-1.2.28.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
84
+ atomict-1.2.28.dist-info/entry_points.txt,sha256=PozguIUgJUHgS65PSZBHNPUiwYGDwXa4vLZ7hde3aq8,47
85
+ atomict-1.2.28.dist-info/top_level.txt,sha256=CCo525YmAj7ZbToMmQcVKQ-JiIiFKiq3GmhIYCG2gaM,8
86
+ atomict-1.2.28.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (83.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,20 +0,0 @@
1
- from atomict.api import get, post
2
-
3
-
4
- def get_mattergen(id: str):
5
- """
6
- Get MatterGen
7
- """
8
- result = get(f"api/mattergen-exploration/{id}/")
9
- return result
10
-
11
-
12
- def associate_user_upload_with_mattergen(user_upload_id: str, exploration_id: str):
13
- """
14
- Associate a user upload with a MatterGen
15
- """
16
- result = post(
17
- "api/mattergen-exploration-file/",
18
- payload={"user_upload_id": user_upload_id, "exploration_id": exploration_id},
19
- )
20
- return result
@@ -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