Skip to content

Commit

Permalink
trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing committed May 16, 2024
1 parent f6be20b commit 8989d74
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cupid/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions cupid/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
)

#####################################################################
Expand All @@ -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)

Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions cupid/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]] = (
Expand All @@ -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"]] = (
Expand Down
4 changes: 2 additions & 2 deletions examples/nblibrary/ice/plot_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 8989d74

Please sign in to comment.