Skip to content

Commit

Permalink
Remove unecessary pint statement and add some TODOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder committed Feb 4, 2025
1 parent 004e7c6 commit 01fc923
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/pynxtools_spm/nomad_uploader/reader_config_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def convert_spm_experiments(
for file in input_params.input_file:
zipf.write(file, arcname=file.split("/")[-1])
input_params.zip_file_path = zip_file
print(f"########### print from : ", input_params.zip_file_path)
return zip_file


Expand Down
7 changes: 4 additions & 3 deletions src/pynxtools_spm/nomad_uploader/upload_srcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,13 @@ def queue_results(input_params, lock, results_q):

indices = []
zips_to_be_upload = []
# TODO: Get the input parameters rom the queue, on which we can delete the raw files.
while not results_q.empty():
zips_to_be_upload.append(results_q.get())
print("############# All processes are done!", zips_to_be_upload)
upload_time_limit = datetime.now() + timedelta(seconds=time_out)

while len(zips_to_be_upload) != len(indices) and datetime.now() < upload_time_limit:
while len(zips_to_be_upload) > len(indices) and datetime.now() < upload_time_limit:
for ind, zip_to_upload in enumerate(zips_to_be_upload):
print(f"######## zip file Processing {zip_to_upload}...")
if ind in indices: # already processed or failed
continue
if not zip_to_upload:
Expand Down Expand Up @@ -185,8 +184,10 @@ def queue_results(input_params, lock, results_q):
not massage.startswith("Process process_upload completed successfully")
and attempt < max_attempt
):
# TODO: If upload is sucessfull, remove the zip and raw files
attempt += 1
massage = check_upload_status(nomad_url, token, upload_id)
time.sleep(4 / 60) # 4 second
print(f"Upload status: {massage}")

print("All done!", indices)

0 comments on commit 01fc923

Please sign in to comment.