From 8989d74c961e3122e30ba16056dfe787a69dbc42 Mon Sep 17 00:00:00 2001 From: Teagan Date: Thu, 16 May 2024 08:21:55 -0600 Subject: [PATCH] trailing commas --- cupid/build.py | 2 +- cupid/run.py | 14 +++++++------- cupid/util.py | 4 ++-- examples/nblibrary/ice/plot_diff.py | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cupid/build.py b/cupid/build.py index 68fdb67..5a09bdd 100755 --- a/cupid/build.py +++ b/cupid/build.py @@ -41,7 +41,7 @@ def build(config_path): subprocess.run(["jupyter-book", "clean", f"{run_dir}/computed_notebooks/{sname}"]) subprocess.run( - ["jupyter-book", "build", f"{run_dir}/computed_notebooks/{sname}", "--all"] + ["jupyter-book", "build", f"{run_dir}/computed_notebooks/{sname}", "--all"], ) # Originally used this code to copy jupyter book HTML to a location to host it online diff --git a/cupid/run.py b/cupid/run.py index fbdb353..3dd3d9c 100755 --- a/cupid/run.py +++ b/cupid/run.py @@ -136,7 +136,7 @@ def run( output_dir = run_dir + "/computed_notebooks/" + control["data_sources"]["sname"] temp_data_path = run_dir + "/temp_data" nb_path_root = os.path.realpath( - os.path.expanduser(control["data_sources"]["nb_path_root"]) + os.path.expanduser(control["data_sources"]["nb_path_root"]), ) ##################################################################### @@ -148,7 +148,7 @@ def run( if "path_to_cat_json" in control["data_sources"]: full_cat_path = os.path.realpath( - os.path.expanduser(control["data_sources"]["path_to_cat_json"]) + os.path.expanduser(control["data_sources"]["path_to_cat_json"]), ) full_cat = intake.open_esm_datastore(full_cat_path) @@ -160,7 +160,7 @@ def run( # This pulls out the name of the catalog from the path cat_subset_name = full_cat_path.split("/")[-1].split(".")[0] + "_subset" cat_subset.serialize( - directory=temp_data_path, name=cat_subset_name, catalog_type="file" + directory=temp_data_path, name=cat_subset_name, catalog_type="file", ) cat_path = temp_data_path + "/" + cat_subset_name + ".json" else: @@ -192,7 +192,7 @@ def run( all_nbs[nb]["output_dir"] = output_dir + "/" + comp_name elif comp_bool and not all: warnings.warn( - f"No notebooks for {comp_name} component specified in config file." + f"No notebooks for {comp_name} component specified in config file.", ) # Checking for existence of environments @@ -203,7 +203,7 @@ def run( warnings.warn( f"Environment {bad_env} specified for {nb}.ipynb could not be found;"+ f" {nb}.ipynb will not be run."+ - f"See README.md for environment installation instructions." + f"See README.md for environment installation instructions.", ) all_nbs.pop(nb) @@ -235,7 +235,7 @@ def run( all_scripts[script]["nb_path_root"] = nb_path_root + "/" + comp_name elif comp_bool and not all: warnings.warn( - f"No scripts for {comp_name} component specified in config file." + f"No scripts for {comp_name} component specified in config file.", ) # Checking for existence of environments @@ -245,7 +245,7 @@ def run( bad_env = info["kernel_name"] warnings.warn( f"Environment {bad_env} specified for {script}.py could not be found;"+ - f"{script}.py will not be run." + f"{script}.py will not be run.", ) all_scripts.pop(script) diff --git a/cupid/util.py b/cupid/util.py index 22a1e88..e740506 100644 --- a/cupid/util.py +++ b/cupid/util.py @@ -63,7 +63,7 @@ def get_control_dict(config_path): if info["kernel_name"] is None: info["kernel_name"] = "cupid-analysis" warnings.warn( - f"No conda environment specified for {nb}.ipynb and no default kernel set, will use cupid-analysis environment." + f"No conda environment specified for {nb}.ipynb and no default kernel set, will use cupid-analysis environment.", ) if info["kernel_name"] not in control["env_check"]: control["env_check"][info["kernel_name"]] = ( @@ -78,7 +78,7 @@ def get_control_dict(config_path): if info["kernel_name"] is None: info["kernel_name"] = "cupid-analysis" warnings.warn( - f"No environment specified for {script}.py and no default kernel set, will use cupid-analysis environment." + f"No environment specified for {script}.py and no default kernel set, will use cupid-analysis environment.", ) if info["kernel_name"] not in control["env_check"]: control["env_check"][info["kernel_name"]] = ( diff --git a/examples/nblibrary/ice/plot_diff.py b/examples/nblibrary/ice/plot_diff.py index d12c40a..44e0128 100644 --- a/examples/nblibrary/ice/plot_diff.py +++ b/examples/nblibrary/ice/plot_diff.py @@ -38,7 +38,7 @@ def plot_diff(field1, field2, levels, case1, case2, title, proj, TLAT, TLON): field_std = field_diff.std() this = ax.pcolormesh( - TLON, TLAT, field1, norm=norm, cmap="tab20", transform=ccrs.PlateCarree() + TLON, TLAT, field1, norm=norm, cmap="tab20", transform=ccrs.PlateCarree(), ) plt.colorbar(this, orientation="vertical", fraction=0.04, pad=0.01) plt.title(case1, fontsize=10) @@ -56,7 +56,7 @@ def plot_diff(field1, field2, levels, case1, case2, title, proj, TLAT, TLON): ax.add_feature(cfeature.LAND, zorder=100, edgecolor="k") this = ax.pcolormesh( - TLON, TLAT, field2, norm=norm, cmap="tab20", transform=ccrs.PlateCarree() + TLON, TLAT, field2, norm=norm, cmap="tab20", transform=ccrs.PlateCarree(), ) plt.colorbar(this, orientation="vertical", fraction=0.04, pad=0.01) plt.title(case2, fontsize=10)