Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-riggs committed Aug 13, 2024
1 parent ec64de6 commit f2a0ab1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/cryoemservices/services/tomo_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def _tilt(file_list):
"experiment_type": "tomography",
"job_type": self.job_type,
"input_file": tomo_params.input_file_list[0][0],
"output_file": aretomo_output_path,
"output_file": str(aretomo_output_path),
"relion_options": dict(tomo_params.relion_options),
"command": " ".join(aretomo_command),
"stdout": "",
Expand Down Expand Up @@ -333,14 +333,14 @@ def _tilt(file_list):
imod_directory = self.alignment_output_dir / f"{stack_name}_aretomo_Imod"
if tomo_params.out_imod:
start_time = time.time()
while not Path(imod_directory).is_dir():
while not imod_directory.is_dir():
time.sleep(30)
elapsed = time.time() - start_time
if elapsed > 600:
self.log.warning("Timeout waiting for Imod directory")
break
else:
_f = Path(imod_directory)
_f = imod_directory
_f.chmod(0o750)
for file in _f.iterdir():
file.chmod(0o740)
Expand Down Expand Up @@ -369,7 +369,7 @@ def _tilt(file_list):
{
"ispyb_command": "insert_tomogram",
"volume_file": str(
Path(aretomo_output_path).relative_to(self.alignment_output_dir)
aretomo_output_path.relative_to(self.alignment_output_dir)
),
"stack_file": tomo_params.stack_file,
"size_x": None, # volume image size, pix
Expand All @@ -395,8 +395,8 @@ def _tilt(file_list):
if dark_images_file.is_file():
with open(dark_images_file) as f:
missing_indices = [int(i) for i in f.readlines()[2:]]
elif Path(imod_directory).is_dir():
dark_images_file = Path(imod_directory) / "tilt.com"
elif imod_directory.is_dir():
dark_images_file = imod_directory / "tilt.com"
with open(dark_images_file) as f:
lines = f.readlines()
for line in lines:
Expand Down Expand Up @@ -512,29 +512,29 @@ def _tilt(file_list):
destination="images",
message={
"image_command": "mrc_central_slice",
"file": aretomo_output_path,
"file": str(aretomo_output_path),
},
)
rw.transport.send(
destination="images",
message={
"image_command": "mrc_to_apng",
"file": aretomo_output_path,
"file": str(aretomo_output_path),
},
)
else:
rw.send_to(
"images",
{
"image_command": "mrc_central_slice",
"file": aretomo_output_path,
"file": str(aretomo_output_path),
},
)
rw.send_to(
"images",
{
"image_command": "mrc_to_apng",
"file": aretomo_output_path,
"file": str(aretomo_output_path),
},
)

Expand Down Expand Up @@ -565,7 +565,7 @@ def _tilt(file_list):
rw.transport.send(
destination="denoise",
message={
"volume": aretomo_output_path,
"volume": str(aretomo_output_path),
"output_dir": str(
project_dir / f"Denoise/job{job_number+1:03}/tomograms"
),
Expand All @@ -576,7 +576,7 @@ def _tilt(file_list):
rw.send_to(
"denoise",
{
"volume": aretomo_output_path,
"volume": str(aretomo_output_path),
"output_dir": str(
project_dir / f"Denoise/job{job_number+1:03}/tomograms"
),
Expand Down

0 comments on commit f2a0ab1

Please sign in to comment.