From 5b05f781eccaa18552db830d4cc8391300f65abe Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Mon, 1 Jul 2024 08:52:50 +0200 Subject: [PATCH] formatting --- bfabric/bfabric.py | 1 - bfabric/scripts/bfabric_feeder_mascot.py | 4 +--- bfabric/scripts/bfabric_list_workunit_parameters.py | 8 ++++---- bfabric/scripts/bfabric_save_csv2dataset.py | 4 +--- bfabric/scripts/bfabric_save_dataset2csv.py | 4 +--- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/bfabric/bfabric.py b/bfabric/bfabric.py index bb5f92af..584b7b4e 100755 --- a/bfabric/bfabric.py +++ b/bfabric/bfabric.py @@ -297,7 +297,6 @@ def get_system_auth( else: config_path = Path(config_path).expanduser() - # Use the provided config data from arguments instead of the file if not config_path.is_file(): if have_config_path: diff --git a/bfabric/scripts/bfabric_feeder_mascot.py b/bfabric/scripts/bfabric_feeder_mascot.py index cb28cada..d4b7d82b 100755 --- a/bfabric/scripts/bfabric_feeder_mascot.py +++ b/bfabric/scripts/bfabric_feeder_mascot.py @@ -65,9 +65,7 @@ def query_mascot_result(file_path: str) -> bool: print("\thit") wu = DB[file_path] if "workunitid" in wu: - print( - f"\tdat file {file_path} already registered as workunit id {wu['workunitid']}. continue ..." - ) + print(f"\tdat file {file_path} already registered as workunit id {wu['workunitid']}. continue ...") return else: print("\tno workunitid found") diff --git a/bfabric/scripts/bfabric_list_workunit_parameters.py b/bfabric/scripts/bfabric_list_workunit_parameters.py index c15b299f..6c863816 100644 --- a/bfabric/scripts/bfabric_list_workunit_parameters.py +++ b/bfabric/scripts/bfabric_list_workunit_parameters.py @@ -48,9 +48,7 @@ def get_workunits_table_full(application_id: int, client: Bfabric, max_workunits inputdataset_id=pl.col("inputdataset").struct[1], ) else: - workunits_table_full = workunits_table_full.with_columns( - inputdataset_id=pl.lit(None) - ) + workunits_table_full = workunits_table_full.with_columns(inputdataset_id=pl.lit(None)) return workunits_table_full @@ -78,7 +76,9 @@ def get_parameter_table(client: Bfabric, workunits_table_explode: pl.DataFrame) # load the parameters table collect = [] for i_frame, frame in enumerate(workunits_table_explode.iter_slices(100)): - print(f"-- Reading parameters chunk {i_frame + 1} of {len(workunits_table_explode) // 100 + 1}", file=sys.stderr) + print( + f"-- Reading parameters chunk {i_frame + 1} of {len(workunits_table_explode) // 100 + 1}", file=sys.stderr + ) chunk = ( client.read("parameter", {"id": frame["parameter_id"].to_list()}).to_polars().rename({"id": "parameter_id"}) ) diff --git a/bfabric/scripts/bfabric_save_csv2dataset.py b/bfabric/scripts/bfabric_save_csv2dataset.py index c06c2134..511909c0 100755 --- a/bfabric/scripts/bfabric_save_csv2dataset.py +++ b/bfabric/scripts/bfabric_save_csv2dataset.py @@ -99,9 +99,7 @@ def check_for_invalid_characters(data: pl.DataFrame, invalid_characters: str) -> .to_numpy() ) if len(invalid_columns) > 0: - raise RuntimeError( - f"Invalid characters found in columns: {invalid_columns[0]}" - ) + raise RuntimeError(f"Invalid characters found in columns: {invalid_columns[0]}") def main() -> None: diff --git a/bfabric/scripts/bfabric_save_dataset2csv.py b/bfabric/scripts/bfabric_save_dataset2csv.py index 5d3599fb..637d17ae 100755 --- a/bfabric/scripts/bfabric_save_dataset2csv.py +++ b/bfabric/scripts/bfabric_save_dataset2csv.py @@ -68,9 +68,7 @@ def main() -> None: ) parser.add_argument("--sep", default=",", help="the separator to use in the csv file e.g. ',' or '\\t'") args = parser.parse_args() - bfabric_save_dataset2csv( - client=client, out_dir=args.dir, out_filename=args.file, dataset_id=args.id, sep=args.sep - ) + bfabric_save_dataset2csv(client=client, out_dir=args.dir, out_filename=args.file, dataset_id=args.id, sep=args.sep) if __name__ == "__main__":