Skip to content

Commit

Permalink
Resolve implicit-str-concat pylint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Mar 4, 2025
1 parent 6cbf4fa commit b1be486
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion python/ctsm/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def lon_range_0_to_360(lon_in):
if -180 <= lon_in < 0:
lon_out = lon_in % 360
logger.info(
"Resetting longitude from %s to %s to keep in the range " " 0 to 360",
"Resetting longitude from %s to %s to keep in the range 0 to 360",
str(lon_in),
str(lon_out),
)
Expand Down
4 changes: 1 addition & 3 deletions python/ctsm/subset_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,7 @@ def setup_user_mods(user_mods_dir, cesmroot):
for line in basefile:
user_file.write(line)

nl_datm_base = os.path.join(
cesmroot, "components/cdeps/datm/cime_config" "/user_nl_datm_streams"
)
nl_datm_base = os.path.join(cesmroot, "components/cdeps/datm/cime_config/user_nl_datm_streams")
nl_datm = os.path.join(user_mods_dir, "user_nl_datm_streams")
with open(nl_datm_base, "r") as base_file, open(nl_datm, "w") as user_file:
for line in base_file:
Expand Down
20 changes: 9 additions & 11 deletions python/ctsm/toolchain/gen_mksurfdata_namelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,19 +630,19 @@ def write_nml_rawinput(
mksrf_furban = mksrf_furban.replace("%y", str(start_year))
if not os.path.isfile(mksrf_fvegtyp):
print("WARNING: input mksrf_fvegtyp file " f"{mksrf_fvegtyp} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True
if not os.path.isfile(mksrf_fhrvtyp):
print("WARNING: input mksrf_fhrvtyp file " f"{mksrf_fhrvtyp} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True
if not os.path.isfile(mksrf_fpctlak):
print("WARNING: input mksrf_fpctlak file " f"{mksrf_fpctlak} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True
if not os.path.isfile(mksrf_furban):
print("WARNING: input mksrf_furban file " f"{mksrf_furban} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True
nlfile.write(f" mksrf_fvegtyp = '{mksrf_fvegtyp}' \n")
nlfile.write(f" mksrf_fvegtyp_mesh = '{mksrf_fvegtyp_mesh}' \n")
Expand Down Expand Up @@ -683,15 +683,15 @@ def handle_transient_run(
landuse_input_fnam3 = file3.replace("%y", year_str)
if not os.path.isfile(landuse_input_fname):
print("WARNING: landunit_input_fname: " f"{landuse_input_fname} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True
if not os.path.isfile(landuse_input_fnam2):
print("WARNING: landunit_input_fnam2: " f"{landuse_input_fnam2} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True
if not os.path.isfile(landuse_input_fnam3):
print("WARNING: landunit_input_fnam3: " f"{landuse_input_fnam3} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True

# -- Each line is written twice in the original perl code:
Expand Down Expand Up @@ -812,17 +812,15 @@ def determine_input_rawdata(start_year, input_path, attribute_list):
f"{rawdata_files[child1.tag]} for {child1.tag} "
"does not exist"
)
print(
"WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES"
)
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True

if item.tag == "mesh_filename":
new_key = f"{child1.tag}_mesh"
rawdata_files[new_key] = os.path.join(input_path, item.text)
if not os.path.isfile(rawdata_files[new_key]):
print("WARNING: input mesh file " f"{rawdata_files[new_key]} does not exist")
print("WARNING: run ./download_input_data to try TO " "OBTAIN MISSING FILES")
print("WARNING: run ./download_input_data to try TO OBTAIN MISSING FILES")
must_run_download_input_data = True

if item.tag == "lake_filename":
Expand Down

0 comments on commit b1be486

Please sign in to comment.