Skip to content

Commit

Permalink
Changed prints to logging (PR856)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Gruzinov committed Feb 26, 2024
1 parent 28207a5 commit 4183d64
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions mxcubecore/HardwareObjects/DESY/P11Collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ def collect_characterisation(
self.omega_mv(start_angle, self.default_speed)

for img_no in range(nimages):
print("collecting image %s" % img_no)
logging.info("collecting image %s" % img_no)
start_at = start_angle + angle_inc * img_no
stop_angle = start_at + img_range * 1.0

print("collecting image %s, angle %f" % (img_no, start_at))
logging.info("collecting image %s, angle %f" % (img_no, start_at))

if start_at >= stop_angle:
init_pos = start_at
Expand Down Expand Up @@ -681,7 +681,7 @@ def trigger_auto_processing(self, process_event=None, frame_number=None):
mosflm_path_local.split("/gpfs/current/processed/")[1] + "\n"
)
except:
print(sys.exc_info())
logging.info(sys.exc_info())

# create call
# btHelper.user_sshkey = btHelper.user_sshkey.replace("/gpfs/current",triggerUtils.get_beamtime_metadata()[2])
Expand Down Expand Up @@ -773,7 +773,7 @@ def trigger_auto_processing(self, process_event=None, frame_number=None):
xdsapp_path_local.split("/gpfs/current/processed/")[1] + "\n"
)
except RuntimeError:
print(sys.exc_info())
logging.info(sys.exc_info())

# create call
ssh = btHelper.get_ssh_command()
Expand Down Expand Up @@ -990,12 +990,12 @@ def check_path(self, path=None, force=False):
try:
os.mkdir(path, mode=0o777)
except RuntimeError:
print("mkdir failed:", str(sys.exc_info()))
logging.info("mkdir failed:", str(sys.exc_info()))
return False
else:
print("dir not found:", str(sys.exc_info()))
logging.info("dir not found:", str(sys.exc_info()))
return False
if not os.access(path, os.W_OK):
print("dir not writeable:", str(sys.exc_info()))
logging.info("dir not writeable:", str(sys.exc_info()))
return False
return path
12 changes: 6 additions & 6 deletions mxcubecore/HardwareObjects/DESY/P11EDNACharacterisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def edna_maxwell(self, process_directory, inputxml, outputxml):
)
)

print(
logging.info(
'{ssh:s} "{sbatch:s} --wrap \\"{cmd:s}"\\"'.format(
ssh=ssh, sbatch=sbatch, cmd=cmd
)
Expand Down Expand Up @@ -268,18 +268,18 @@ def input_from_params(self, data_collection, char_params):
path_template = data_collection.acquisitions[0].path_template

# Make sure there is a proper path conversion between different mount points
print(
"======= Characterisation path template ====", path_template.directory
) # /gpfs/current/raw
logging.info(
"======= Characterisation path template ====%s", path_template.directory
)

image_dir = path_template.directory.replace(
"/gpfs/current", triggerUtils.get_beamtime_metadata()[2]
)

print(image_dir)
logging.info(image_dir)

path_str = os.path.join(image_dir, path_template.get_image_file_name())
print(path_template.xds_dir)
logging.info(path_template.xds_dir)

characterisation_dir = path_template.xds_dir.replace(
"/autoprocessing_", "/characterisation_"
Expand Down

0 comments on commit 4183d64

Please sign in to comment.