From a3ccefea4cb1000cf117a7eea7796f10c5751ec0 Mon Sep 17 00:00:00 2001 From: pyiron-runner Date: Tue, 25 Oct 2022 21:15:37 +0000 Subject: [PATCH] Format black --- .../jobs/job/extension/server/queuestatus.py | 8 ++++++-- pyiron_base/project/generic.py | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/pyiron_base/jobs/job/extension/server/queuestatus.py b/pyiron_base/jobs/job/extension/server/queuestatus.py index f7ca28d26..458c6464d 100644 --- a/pyiron_base/jobs/job/extension/server/queuestatus.py +++ b/pyiron_base/jobs/job/extension/server/queuestatus.py @@ -25,7 +25,9 @@ QUEUE_SCRIPT_PREFIX = "pi_" -def queue_table(job_ids=None, working_directory_lst=None, project_only=True, full_table=False): +def queue_table( + job_ids=None, working_directory_lst=None, project_only=True, full_table=False +): """ Display the queuing system table as pandas.Dataframe @@ -39,7 +41,9 @@ def queue_table(job_ids=None, working_directory_lst=None, project_only=True, ful pandas.DataFrame: Output from the queuing system - optimized for the Sun grid engine """ job_ids = [] if job_ids is None else job_ids - working_directory_lst = [] if working_directory_lst is None else working_directory_lst + working_directory_lst = ( + [] if working_directory_lst is None else working_directory_lst + ) if project_only and not job_ids and not working_directory_lst: return [] if state.queue_adapter is not None: diff --git a/pyiron_base/project/generic.py b/pyiron_base/project/generic.py index 746f083cb..bbaf2be7c 100644 --- a/pyiron_base/project/generic.py +++ b/pyiron_base/project/generic.py @@ -912,7 +912,7 @@ def queue_table(self, project_only=True, recursive=True, full_table=False): return queue_table( project_only=project_only, full_table=full_table, - working_directory_lst=[self.path] + working_directory_lst=[self.path], ) def queue_table_global(self, full_table=False): @@ -938,13 +938,13 @@ def queue_table_global(self, full_table=False): ] ) else: + def get_id_from_job_table(job_table, job_path): job_dir = "_hdf5".join(job_path.split("_hdf5")[:-1]) job_name = os.path.basename(job_dir) project = os.path.dirname(job_dir) + "/" return job_table[ - (job_table.job == job_name) & - (job_table.project == project) + (job_table.job == job_name) & (job_table.project == project) ].id.values[0] job_table_df = self.job_table() @@ -952,12 +952,15 @@ def get_id_from_job_table(job_table, job_path): return pandas.DataFrame( [ self.db.get_item_by_id( - int(get_id_from_job_table( - job_table=job_table_df, - job_path=working_directory - )) + int( + get_id_from_job_table( + job_table=job_table_df, job_path=working_directory + ) + ) + ) + for queue_ID, working_directory in zip( + df["jobname"], df["working_directory"] ) - for queue_ID, working_directory in zip(df["jobname"], df["working_directory"]) if str(queue_ID).startswith("pi_") ] )