From a5599747b09a6ff22464c159c4601eb28852724b Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Tue, 19 Nov 2024 04:19:34 +1300 Subject: [PATCH] refactor: fix long lines to resolve check E501 (#2061) This refactor resolves long line checks. See ruff check code E501 for more. --- autotest/framework.py | 11 +++-- autotest/prt_test_utils.py | 9 ++-- autotest/test_chf_dfw_loop.py | 2 +- autotest/test_chf_dfw_swrt2.py | 2 +- autotest/test_chf_dfw_swrt2b.py | 2 +- autotest/test_gwe_bad_input.py | 3 +- autotest/test_gwe_cnd.py | 3 +- autotest/test_gwe_drycell_cnd0.py | 3 +- autotest/test_gwe_drycell_cnd1.py | 9 ++-- autotest/test_gwe_drycell_cnd2.py | 14 ++++--- autotest/test_gwe_drycell_cnd4.py | 3 +- autotest/test_gwe_esl01.py | 3 +- autotest/test_gwe_esl02.py | 3 +- autotest/test_gwe_esl_analyt_sln.py | 9 ++-- autotest/test_gwe_split_analyt.py | 7 ++-- autotest/test_gwe_stallman.py | 3 +- autotest/test_gwe_uze00.py | 3 +- autotest/test_gwe_vs_gwt.py | 11 +++-- autotest/test_gwegwe_exchng_with_comp2gwt.py | 12 ++++-- autotest/test_gwf_ats_lak01.py | 5 ++- autotest/test_gwf_auxvars.py | 9 ++-- autotest/test_gwf_buy_sfr01.py | 3 +- autotest/test_gwf_csub_distypes.py | 3 +- autotest/test_gwf_disv_uzf.py | 18 +++----- autotest/test_gwf_errors.py | 2 +- autotest/test_gwf_exgmvr01.py | 3 +- autotest/test_gwf_ifmod_xt3d01.py | 3 +- autotest/test_gwf_lak_bedleak.py | 3 +- autotest/test_gwf_lak_status.py | 3 +- autotest/test_gwf_laket.py | 7 +++- autotest/test_gwf_maw10.py | 28 +++++++++---- autotest/test_gwf_multimvr.py | 3 +- autotest/test_gwf_npf_thickstrt.py | 18 ++++---- autotest/test_gwf_npf_tvk04.py | 5 ++- autotest/test_gwf_npf_tvk05.py | 3 +- autotest/test_gwf_sfr_evap.py | 3 +- autotest/test_gwf_sfr_gwdischarge.py | 3 +- autotest/test_gwf_sfr_inactive02.py | 3 +- autotest/test_gwf_sfr_kinematic01.py | 3 +- autotest/test_gwf_sfr_tbedk.py | 3 +- autotest/test_gwf_vsc03_sfr.py | 2 +- autotest/test_gwt_adv_ats.py | 7 ++-- autotest/test_gwt_disu01.py | 5 ++- autotest/test_gwt_lkt01.py | 4 +- autotest/test_gwt_lkt02.py | 3 +- autotest/test_gwt_lkt03.py | 3 +- autotest/test_gwt_lkt04.py | 4 +- autotest/test_gwt_mvt01.py | 10 +++-- autotest/test_gwt_mvt02.py | 6 ++- autotest/test_gwt_mvt02fmi.py | 6 ++- autotest/test_gwt_mwt01.py | 6 ++- autotest/test_gwt_prudic2004t2.py | 15 ++++--- autotest/test_gwt_sft01.py | 6 ++- autotest/test_gwt_sft01gwtgwt.py | 5 ++- autotest/test_gwt_sft_inactive01.py | 9 ++-- autotest/test_gwt_uzt01.py | 6 ++- autotest/test_gwt_uztmvt2x2.py | 3 +- autotest/test_netcdf_gwt_dsp01.py | 5 ++- autotest/test_netcdf_gwt_prudic2004t2.py | 5 ++- autotest/test_olf_dfw_swrt2dis.py | 2 +- autotest/test_par_gwf_splitter01.py | 7 ++-- autotest/test_prt_stop_zones.py | 4 +- autotest/test_prt_track_events.py | 4 +- autotest/test_prt_weak_sinks.py | 7 +++- distribution/benchmark.py | 8 ++-- distribution/build_docs.py | 12 +++--- distribution/update_version.py | 43 ++++++++++++-------- doc/ReleaseNotes/mk_deprecations.py | 2 +- doc/ReleaseNotes/mk_runtimecomp.py | 5 ++- doc/mf6io/mf6ivar/deprecations.py | 10 ++++- doc/mf6io/mf6ivar/mf6ivar.py | 24 +++++++---- ruff.toml | 3 +- utils/idmloader/scripts/dfn2f90.py | 8 ++-- 73 files changed, 310 insertions(+), 182 deletions(-) diff --git a/autotest/framework.py b/autotest/framework.py index 1a1bc8e371e..484e4b1b8af 100644 --- a/autotest/framework.py +++ b/autotest/framework.py @@ -724,7 +724,8 @@ def run(self): shutil.rmtree(cmp_path) if self.verbose: print( - f"Copying simulation files from {self.workspace} to {cmp_path}" + "Copying simulation files " + f"from {self.workspace} to {cmp_path}" ) shutil.copytree(self.workspace, cmp_path) @@ -732,11 +733,13 @@ def run(self): if self.compare in ["mf6_regression", "libmf6"]: if self.compare not in self.targets: warn( - f"Couldn't find comparison program '{self.compare}', skipping comparison" + f"Couldn't find comparison program '{self.compare}', " + "skipping comparison" ) else: - # todo: don't hardcode workspace or assume agreement with test case - # simulation workspace, set & access simulation workspaces directly + # todo: don't hardcode workspace or assume agreement with + # test case simulation workspace, set & access simulation + # workspaces directly workspace = self.workspace / self.compare success, _ = self._run_sim_or_model( workspace, diff --git a/autotest/prt_test_utils.py b/autotest/prt_test_utils.py index 638112250b2..03385ce1d80 100644 --- a/autotest/prt_test_utils.py +++ b/autotest/prt_test_utils.py @@ -238,12 +238,13 @@ def check_track_data( data_csv = np.array([data_csv]) # check shape - assert ( - data_bin.shape == data_csv.shape - ), f"Binary and CSV track data shapes do not match: {data_bin.shape} != {data_csv.shape}" + assert data_bin.shape == data_csv.shape, ( + "Binary and CSV track data shapes do not match: " + f"{data_bin.shape} != {data_csv.shape}" + ) # check each column separately to avoid TypeError: - # The DType could not be promoted by + # The DType could not be promoted by # noqa for k in data_bin.dtype.names: if k == "name": continue diff --git a/autotest/test_chf_dfw_loop.py b/autotest/test_chf_dfw_loop.py index 002737da778..2ca210be87c 100644 --- a/autotest/test_chf_dfw_loop.py +++ b/autotest/test_chf_dfw_loop.py @@ -392,7 +392,7 @@ def make_plot(test): ) ax.plot(answer_flow["TOTIME"], answer_flow["FLOW45"], "b-", label="SWR Gauge 4") ax.plot(answer_flow["TOTIME"], answer_flow["FLOW56"], "g-", label="SWR Gauge 5") - # ax.plot(obsvals["time"], answer["STAGE0000000014"], marker="o", mfc="none", mec="k", lw=0., label="swr") + # ax.plot(obsvals["time"], answer["STAGE0000000014"], marker="o", mfc="none", mec="k", lw=0., label="swr") # noqa ax.set_xscale("log") plt.xlabel("time, in seconds") plt.ylabel("flow, in cubic meters per second") diff --git a/autotest/test_chf_dfw_swrt2.py b/autotest/test_chf_dfw_swrt2.py index bd3883b4f97..354defd9792 100644 --- a/autotest/test_chf_dfw_swrt2.py +++ b/autotest/test_chf_dfw_swrt2.py @@ -187,7 +187,7 @@ def make_plot(test, mfsim): lw=0.0, label=f"MF6 reach {irch}", ) - # ax.plot(obsvals["time"], answer[f"STAGE00000000{irch:02d}"], "k-", label=f"SWR Reach {irch}") + # ax.plot(obsvals["time"], answer[f"STAGE00000000{irch:02d}"], "k-", label=f"SWR Reach {irch}") # noqa ax.set_xlim(0, 30.0) ax.set_ylim(1.2, 2.4) plt.xlabel("time, in hours") diff --git a/autotest/test_chf_dfw_swrt2b.py b/autotest/test_chf_dfw_swrt2b.py index 95e556f0185..40889d7086a 100644 --- a/autotest/test_chf_dfw_swrt2b.py +++ b/autotest/test_chf_dfw_swrt2b.py @@ -194,7 +194,7 @@ def make_plot(test, mfsim): lw=0.0, label=f"MF6 reach {irch}", ) - # ax.plot(obsvals["time"], answer[f"STAGE00000000{irch:02d}"], "k-", label=f"SWR Reach {irch}") + # ax.plot(obsvals["time"], answer[f"STAGE00000000{irch:02d}"], "k-", label=f"SWR Reach {irch}") # noqa ax.set_xlim(0, 30.0) ax.set_ylim(1.2, 2.4) plt.xlabel("time, in hours") diff --git a/autotest/test_gwe_bad_input.py b/autotest/test_gwe_bad_input.py index 0b4e19d2e1e..3928100da6e 100644 --- a/autotest/test_gwe_bad_input.py +++ b/autotest/test_gwe_bad_input.py @@ -277,7 +277,8 @@ def build_gwe_model(idx, sim, gwename, side="left"): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) rhow_mf6 = rhow[0] if idx > 0 and side == "right": # Set a parameter value that should trip a failure diff --git a/autotest/test_gwe_cnd.py b/autotest/test_gwe_cnd.py index 2ee8b491276..e2528a16b99 100644 --- a/autotest/test_gwe_cnd.py +++ b/autotest/test_gwe_cnd.py @@ -300,7 +300,8 @@ def build_models(idx, test): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, save_flows=True, diff --git a/autotest/test_gwe_drycell_cnd0.py b/autotest/test_gwe_drycell_cnd0.py index e4b5fe4febb..3fed37ffa44 100644 --- a/autotest/test_gwe_drycell_cnd0.py +++ b/autotest/test_gwe_drycell_cnd0.py @@ -284,7 +284,8 @@ def build_models(idx, test): filename=f"{gwename1}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe1, save_flows=True, diff --git a/autotest/test_gwe_drycell_cnd1.py b/autotest/test_gwe_drycell_cnd1.py index f6c42b75a44..0610107f8a9 100644 --- a/autotest/test_gwe_drycell_cnd1.py +++ b/autotest/test_gwe_drycell_cnd1.py @@ -62,7 +62,8 @@ def isMonotonic(A): cases = [ "drycell2-a", # 2-cell model, horizontally connected with tops and bots aligned "drycell2-b", # 2-cell model, vertically connected - "drycell2-c", # 2-cell model, horizontally connected with staggered alignment (reduced shared cell face area) + "drycell2-c", # 2-cell model, horizontally connected with staggered alignment + # (reduced shared cell face area) ] conn_types = ( @@ -324,7 +325,8 @@ def build_models(idx, test): filename=f"{gwename1}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe1, save_flows=True, @@ -449,7 +451,8 @@ def check_output(idx, test): assert isMonotonic(np.diff(conc1[12:, 0, 0, 0])), msg3 assert isMonotonic(np.diff(conc1[12:, idxl, idxr, idxc])), msg2 - # Ensure that the equilibrated temperature is half the starting difference between the cells + # Ensure that the equilibrated temperature is half the starting difference + # between the cells msg4 = ( "The final equilibrated cell temperature does not split the " "difference of the starting temperature" diff --git a/autotest/test_gwe_drycell_cnd2.py b/autotest/test_gwe_drycell_cnd2.py index 2e72fdc9919..e8bbf3bc469 100644 --- a/autotest/test_gwe_drycell_cnd2.py +++ b/autotest/test_gwe_drycell_cnd2.py @@ -40,7 +40,7 @@ | | | | +-------+ -""" +""" # noqa # Imports @@ -107,7 +107,8 @@ def isMonotonic(A): iconvert = 1 # All cells are convertible bot_r1 = np.zeros(ncol).tolist() -# This is the head solution for row 1, so round up to ensure neighboring cells remain dry +# This is the head solution for row 1, so round up to +# ensure neighboring cells remain dry r2 = [ 6.99850, 6.78111, @@ -172,7 +173,8 @@ def isMonotonic(A): ghb_temp = 4.0 ghb_conc_warmup = 30.0 ghb_temp_warmup = 30.0 -# left boundary: cellid, elv, cond, conc, temp; right bnd: cellid, elv, cond, conc, temp +# left boundary: cellid, elv, cond, conc, temp +# right boundary: cellid, elv, cond, conc, temp ghbspd = { # Steady state stress period 0: [ @@ -361,7 +363,8 @@ def build_models(idx, test): filename=f"{gwtname}.dsp", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGwtmst( gwt, porosity=prsity, @@ -473,7 +476,8 @@ def build_models(idx, test): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, save_flows=True, diff --git a/autotest/test_gwe_drycell_cnd4.py b/autotest/test_gwe_drycell_cnd4.py index fc91f08be72..cc838d34570 100644 --- a/autotest/test_gwe_drycell_cnd4.py +++ b/autotest/test_gwe_drycell_cnd4.py @@ -335,7 +335,8 @@ def add_gwe_model(sim, gwename): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, save_flows=True, diff --git a/autotest/test_gwe_esl01.py b/autotest/test_gwe_esl01.py index 6d24a90f36f..c67805c6f18 100644 --- a/autotest/test_gwe_esl01.py +++ b/autotest/test_gwe_esl01.py @@ -255,7 +255,8 @@ def build_models(idx, test): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, save_flows=True, diff --git a/autotest/test_gwe_esl02.py b/autotest/test_gwe_esl02.py index 0edeae16afa..6cdb1ac78ab 100644 --- a/autotest/test_gwe_esl02.py +++ b/autotest/test_gwe_esl02.py @@ -258,7 +258,8 @@ def build_models(idx, test): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, save_flows=True, diff --git a/autotest/test_gwe_esl_analyt_sln.py b/autotest/test_gwe_esl_analyt_sln.py index 979e60f6d9d..7ba2df49ab7 100644 --- a/autotest/test_gwe_esl_analyt_sln.py +++ b/autotest/test_gwe_esl_analyt_sln.py @@ -47,7 +47,7 @@ Specified temperature boundary, T_0 -""" +""" # noqa import math import os @@ -339,7 +339,8 @@ def build_models(idx, test, ener_input): ) # Constant temperature - # Note: Implementation of the CTP boundary depends on which analytical sln is in view + # Note: Implementation of the CTP boundary depends on which analytical sln + # is in view # See notes at top of script regarding scenarios if idx > 0: if idx == 1: @@ -502,7 +503,7 @@ def check_output(idx, test, ener_input): assert np.allclose( analytical_temps, sim_temps[sp, 0, 0, :], atol=0.005 ), "simulated solution is whacked" - # plt.plot(cell_centroids, analytical_temps, "r-", label="Analytical Solution") + # plt.plot(cell_centroids, analytical_temps, "r-", label="Analytical Solution") # noqa # plt.plot(cell_centroids, sim_temps[sp, 0, 0, :], "b--", label="GWE") # plt.axhline(0.0, color='black') # plt.legend() @@ -533,7 +534,7 @@ def check_output(idx, test, ener_input): analytical_temps, sim_temps[sp, 0, 0, :], atol=atol ), "simulated solution is whacked" - # plt.plot(cell_centroids, analytical_temps, "r-", label="Analytical Solution") + # plt.plot(cell_centroids, analytical_temps, "r-", label="Analytical Solution") # noqa # plt.plot(cell_centroids, sim_temps[sp, 0, 0, :], "b--", label="GWE") # plt.axhline(0.0, color='black') # plt.legend() diff --git a/autotest/test_gwe_split_analyt.py b/autotest/test_gwe_split_analyt.py index d48ab5d80ad..0b9eeb04ed4 100644 --- a/autotest/test_gwe_split_analyt.py +++ b/autotest/test_gwe_split_analyt.py @@ -49,7 +49,7 @@ Specified temperature boundary, T_0 -""" +""" # noqa import math import os @@ -275,7 +275,8 @@ def get_gwe_model(idx, sim, gwename, gwepath, ener_input, side="right"): ) # Constant temperature goes on the left side of the left model - # Note: Implementation of the CTP boundary depends on which analytical sln is in view + # Note: Implementation of the CTP boundary depends on which analytical sln + # is in view # See notes at top of script regarding scenarios if side == "left": if idx > 0: @@ -577,7 +578,7 @@ def check_output(idx, test): assert np.allclose( analytical_temps, sim_temps[sp, 0, 0, :], atol=0.005 ), "simulated solution is whacked" - # plt.plot(cell_centroids, analytical_temps, "r-", label="Analytical Solution") + # plt.plot(cell_centroids, analytical_temps, "r-", label="Analytical Solution") # noqa # plt.plot(cell_centroids, sim_temps[sp, 0, 0, :], "b--", label="GWE") # plt.axhline(0.0, color='black') # plt.legend() diff --git a/autotest/test_gwe_stallman.py b/autotest/test_gwe_stallman.py index 3b7d5d8a08c..6f103820604 100644 --- a/autotest/test_gwe_stallman.py +++ b/autotest/test_gwe_stallman.py @@ -281,7 +281,8 @@ def build_models(idx, test): filename=f"{gwename}.dsp", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, porosity=porosity, diff --git a/autotest/test_gwe_uze00.py b/autotest/test_gwe_uze00.py index bf9cced73c9..c943edd753e 100644 --- a/autotest/test_gwe_uze00.py +++ b/autotest/test_gwe_uze00.py @@ -483,7 +483,8 @@ def check_output(idx, test): assert np.allclose(analytical_sln[10, 38:], temps[10, 0, 0, 38:]), msg0 # Compare day 50. For layer 84 and below, the defaults of allclose should work assert np.allclose(analytical_sln[50, 83:], temps[50, 0, 0, 83:]), msg0 - # Compare day 100, fits are generally good, but do not pass allclose default settings + # Compare day 100, fits are generally good, + # but do not pass allclose default settings # Ensure that the differences in the 1st day fall within established bounds msg1 = ( diff --git a/autotest/test_gwe_vs_gwt.py b/autotest/test_gwe_vs_gwt.py index c7a92703d08..983743ad609 100644 --- a/autotest/test_gwe_vs_gwt.py +++ b/autotest/test_gwe_vs_gwt.py @@ -121,7 +121,7 @@ tdis_rc = [] tdis_rc.append((perlen, nstp, 1.0)) -# ### Functions to build, write, and run models and plot MT3DMS Example 10 Problem results +## Functions to build, write, and run models and plot MT3DMS Example 10 Problem results # # MODFLOW 6 flopy simulation object (sim) is returned if building the model @@ -201,7 +201,8 @@ def build_models(idx, test): filename=f"{gwfname}.npf", ) - # Instantiating MODFLOW 6 storage package (steady flow conditions, so no actual storage, using to print values in .lst file) + # Instantiating MODFLOW 6 storage package (steady flow conditions, + # so no actual storage, using to print values in .lst file) flopy.mf6.ModflowGwfsto(gwf, ss=0, sy=0, pname="STO-1", filename=f"{gwfname}.sto") # Instantiating MODFLOW 6 initial conditions package for flow model @@ -307,7 +308,8 @@ def build_models(idx, test): filename=f"{gwename}.cnd", ) - # Instantiating MODFLOW 6 heat transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 heat transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGweest( gwe, porosity=prsity, @@ -412,7 +414,8 @@ def build_models(idx, test): filename=f"{gwtname}.dsp", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGwtmst( gwt, porosity=prsity, diff --git a/autotest/test_gwegwe_exchng_with_comp2gwt.py b/autotest/test_gwegwe_exchng_with_comp2gwt.py index 8183e80c9b6..42ef4c4cdc5 100644 --- a/autotest/test_gwegwe_exchng_with_comp2gwt.py +++ b/autotest/test_gwegwe_exchng_with_comp2gwt.py @@ -1,5 +1,6 @@ """ -Two-Dimensional Heat Transport (GWE) in a Radial Flow Field with Comparison to a MODFLOW 6 GWT model +Two-Dimensional Heat Transport (GWE) in a Radial Flow Field with Comparison +to a MODFLOW 6 GWT model The purpose of this script is to test the new heat transport model developed for MODFLOW 6. To that end, this problem uses the setup of the fifth MT3DMS @@ -493,7 +494,8 @@ def add_energy(sim): filename="gwesolver.ims", ) - # Set the advection scheme, it is needed by both gwe model instantiation and gwegwe exchange + # Set the advection scheme, it is needed by both gwe model instantiation + # and gwegwe exchange if mixelm >= 0: scheme = "UPSTREAM" elif mixelm == -1: @@ -702,7 +704,8 @@ def add_transport(sim): filename="gwtsolver.ims", ) - # Set the advection scheme, it is needed by both gwe model instantiation and gwegwe exchange + # Set the advection scheme, it is needed by both gwe model instantiation + # and gwegwe exchange if mixelm >= 0: scheme = "UPSTREAM" elif mixelm == -1: @@ -933,7 +936,8 @@ def check_output(idx, test): elif idomain_ll[k, i, j] > 0: stitched_temps[i, j] = temp_ll[tm, k, i, j] - # Stitch together the "concentrations" (which represent temperatures) from the upper-right and lower-left models + # Stitch together the "concentrations" (which represent temperatures) + # from the upper-right and lower-left models tm = k = 0 stitched_conc = np.zeros((nrow, ncol)) for i in np.arange(nrow): diff --git a/autotest/test_gwf_ats_lak01.py b/autotest/test_gwf_ats_lak01.py index 118e8766801..a7fecc5fd0c 100644 --- a/autotest/test_gwf_ats_lak01.py +++ b/autotest/test_gwf_ats_lak01.py @@ -342,7 +342,10 @@ def compare_listbudget_and_budgetcsv(listfile, budcsvfile, verbose, check, atol) allclose = np.allclose( budcsvcum[name2][1:], budlstcum[name1], atol=atol ) - msg = f"{name2} is same: {allclose}. Min diff: {mindiff} Max diff {maxdiff}" + msg = ( + f"{name2} is same: {allclose}. " + f"Min diff: {mindiff} Max diff {maxdiff}" + ) if verbose: print(msg) allclose_list.append((allclose, name1, mindiff, maxdiff, msg)) diff --git a/autotest/test_gwf_auxvars.py b/autotest/test_gwf_auxvars.py index 575a96c8d3a..863d3922340 100644 --- a/autotest/test_gwf_auxvars.py +++ b/autotest/test_gwf_auxvars.py @@ -118,7 +118,8 @@ def build_models(idx, test): ) # maw.remove() - # [] [] + # ... + # [] [] packagedata = [ [ 0, @@ -175,7 +176,8 @@ def build_models(idx, test): [0, 100.0, 1, auxvar1, auxvar2, "lake1"], [1, 100.0, 1, auxvar1, auxvar2, "lake2"], ] - # + # ... + # connectiondata = [ [0, 0, (0, 1, 1), "vertical", DNODATA, 0.0, 0.0, 0.0, 0.0], [1, 0, (0, 2, 2), "vertical", DNODATA, 0.0, 0.0, 0.0, 0.0], @@ -196,7 +198,8 @@ def build_models(idx, test): ) # lak.remove() - # [] + # ... + # [] packagedata = [ [0, (0, nrow - 1, 5), 1, -1, 0.1, 0.01, 0.01, 0.1, 0.01, 3.5, "uz1"], [1, (0, nrow - 1, 6), 1, -1, 0.1, 0.01, 0.01, 0.1, 0.01, 3.5, "uz1"], diff --git a/autotest/test_gwf_buy_sfr01.py b/autotest/test_gwf_buy_sfr01.py index 74835dfd498..815f426206d 100644 --- a/autotest/test_gwf_buy_sfr01.py +++ b/autotest/test_gwf_buy_sfr01.py @@ -143,7 +143,8 @@ def build_models(idx, test): filename=f"{gwfname}.wel", ) - # pak_data = [ [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 diff --git a/autotest/test_gwf_csub_distypes.py b/autotest/test_gwf_csub_distypes.py index cf78147ac46..eaa4381f94f 100644 --- a/autotest/test_gwf_csub_distypes.py +++ b/autotest/test_gwf_csub_distypes.py @@ -97,7 +97,8 @@ def get_interbed(modelgrid): package_data.append( ( ifno, - cellid, # will need to be detuplaized with *cellid - does not work for dis + # will need to be detuplaized with *cellid - does not work for dis + cellid, "nodelay", ini_stress, modelgrid.cell_thickness[cellid], diff --git a/autotest/test_gwf_disv_uzf.py b/autotest/test_gwf_disv_uzf.py index 7a0cb9c633b..4144f12d5cf 100644 --- a/autotest/test_gwf_disv_uzf.py +++ b/autotest/test_gwf_disv_uzf.py @@ -340,13 +340,9 @@ def check_output(idx, test): fullrw = arr[rw] for cl in np.arange(len(fullrw) - 1): assert abs(fullrw[cl]) <= abs(fullrw[cl + 1]) + 0.01, ( - "gwet not decreasing to the right as expected. Stress Period: " - + str(tm + 1) - + "; Row: " - + str(rw + 1) - + "; Col: " - + str(cl + 1) - + f"{fullrw[cl]} should be less than or equal to {abs(fullrw[cl + 1])}" + "gwet not decreasing to the right as expected. " + f"Stress Period: {tm + 1}; Row: {rw + 1}; Col: {cl + 1}" + f"\n{fullrw[cl]} should be <= to {abs(fullrw[cl + 1])}" ) # Confirm that total simulated ET does not exceed potential ET. @@ -358,12 +354,8 @@ def check_output(idx, test): for rw in np.arange(total_et.shape[1]): for cl in np.arange(total_et.shape[2]): assert total_et[tm, rw, cl] <= pet, ( - "simulated ET exceeds user-specified potential ET. Stress Period: " - + str(tm + 1) - + "; Row: " - + str(rw + 1) - + "; Col: " - + str(cl + 1) + "simulated ET exceeds user-specified potential ET. " + f"Stress Period: {tm + 1}; Row: {rw + 1}; Col: {cl + 1}" ) print("Finished running checks") diff --git a/autotest/test_gwf_errors.py b/autotest/test_gwf_errors.py index a81ae1fb8ff..273a3573283 100644 --- a/autotest/test_gwf_errors.py +++ b/autotest/test_gwf_errors.py @@ -186,7 +186,7 @@ def test_disu_errors(function_tmpdir, targets): ) sim.write_simulation() err_str = [ - "1. Top elevation ( 2.00000 ) for cell 10 is above bottom elevation (", + "1. Top elevation ( 2.00000 ) for cell 10 is above bottom elevation (", # noqa "-1.00000 ) for cell 1. Based on node numbering rules cell 10 must be", "below cell 1.", "UNIT ERROR REPORT:1. ERROR OCCURRED WHILE READING FILE './test.disu'", diff --git a/autotest/test_gwf_exgmvr01.py b/autotest/test_gwf_exgmvr01.py index 33c19eca535..4656656f428 100644 --- a/autotest/test_gwf_exgmvr01.py +++ b/autotest/test_gwf_exgmvr01.py @@ -127,7 +127,8 @@ def build_gwf(sim, gwf_type="single"): pname="well_left", ) - # pak_data = [ [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 diff --git a/autotest/test_gwf_ifmod_xt3d01.py b/autotest/test_gwf_ifmod_xt3d01.py index 6f4c3a9d9f2..8f7179116dd 100644 --- a/autotest/test_gwf_ifmod_xt3d01.py +++ b/autotest/test_gwf_ifmod_xt3d01.py @@ -452,7 +452,8 @@ def exact(x): )[0] child_exchange_flows = child_exchange_flows["q"] - # Ensure observations are the same as parent exchange flows and negative child exchange flows + # Ensure observations are the same as parent exchange flows + # and negative child exchange flows assert np.allclose( obsvalues, parent_exchange_flows ), "exchange observations do not match parent exchange flows" diff --git a/autotest/test_gwf_lak_bedleak.py b/autotest/test_gwf_lak_bedleak.py index b5ef4dc3253..1ccb1d31a77 100644 --- a/autotest/test_gwf_lak_bedleak.py +++ b/autotest/test_gwf_lak_bedleak.py @@ -117,7 +117,8 @@ def build_models(idx, test): [0, 100.0, 1, "lake1"], [1, 100.0, 1, "lake2"], ] - # + # ... + # connectiondata = [ [0, 0, (0, 1, 1), "vertical", bedleak, 0.0, 0.0, 0.0, 0.0], [1, 0, (0, 2, 2), "vertical", bedleak, 0.0, 0.0, 0.0, 0.0], diff --git a/autotest/test_gwf_lak_status.py b/autotest/test_gwf_lak_status.py index b46008e7ce6..53c964bcc21 100644 --- a/autotest/test_gwf_lak_status.py +++ b/autotest/test_gwf_lak_status.py @@ -131,7 +131,8 @@ def build_models(idx, test): packagedata = [ [0, 100.0, 9, "lake1"], ] - # + # ... + # bedleak = 1.0 connectiondata = [ [0, 0, (0, 3, 3), "vertical", bedleak, 0.0, 0.0, 0.0, 0.0], diff --git a/autotest/test_gwf_laket.py b/autotest/test_gwf_laket.py index c1ef9630384..1b97441afa3 100644 --- a/autotest/test_gwf_laket.py +++ b/autotest/test_gwf_laket.py @@ -160,7 +160,12 @@ def get_model(idx, ws): (0, 0, 0, strt[idx], 1000.0), ], ) - # chd = flopy.mf6.modflow.ModflowGwfchd(gwf, stress_period_data=[(0, 0, 0, strt[idx]),]) + # chd = flopy.mf6.modflow.ModflowGwfchd( + # gwf, + # stress_period_data=[ + # (0, 0, 0, strt[idx]), + # ], + # ) # output control oc = flopy.mf6.ModflowGwfoc( diff --git a/autotest/test_gwf_maw10.py b/autotest/test_gwf_maw10.py index 83b7bcf70c3..92ea7e6a5f2 100644 --- a/autotest/test_gwf_maw10.py +++ b/autotest/test_gwf_maw10.py @@ -53,9 +53,15 @@ # simple single stress period without going inactive in 2nd stress period # mawsetting_a = [(0, "rate", -2000.0), (0, "head_limit", -0.4)] -# mawsetting_b = [[(0, "rate", -2000.0), (0, "rate_scaling", -1.4, 1.0)], ["status", "inactive"]] +# mawsetting_b = [ +# [(0, "rate", -2000.0), (0, "rate_scaling", -1.4, 1.0)], +# ["status", "inactive"], +# ] # mawsetting_c = [[(0, "rate", 2000.0), (0, "head_limit", 0.4)], ["status", "inactive"]] -# mawsetting_d = [[(0, "rate", 2000.0), (0, "rate_scaling", 0.0, 1.0)], ["status", "inactive"]] +# mawsetting_d = [ +# [(0, "rate", 2000.0), (0, "rate_scaling", 0.0, 1.0)], +# ["status", "inactive"], +# ] mawsettings = [mawsetting_a, mawsetting_b, mawsetting_c, mawsetting_d] @@ -203,8 +209,8 @@ def build_models(idx, test): # 2 tests to perform here: # 1. within the .maw-reduction.csv file, do values of actual + reduction = requested? -# 2. do the values in .maw-reduction.csv file match with the .maw.obs.csv file at each time -# (and all are reduction times present in the obs file)? +# 2. do the values in .maw-reduction.csv file match with the .maw.obs.csv file at +# each time (and all are reduction times present in the obs file)? def check_output(idx, test): # MODFLOW 6 maw results name = cases[idx] @@ -219,16 +225,20 @@ def check_output(idx, test): except: assert False, f'could not load data from "{fpthmfr}"' - # test 1: does rate-requested = rate-actual + maw-reduction at each time in the .maw.reduced.csv? + # test 1: does rate-requested = rate-actual + maw-reduction at each time + # in the .maw.reduced.csv? for rowmfr in tcmfr: v1 = rowmfr["rate-requested"] v2 = rowmfr["rate-actual"] + rowmfr["maw-reduction"] - errmsg = "MAW flow reduction output: requested rate must equal actual rate plus reduced rate.\n" - errmsg += f"{v1} /= {v2}" + errmsg = ( + "MAW flow reduction output: " + "requested rate must equal actual rate plus reduced rate.\n" + f"{v1} /= {v2}" + ) assert np.allclose(v1, v2), errmsg - # test 2: do values of rate-actual in .maw.reduced.csv equal those flow values reported in .maw.obs.csv? - # (and are there matching times?) + # test 2: do values of rate-actual in .maw.reduced.csv equal those + # flow values reported in .maw.obs.csv? (and are there matching times?) for rowmfr in tcmfr: timevalmfr = rowmfr["time"] actvalmfr = rowmfr["rate-actual"] diff --git a/autotest/test_gwf_multimvr.py b/autotest/test_gwf_multimvr.py index 5ff38034472..8de11be4820 100644 --- a/autotest/test_gwf_multimvr.py +++ b/autotest/test_gwf_multimvr.py @@ -1020,7 +1020,8 @@ def check_output(idx, test): line = next(gwf_lst) m_arr = line.strip().split() if m_arr[0] == "18": - # store the 3rd value on the line (it should be the same across all scenarios + # store the 3rd value on the line + # (it should be the same across all scenarios) parent_sfr_last_reach_flow = float(m_arr[2]) break diff --git a/autotest/test_gwf_npf_thickstrt.py b/autotest/test_gwf_npf_thickstrt.py index 6b3892f12c6..af20f317dfb 100644 --- a/autotest/test_gwf_npf_thickstrt.py +++ b/autotest/test_gwf_npf_thickstrt.py @@ -6,15 +6,15 @@ from framework import TestFramework cases = [ - "gwf_npf_thickstrt01", # case 01 -- icelltype=0 - "gwf_npf_thickstrt02", # case 02 -- icelltype=0, using thickstrt, but it has no effect - "gwf_npf_thickstrt03", # case 03 -- icelltype=-1, using thickstrt and strt = 5. - "gwf_npf_thickstrt04", # case 04 -- icelltype=1, no thickstrt and strt = 5. - "gwf_npf_thickstrt05", # case 05 -- icelltype=-1, no thickstrt and strt = 5. - "gwf_npf_thickstrt06", # case 06 -- icelltype=0, no thickstrt, has hfb - "gwf_npf_thickstrt07", # case 07 -- icelltype=-1, using thickstrt, has hfb - "gwf_npf_thickstrt08", # case 08 -- icelltype=1, no thickstrt, has hfb - "gwf_npf_thickstrt09", # case 09 -- icelltype=-1, no thickstrt, has hfb + "gwf_npf_thickstrt01", # icelltype=0 + "gwf_npf_thickstrt02", # icelltype=0, using thickstrt, but it has no effect + "gwf_npf_thickstrt03", # icelltype=-1, using thickstrt and strt = 5. + "gwf_npf_thickstrt04", # icelltype=1, no thickstrt and strt = 5. + "gwf_npf_thickstrt05", # icelltype=-1, no thickstrt and strt = 5. + "gwf_npf_thickstrt06", # icelltype=0, no thickstrt, has hfb + "gwf_npf_thickstrt07", # icelltype=-1, using thickstrt, has hfb + "gwf_npf_thickstrt08", # icelltype=1, no thickstrt, has hfb + "gwf_npf_thickstrt09", # icelltype=-1, no thickstrt, has hfb ] thickstrt = [False, True, True, False, False, False, True, False, False] icelltype = [0, 0, -1, 1, -1, 0, -1, 1, -1] diff --git a/autotest/test_gwf_npf_tvk04.py b/autotest/test_gwf_npf_tvk04.py index 46740a10ec3..4a01667e521 100644 --- a/autotest/test_gwf_npf_tvk04.py +++ b/autotest/test_gwf_npf_tvk04.py @@ -173,7 +173,10 @@ def check_output(idx, test): # comment when done testing print(f"Total outflow in stress period 1 is {str(sp_x[0][8])}") print(f"Total outflow in stress period 2 after increasing K33 is {str(sp_x[1][8])}") - errmsg = "Expect higher flow rate in period 2 compared to period 1, but found equal or higher flow rate in period 1" + errmsg = ( + "Expect higher flow rate in period 2 compared to period 1, " + "but found equal or higher flow rate in period 1" + ) assert 2.0 * sp_x[0][8] < sp_x[1][8], errmsg diff --git a/autotest/test_gwf_npf_tvk05.py b/autotest/test_gwf_npf_tvk05.py index adac2ac4cc3..19097088e19 100644 --- a/autotest/test_gwf_npf_tvk05.py +++ b/autotest/test_gwf_npf_tvk05.py @@ -174,7 +174,8 @@ def check_output(idx, test): # comment when done testing print(f"Total outflow in stress period 1 is {str(sp_x[0][8])}") print( - "Total outflow in stress period 2 after increasing K33 should have no effect on final solution" + "Total outflow in stress period 2 after increasing K33 " + "should have no effect on final solution" ) errmsg = "Period 2 budget should be exactly the same as period 1" assert sp_x[0][8] == sp_x[1][8], errmsg diff --git a/autotest/test_gwf_sfr_evap.py b/autotest/test_gwf_sfr_evap.py index 5254d567e12..beed993477b 100644 --- a/autotest/test_gwf_sfr_evap.py +++ b/autotest/test_gwf_sfr_evap.py @@ -409,7 +409,8 @@ def check_output(idx, test): msg = "The SFR evaporation test with n-point x-section (trapezoid) is failing." assert np.allclose(stored_strm_evap, sim_evap, atol=1e-4), msg - # Now check results from standard rectangular x-section setup (not an n-point channel) + # Now check results from standard rectangular x-section setup + # (not an n-point channel) fname2 = gwfname_r + ".sfr.cbc" fname2 = os.path.join(test.workspace, fname2) assert os.path.isfile(fname2) diff --git a/autotest/test_gwf_sfr_gwdischarge.py b/autotest/test_gwf_sfr_gwdischarge.py index 740ab4dc6ee..9f870225229 100644 --- a/autotest/test_gwf_sfr_gwdischarge.py +++ b/autotest/test_gwf_sfr_gwdischarge.py @@ -56,7 +56,8 @@ def build_models(idx, test): flopy.mf6.ModflowGwfghb(gwf, stress_period_data=[((0, 0, 0), 1.0, 1e6)]) # sfr data - # + # ... + # package_data = [(0, (0, 0, 0), delr, 1.0, 1e-3, 0.0, 1.0, 1.0, 0.001, 0, 0.0, 0)] connection_data = [(0)] diff --git a/autotest/test_gwf_sfr_inactive02.py b/autotest/test_gwf_sfr_inactive02.py index 365978fb9f0..b277812b43e 100644 --- a/autotest/test_gwf_sfr_inactive02.py +++ b/autotest/test_gwf_sfr_inactive02.py @@ -71,7 +71,8 @@ def build_models(idx, test): # sfr data nreaches = 4 - # + # ... + # package_data = [ (0, (0, 0, 0), delr, 1.0, 1e-3, 0.0, 1.0, 1.0, 0.001, 1, 0.0, 0), (1, (0, 0, 0), delr, 1.0, 1e-3, 0.0, 1.0, 1.0, 0.001, 1, 1.0, 0), diff --git a/autotest/test_gwf_sfr_kinematic01.py b/autotest/test_gwf_sfr_kinematic01.py index defdcc23b5e..362adc6006c 100644 --- a/autotest/test_gwf_sfr_kinematic01.py +++ b/autotest/test_gwf_sfr_kinematic01.py @@ -98,7 +98,8 @@ def build_models(idx, test): slope = 1.0 / dx roughness = 0.03574737676661647 - # [] [] + # ... + # [] [] pak_data = [ ( ifno, diff --git a/autotest/test_gwf_sfr_tbedk.py b/autotest/test_gwf_sfr_tbedk.py index 25b44cd68ac..c66e89afaaf 100644 --- a/autotest/test_gwf_sfr_tbedk.py +++ b/autotest/test_gwf_sfr_tbedk.py @@ -74,7 +74,8 @@ def build_models(idx, test): # sfr data nreaches = 2 - # + # ... + # if idx < 2: rhk1 = 0.0 rhk2 = 0.0 diff --git a/autotest/test_gwf_vsc03_sfr.py b/autotest/test_gwf_vsc03_sfr.py index fbe2ab3d1d2..3a3f955bbf4 100644 --- a/autotest/test_gwf_vsc03_sfr.py +++ b/autotest/test_gwf_vsc03_sfr.py @@ -227,7 +227,7 @@ def build_models(idx, test): for j in np.arange(ncol): evtr = evtr_hi - (evtr_hi - evtr_lo) / ncol * j extdp = extdp_hi - (extdp_hi - extdp_lo) / ncol * j - # cellid, surface, rate, depth, [pxdp], [petm], [petm0], [aux] + # cellid, surface, rate, depth, [pxdp], [petm], [petm0], [aux] evtspd.append([(0, i, j), top[i, j], evtr, extdp, 1.0, 0.0]) surf_rate_specified = True flopy.mf6.ModflowGwfevt( diff --git a/autotest/test_gwt_adv_ats.py b/autotest/test_gwt_adv_ats.py index 4c878813c37..4cf1605d620 100644 --- a/autotest/test_gwt_adv_ats.py +++ b/autotest/test_gwt_adv_ats.py @@ -379,9 +379,10 @@ def check_output(idx, test): cres1 = np.array(cres1) diff = cres1 - conc print(f"{diff.min()=} {diff.max()=}") - assert np.allclose( - cres1, conc, atol=0.03 - ), f"simulated concentrations do not match with known solution: {diff.min()=} {diff.max()=}" + assert np.allclose(cres1, conc, atol=0.03), ( + "simulated concentrations do not match with known solution: " + f"{diff.min()=} {diff.max()=}" + ) @pytest.mark.parametrize("idx, name", enumerate(cases)) diff --git a/autotest/test_gwt_disu01.py b/autotest/test_gwt_disu01.py index ccc28c2e582..414d5a0def1 100644 --- a/autotest/test_gwt_disu01.py +++ b/autotest/test_gwt_disu01.py @@ -1,6 +1,7 @@ """ -Two-dimensional injection of solute into the middle of a square grid. The test will pass -if the results are symmetric. Based on test_gwt_adv04, this tests the disu package, which +Two-dimensional injection of solute into the middle of a square grid. +The test will pass if the results are symmetric. +Based on test_gwt_adv04, this tests the disu package, which represents a regular MODFLOW grid. """ diff --git a/autotest/test_gwt_lkt01.py b/autotest/test_gwt_lkt01.py index 012aa3b8ba9..4cf906c0233 100644 --- a/autotest/test_gwt_lkt01.py +++ b/autotest/test_gwt_lkt01.py @@ -125,7 +125,9 @@ def build_models(idx, test): filename=f"{gwfname}.chd", ) - nlakeconn = 3 # note: this is the number of connectiosn for a lake, not total number of connections + # note: this is the number of connections for a lake, + # not total number of connections + nlakeconn = 3 # pak_data = [ifno, strt, nlakeconn, CONC, dense, boundname] pak_data = [(0, -0.4, nlakeconn, 0.0, 1025.0)] diff --git a/autotest/test_gwt_lkt02.py b/autotest/test_gwt_lkt02.py index e969a47fdb8..2f3bc13592a 100644 --- a/autotest/test_gwt_lkt02.py +++ b/autotest/test_gwt_lkt02.py @@ -455,7 +455,8 @@ def check_output(idx, test): answer = np.array(answer, dtype=dt) for dtname, dttype in dt: assert np.allclose(res[dtname], answer[dtname]), f"{res} {answer}" - # check the storage terms, which include the total mass in the lake as an aux variable + # check the storage terms, which include the total mass in the lake + # as an aux variable res = bobj.get_data(text="storage")[-1] answer = [ (1, 1, -1.87036784e00, 1.05006009e-01), diff --git a/autotest/test_gwt_lkt03.py b/autotest/test_gwt_lkt03.py index 370183ca58d..fe1f450269f 100644 --- a/autotest/test_gwt_lkt03.py +++ b/autotest/test_gwt_lkt03.py @@ -361,7 +361,8 @@ def check_output(idx, test): for dtname, dttype in dt: assert np.allclose(res[dtname], answer[dtname]), f"{res} {answer}" - # check the storage terms, which include the total mass in the lake as an aux variable + # check the storage terms, which include the total mass in the lake + # as an aux variable res = bobj.get_data(text="storage")[-1] answer = [(1, 1, 0.0, 0.0), (2, 2, -0.1, 0.1), (3, 3, -1.0, 1.0)] dt = [("node", " [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 @@ -510,7 +513,8 @@ def check_output(idx, test): res = bobj.get_data(text="flow-ja-face")[-1] # print(res) - # check the storage terms, which include the total mass in the reach as an aux variable + # check the storage terms, which include the total mass in the reach + # as an aux variable res = bobj.get_data(text="storage")[-1] # print(res) diff --git a/autotest/test_gwt_mvt02.py b/autotest/test_gwt_mvt02.py index 7071f3378f3..a5b5fb02b1c 100644 --- a/autotest/test_gwt_mvt02.py +++ b/autotest/test_gwt_mvt02.py @@ -140,7 +140,8 @@ def build_models(idx, test): auxiliary="CONCENTRATION", ) - # pak_data = [ [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 @@ -461,7 +462,8 @@ def check_output(idx, test): res = bobj.get_data(text="flow-ja-face")[-1] # print(res) - # check the storage terms, which include the total mass in the reach as an aux variable + # check the storage terms, which include the total mass in the reach + # as an aux variable res = bobj.get_data(text="storage")[-1] # print(res) diff --git a/autotest/test_gwt_mvt02fmi.py b/autotest/test_gwt_mvt02fmi.py index 3912b81646c..56d1c70bbe1 100644 --- a/autotest/test_gwt_mvt02fmi.py +++ b/autotest/test_gwt_mvt02fmi.py @@ -130,7 +130,8 @@ def run_flow_model(dir, exe): auxiliary="CONCENTRATION", ) - # pak_data = [ [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 @@ -449,7 +450,8 @@ def run_transport_model(dir, exe): res = bobj.get_data(text="flow-ja-face")[-1] # print(res) - # check the storage terms, which include the total mass in the reach as an aux variable + # check the storage terms, which include the total mass in the reach + # as an aux variable res = bobj.get_data(text="storage")[-1] # print(res) diff --git a/autotest/test_gwt_mwt01.py b/autotest/test_gwt_mwt01.py index 9df3eca5eae..813ea980dcf 100644 --- a/autotest/test_gwt_mwt01.py +++ b/autotest/test_gwt_mwt01.py @@ -325,7 +325,8 @@ def check_obs(sim): if not is_same: success = False print( - "Binary concentrations do not match with observation concentrations for mwt1" + "Binary concentrations do not match with " + "observation concentrations for mwt1" ) print(conc_ra["BMWT1"], conc_mwt1) # check boundname observations with numeric ID observations @@ -356,7 +357,8 @@ def check_obs(sim): success = False diff = connection_sum - conc_ra[f"BMWT{icv + 1}"] print( - f"Problem with MWT {icv + 1}; mindiff {diff.min()} and maxdiff {diff.max()}" + f"Problem with MWT {icv + 1}; " + f"mindiff {diff.min()} and maxdiff {diff.max()}" ) assert success, "One or more MWT obs checks did not pass" diff --git a/autotest/test_gwt_prudic2004t2.py b/autotest/test_gwt_prudic2004t2.py index 28b604be701..23332013567 100644 --- a/autotest/test_gwt_prudic2004t2.py +++ b/autotest/test_gwt_prudic2004t2.py @@ -702,7 +702,8 @@ def check_obs(sim): ): print(t, x, y) - # process the sft values and make sure the individual connection rates add up to the boundname rate + # process the sft values and make sure the individual connection rates + # add up to the boundname rate csvfile = "gwt_prudic2004t2.sft.obs.flow-ja-face.csv" print(f"Checking csv file: {csvfile}") conc_ra = gwt.sft.obs.output.obs(f=csvfile).data @@ -717,10 +718,13 @@ def check_obs(sim): success = False diff = connection_sum - conc_ra[f"BSFT{ireach + 1}"] print( - f"Problem with SFT {ireach + 1}; mindiff {diff.min()} and maxdiff {diff.max()}" + f"Problem with SFT {ireach + 1}; " + f"mindiff {diff.min()} and maxdiff {diff.max()}" ) - # for itime, (cs, bsft) in enumerate(zip(connection_sum, conc_ra[f"BSFT{ireach + 1}"])): - # print(itime, cs, bsft) + # for itime, (cs, bsft) in enumerate( + # zip(connection_sum, conc_ra[f"BSFT{ireach + 1}"]) + # ): + # print(itime, cs, bsft) assert success, "One or more SFT obs checks did not pass" @@ -755,7 +759,8 @@ def check_obs(sim): ): print(t, x, y) - # process the lkt values and make sure the individual connection rates add up to the boundname rate + # process the lkt values and make sure the individual connection rates + # add up to the boundname rate csvfile = "gwt_prudic2004t2.lkt.obs.lkt.csv" print(f"Checking csv file: {csvfile}") conc_ra = gwt.lkt.obs.output.obs(f=csvfile).data diff --git a/autotest/test_gwt_sft01.py b/autotest/test_gwt_sft01.py index 60fd0a7a8d5..0d379995c4b 100644 --- a/autotest/test_gwt_sft01.py +++ b/autotest/test_gwt_sft01.py @@ -140,7 +140,8 @@ def build_models(idx, test): filename=f"{gwfname}.wel", ) - # pak_data = [ [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 @@ -399,7 +400,8 @@ def check_output(idx, test): res = bobj.get_data(text="flow-ja-face")[-1] # print(res) - # check the storage terms, which include the total mass in the reach as an aux variable + # check the storage terms, which include the total mass in the reach + # as an aux variable res = bobj.get_data(text="storage")[-1] # print(res) diff --git a/autotest/test_gwt_sft01gwtgwt.py b/autotest/test_gwt_sft01gwtgwt.py index 348dade03f6..7d6d638e493 100644 --- a/autotest/test_gwt_sft01gwtgwt.py +++ b/autotest/test_gwt_sft01gwtgwt.py @@ -15,7 +15,7 @@ sft 1 2 3 4 5 6 7 gwtgwt-mvt => 1 2 3 4 5 6 7 ------------- ------------- gwt 1 2 3 4 5 6 7 gwtgwt => 1 2 3 4 5 6 7 -""" +""" # noqa import flopy import numpy as np @@ -276,7 +276,8 @@ def build_gwfgwt_combo(sim, gwfname, gwtname, icombo): filename=f"{gwfname}.wel", ) - # pak_data = [ [] []] + # pak_data = [ ... + # [] []] rlen = delr rwid = delc rgrd = 1.0 diff --git a/autotest/test_gwt_sft_inactive01.py b/autotest/test_gwt_sft_inactive01.py index b09fc158104..e3d9dd99209 100644 --- a/autotest/test_gwt_sft_inactive01.py +++ b/autotest/test_gwt_sft_inactive01.py @@ -25,7 +25,7 @@ | | | | | | |/ | | | | | | |/ +-------+-------+-------+-------+-------+-------+ +-------+-------+-------+-------+-------+-------+ -""" +""" # noqa # Imports @@ -268,8 +268,8 @@ def get_conndat(n, lay, col): ) = set_connectiondata(n, lay, top, left, right, bottom) # If bottom most layer, need to .pop() the last values out of the respective lists - # This should be done because the bottom connections will always be represented by the final - # values in the list (at this point in the development anyway) + # This should be done because the bottom connections will always be represented by + # the final values in the list (at this point in the development anyway) # if lay == nlay - 1: # iac -= 1 # jas_vals.pop(-1) @@ -467,7 +467,8 @@ def build_models(idx, test): # SFR data nreaches = 15 - # + # ... + # rhk = 0.05 package_data = [ (0, 0, delr, 0.25, 1e-3, top - 0.25, 0.25, rhk, 0.02, 1, 1.0, 0), diff --git a/autotest/test_gwt_uzt01.py b/autotest/test_gwt_uzt01.py index afeb7ba149f..2eb7f7741ae 100644 --- a/autotest/test_gwt_uzt01.py +++ b/autotest/test_gwt_uzt01.py @@ -429,7 +429,8 @@ def check_obs(sim): if not is_same: success = False print( - "Binary concentrations do not match with observation concentrations for uzt1" + "Binary concentrations do not match with " + "observation concentrations for uzt1" ) print(conc_ra["BUZT1"], conc_uzt) @@ -458,7 +459,8 @@ def check_obs(sim): success = False diff = connection_sum - conc_ra[f"BMWTUZT{icv + 1}"] print( - f"Problem with UZT {icv + 1}; mindiff {diff.min()} and maxdiff {diff.max()}" + f"Problem with UZT {icv + 1}; " + f"mindiff {diff.min()} and maxdiff {diff.max()}" ) assert success, "One or more UZT obs checks did not pass" diff --git a/autotest/test_gwt_uztmvt2x2.py b/autotest/test_gwt_uztmvt2x2.py index 4cbc9ed815f..019d45d92a9 100644 --- a/autotest/test_gwt_uztmvt2x2.py +++ b/autotest/test_gwt_uztmvt2x2.py @@ -442,7 +442,8 @@ def build_models(idx, test): filename=f"{gwtname}.cnd", ) - # Instantiating MODFLOW 6 transport mass storage package (formerly "reaction" package in MT3DMS) + # Instantiating MODFLOW 6 transport mass storage package + # (formerly "reaction" package in MT3DMS) flopy.mf6.ModflowGwtmst( gwt, save_flows=True, diff --git a/autotest/test_netcdf_gwt_dsp01.py b/autotest/test_netcdf_gwt_dsp01.py index af8208b1b61..721b4c4b1b2 100644 --- a/autotest/test_netcdf_gwt_dsp01.py +++ b/autotest/test_netcdf_gwt_dsp01.py @@ -159,7 +159,10 @@ def check_output(idx, test, export, gridded_input): assert np.allclose( np.array(rec[l]).flatten(), xds[f"concentration_l{l+1}"][timestep, :].data, - ), f"NetCDF-concentration comparison failure in timestep {timestep+1}" + ), ( + "NetCDF-concentration comparison failure " + f"in timestep {timestep+1}" + ) timestep += 1 elif export == "structured": assert np.allclose( diff --git a/autotest/test_netcdf_gwt_prudic2004t2.py b/autotest/test_netcdf_gwt_prudic2004t2.py index 8c81c7a3cd9..ced4bfe0f11 100644 --- a/autotest/test_netcdf_gwt_prudic2004t2.py +++ b/autotest/test_netcdf_gwt_prudic2004t2.py @@ -149,7 +149,10 @@ def check_output(idx, test, export, gridded_input): xds[f"concentration_l{l+1}"][timestep, :] .fillna(1.00000000e30) .data, - ), f"NetCDF-concentration comparison failure in timestep {timestep+1}" + ), ( + "NetCDF-concentration comparison failure " + f"in timestep {timestep+1}" + ) timestep += 1 elif export == "structured": assert np.allclose( diff --git a/autotest/test_olf_dfw_swrt2dis.py b/autotest/test_olf_dfw_swrt2dis.py index b9f381a4fe2..eb6d5ac3f00 100644 --- a/autotest/test_olf_dfw_swrt2dis.py +++ b/autotest/test_olf_dfw_swrt2dis.py @@ -176,7 +176,7 @@ def make_plot(test, mfsim): lw=0.0, label=f"MF6 reach {irch}", ) - # ax.plot(obsvals["time"], answer[f"STAGE00000000{irch:02d}"], "k-", label=f"SWR Reach {irch}") + # ax.plot(obsvals["time"], answer[f"STAGE00000000{irch:02d}"], "k-", label=f"SWR Reach {irch}") # noqa ax.set_xlim(0, 30.0) ax.set_ylim(1.2, 2.4) plt.xlabel("time, in hours") diff --git a/autotest/test_par_gwf_splitter01.py b/autotest/test_par_gwf_splitter01.py index e41abb6e47b..8f92181cf26 100644 --- a/autotest/test_par_gwf_splitter01.py +++ b/autotest/test_par_gwf_splitter01.py @@ -169,9 +169,10 @@ def exact(x): for icol in range(grb.modelgrid.ncol): xc = xyc[0][icol] + xoff ref_value = exact(xc) - assert ( - heads[ilay, irow, icol] == pytest.approx(ref_value) - ), f"Comparing for model {model_name}, cell ({ilay},{irow},{icol}) failed" + assert heads[ilay, irow, icol] == pytest.approx(ref_value), ( + f"Comparing for model {model_name}, " + f"cell ({ilay},{irow},{icol}) failed" + ) @pytest.mark.parallel diff --git a/autotest/test_prt_stop_zones.py b/autotest/test_prt_stop_zones.py index 53a614c666c..3eaf0f772ee 100644 --- a/autotest/test_prt_stop_zones.py +++ b/autotest/test_prt_stop_zones.py @@ -321,7 +321,9 @@ def check_output(idx, test): ) def sort_square_verts(verts): - """Sort 4 or more points on a square in clockwise order, starting with the top-left point""" + """Sort 4 or more points on a square in clockwise order, + starting with the top-left point + """ # sort by y coordinate verts.sort(key=lambda v: v[1], reverse=True) diff --git a/autotest/test_prt_track_events.py b/autotest/test_prt_track_events.py index 77ded7def6c..0a4ad472f47 100644 --- a/autotest/test_prt_track_events.py +++ b/autotest/test_prt_track_events.py @@ -401,7 +401,9 @@ def all_equal(col, val): ) # check that particle names are particle indices - # assert len(mf6_pldata) == len(mf6_pldata[mf6_pldata['irpt'].astype(str).eq(mf6_pldata['name'])]) + # assert len(mf6_pldata) == len( + # mf6_pldata[mf6_pldata["irpt"].astype(str).eq(mf6_pldata["name"])] + # ) # get head, budget, and spdis results from GWF model hds = HeadFile(gwf_ws / gwf_head_file).get_data() diff --git a/autotest/test_prt_weak_sinks.py b/autotest/test_prt_weak_sinks.py index ece13e63a1f..545b82b9750 100644 --- a/autotest/test_prt_weak_sinks.py +++ b/autotest/test_prt_weak_sinks.py @@ -170,7 +170,9 @@ def build_mp7_sim(name, ws, mp7, gwf): def get_different_rows(source_df, new_df): - """Returns just the rows from the new dataframe that differ from the source dataframe""" + """Returns just the rows from the new dataframe that differ + from the source dataframe + """ merged_df = source_df.merge(new_df, indicator=True, how="outer") changed_rows_df = merged_df[merged_df["_merge"] == "right_only"] return changed_rows_df.drop("_merge", axis=1) @@ -245,7 +247,8 @@ def check_output(idx, test): # load mf6 pathline results mf6_pls = pd.read_csv(prt_ws / prt_track_csv_file) - # if STOP_AT_WEAK_SINK disabled, check for an extra datum when particle exited weak sink + # if STOP_AT_WEAK_SINK disabled, + # check for an extra datum when particle exited weak sink wksk_irsn = get_ireason_code("WEAKSINK") assert len(mf6_pls[mf6_pls["ireason"] == wksk_irsn]) == ( 1 if "saws" not in name else 0 diff --git a/distribution/benchmark.py b/distribution/benchmark.py index cb0b42a4543..89344350b3e 100644 --- a/distribution/benchmark.py +++ b/distribution/benchmark.py @@ -335,7 +335,9 @@ def run_benchmarks( output_path: PathLike, excluded: List[str] = [], ): - """Benchmark current development version against previous release with example models.""" + """Benchmark current development version against previous release + with example models. + """ build_path = Path(build_path).expanduser().absolute() current_bin_path = Path(current_bin_path).expanduser().absolute() @@ -421,8 +423,8 @@ def test_run_benchmarks(tmp_path): formatter_class=argparse.RawDescriptionHelpFormatter, epilog=textwrap.dedent( """\ - Benchmarks the current version of MODFLOW 6 against the latest official release, - with the example models stored in the MODFLOW-USGS/modflow6-examples repository. + Benchmarks the current version of MODFLOW 6 against the latest official release, + with the example models stored in the MODFLOW-USGS/modflow6-examples repository. """ ), ) diff --git a/distribution/build_docs.py b/distribution/build_docs.py index 053307bce49..6e5f73405ff 100644 --- a/distribution/build_docs.py +++ b/distribution/build_docs.py @@ -505,12 +505,12 @@ def test_build_documentation(tmp_path): formatter_class=argparse.RawDescriptionHelpFormatter, epilog=textwrap.dedent( """\ - Create documentation for a distribution. By default, this only includes the mf6io PDF - document. If the --full flag is provided this includes benchmarks, release notes, the - MODFLOW 6 input/output specification, example model documentation, supplemental info, - documentation for the MODFLOW 5 to 6 converter and Zonebudget 6, and several articles - downloaded from the USGS website. These are all written to a specified --output-path. - Additional LaTeX files may be included in the distribution by specifying --tex-paths. +Create documentation for a distribution. By default, this only includes the mf6io PDF +document. If the --full flag is provided this includes benchmarks, release notes, the +MODFLOW 6 input/output specification, example model documentation, supplemental info, +documentation for the MODFLOW 5 to 6 converter and Zonebudget 6, and several articles +downloaded from the USGS website. These are all written to a specified --output-path. +Additional LaTeX files may be included in the distribution by specifying --tex-paths. """ ), ) diff --git a/distribution/update_version.py b/distribution/update_version.py index 42488f81d5a..934f7097fbb 100755 --- a/distribution/update_version.py +++ b/distribution/update_version.py @@ -13,20 +13,23 @@ ../code.json ../src/Utilities/version.f90 -Information in these files include version number (major.minor.patch[label]), build timestamp, -whether or not the release is preliminary/provisional or official/approved, whether the source -code should be compiled in develop mode (IDEVELOPMODE = 1) or for release, and other metadata. - -The version number is read from ../version.txt, which contains major, minor, and patch version -numbers, and an optional label. Version numbers are substituted into source code, latex files, -markdown files, etc. The version number can be provided explicitly using --version, short -v. - -If the --releasemode flag is provided, IDEVELOPMODE is set to 0 in src/Utilities/version.f90. -Otherwise, IDEVELOPMODE is set to 1. - -if the --approved flag (short -a) is provided, the disclaimer in src/Utilities/version.f90 and -the README/DISCLAIMER markdown files is modified to reflect review and approval. Otherwise the -language reflects preliminary/provisional status, and version strings contain "(preliminary)". +Information in these files include version number (major.minor.patch[label]), build +timestamp, whether or not the release is preliminary/provisional or official/approved, +whether the source code should be compiled in develop mode (IDEVELOPMODE = 1) or for +release, and other metadata. + +The version number is read from ../version.txt, which contains major, minor, and patch +version numbers, and an optional label. Version numbers are substituted into source +code, latex files, markdown files, etc. The version number can be provided explicitly +using --version, short -v. + +If the --releasemode flag is provided, IDEVELOPMODE is set to 0 in +src/Utilities/version.f90. Otherwise, IDEVELOPMODE is set to 1. + +if the --approved flag (short -a) is provided, the disclaimer in +src/Utilities/version.f90 and the README/DISCLAIMER markdown files is modified to +reflect review and approval. Otherwise the language reflects preliminary/provisional +status, and version strings contain "(preliminary)". """ import argparse @@ -160,7 +163,8 @@ def get_software_citation( # add the rest of the citation line += ( - f", {timestamp.year}, MODFLOW 6 Modular Hydrologic Model version {version}{sb}: " + f", {timestamp.year}, " + f"MODFLOW 6 Modular Hydrologic Model version {version}{sb}: " f"U.S. Geological Survey Software Release, {timestamp:%-d %B %Y}, " "https://doi.org/10.5066/P9FL1JCC" ) @@ -468,21 +472,24 @@ def test_update_version(version, approved, developmode): "--approved", required=False, action="store_true", - help="Approve the release version (defaults to false for preliminary/development distributions)", + help="Approve the release version " + "(defaults to false for preliminary/development distributions)", ) parser.add_argument( "-r", "--releasemode", required=False, action="store_true", - help="Set IDEVELOPMODE to 0 for release mode (defaults to false for development distributions)", + help="Set IDEVELOPMODE to 0 for release mode " + "(defaults to false for development distributions)", ) parser.add_argument( "-g", "--get", required=False, action="store_true", - help="Get the current version number, don't update anything (defaults to false)", + help="Get the current version number, don't update anything " + "(defaults to false)", ) parser.add_argument( "-c", diff --git a/doc/ReleaseNotes/mk_deprecations.py b/doc/ReleaseNotes/mk_deprecations.py index 9163e7227d2..765f9790b59 100644 --- a/doc/ReleaseNotes/mk_deprecations.py +++ b/doc/ReleaseNotes/mk_deprecations.py @@ -32,7 +32,7 @@ \hline \endhead - """ + """ # noqa footer = r""" \hline diff --git a/doc/ReleaseNotes/mk_runtimecomp.py b/doc/ReleaseNotes/mk_runtimecomp.py index 67edcdc4c31..48b4a4bf4a4 100644 --- a/doc/ReleaseNotes/mk_runtimecomp.py +++ b/doc/ReleaseNotes/mk_runtimecomp.py @@ -38,7 +38,7 @@ \hline \endhead - """ + """ # noqa footer = r""" \hline @@ -72,7 +72,8 @@ ftex.write(footer) ftex.close() print( - f"Created LaTex file {fnametex} from markdown benchmark results file {fpath}" + f"Created LaTex file {fnametex} " + f"from markdown benchmark results file {fpath}" ) else: warn(f"Benchmark results not found: {fpath}") diff --git a/doc/mf6io/mf6ivar/deprecations.py b/doc/mf6io/mf6ivar/deprecations.py index 9f2efe0f5f5..3a8d89a42be 100644 --- a/doc/mf6io/mf6ivar/deprecations.py +++ b/doc/mf6io/mf6ivar/deprecations.py @@ -40,12 +40,18 @@ def create_deprecations_file(dfndir, mddir, verbose): print(f"Found {len(deprecations)} deprecations, writing {deps_path}") with open(deps_path, "w") as f: s = "#### Deprecations\n\n" - s += "The following table lists deprecated options and the versions in which they were deprecated and (optionally) removed.\n\n" + s += ( + "The following table lists deprecated options and the versions " + "in which they were deprecated and (optionally) removed.\n\n" + ) if any(deprecations): s += "| Model-Package | Option | Deprecated | Removed |\n" s += "|:--------------|:-------|:-----------|:--------|\n" for file, option, deprecated, removed in deprecations: - s += f"| {file.stem} | {option} | {deprecated} | {removed if removed else ''} |\n" + s += ( + f"| {file.stem} | {option} | {deprecated} " + f"| {removed if removed else ''} |\n" + ) if len(s) > 0: s += "\n" f.write(s) diff --git a/doc/mf6io/mf6ivar/mf6ivar.py b/doc/mf6io/mf6ivar/mf6ivar.py index 4f423ac7a8b..ad4deeca5d6 100644 --- a/doc/mf6io/mf6ivar/mf6ivar.py +++ b/doc/mf6io/mf6ivar/mf6ivar.py @@ -92,7 +92,8 @@ # change FILE ctabname to TABLE_FILENAME table_filename # STATUS not implemented yet, but it is described in input instructions # invert indicates an integer variable. change to dinvert? -# time series variables are listed as "real or character ..." should just be double precision +# time series variables are listed as "real or character ..." +# should just be double precision # capitalize example input file words that are recognized by mf6 # # uzf @@ -108,7 +109,8 @@ # # mvr # change maxpackages to npackages -# Included WEL, DRN, RIV, GHB as providers, though that is not supported in the code yet +# Included WEL, DRN, RIV, GHB as providers, +# though that is not supported in the code yet # # oc # output control rewritten entirely, and implemented in the code @@ -119,13 +121,15 @@ # name :: variable name # in_record :: optional True or False, False if not specified # type :: recarray, record, keyword, integer, double precision, keystring -# tagged :: optional True or False, True if not specified. If tagged, then keyword comes before value +# tagged :: optional True or False, True if not specified. +# If tagged, then keyword comes before value # shape :: (size), optional, only required for arrays # valid :: description of valid values # reader :: urword, readarray, u1dint, ... # optional :: optional True or False, False if not specified # longname :: long name for variable -# description :: description for variable, REPLACE tag indicates that description will come from common.dfn +# description :: description for variable, REPLACE tag indicates that +# description will come from common.dfn import os @@ -615,7 +619,8 @@ def write_appendix(blocks): ) f.write("\\hline\n\\hline\n") f.write( - "\\textbf{Component} & \\textbf{FTYPE} & \\textbf{Blockname} & \\textbf{OPEN/CLOSE} \\\\\n" + "\\textbf{Component} & \\textbf{FTYPE} & \\textbf{Blockname} & " + "\\textbf{OPEN/CLOSE} \\\\\n" ) f.write("\\hline\n\\endfirsthead\n\n\n") @@ -629,7 +634,8 @@ def write_appendix(blocks): f.write("\n\\hline\n\\hline\n") f.write( - "\\textbf{Component} & \\textbf{FTYPE} & \\textbf{Blockname} & \\textbf{OPEN/CLOSE} \\\\\n" + "\\textbf{Component} & \\textbf{FTYPE} & \\textbf{Blockname} & " + "\\textbf{OPEN/CLOSE} \\\\\n" ) f.write("\\hline\n\\endhead\n\n\\hline\n\\endfoot\n\n\n") @@ -798,7 +804,11 @@ def write_variables(): if "sln-ims" in mdname: with open("../ims_table.tex", "r") as fims: lines = fims.readlines() - s = "\n\n#### IMS variable values for the available complexity options\n" + s = ( + "\n\n" + "#### IMS variable values for the " + "available complexity options\n" + ) for line in lines: line = md_replace(line.rstrip()) save_line = True diff --git a/ruff.toml b/ruff.toml index eef8708cb55..0cd8006214b 100644 --- a/ruff.toml +++ b/ruff.toml @@ -18,7 +18,6 @@ select = [ "I001", # isort - unsorted-imports ] ignore = [ - "E501", # line too long TODO FIXME "E722", # do not use bare `except` "E741", # ambiguous variable name "F821", # undefined name TODO FIXME @@ -29,4 +28,4 @@ ignore = [ quote-style = "double" indent-style = "space" skip-magic-trailing-comma = false -line-ending = "lf" \ No newline at end of file +line-ending = "lf" diff --git a/utils/idmloader/scripts/dfn2f90.py b/utils/idmloader/scripts/dfn2f90.py index 8ca3b5fb7eb..fdaea6d333e 100644 --- a/utils/idmloader/scripts/dfn2f90.py +++ b/utils/idmloader/scripts/dfn2f90.py @@ -81,8 +81,9 @@ def write_f90(self, ofspec=None): # subpackage f.write( - f" character(len=16), parameter :: &\n" - f" {self.component.lower()}_{self.subcomponent.lower()}_subpackages(*) = &\n" + f" character(len=16), parameter :: &\n " + f"{self.component.lower()}_{self.subcomponent.lower()}_subpackages(*) " + "= &\n" ) if not len(self._subpackage): self._subpackage.append("".ljust(16)) @@ -984,7 +985,8 @@ def _write_master_component(self, fh=None): "--dfn", required=False, default=DEFAULT_DFNS_PATH, - help="Path to a DFN file, or to a text or YAML file listing DFN files (one per line)", + help="Path to a DFN file, or to a text or YAML file listing DFN files " + "(one per line)", ) parser.add_argument( "-o",