From f39244ebeb96b08121cd6b186c5c96470d594213 Mon Sep 17 00:00:00 2001 From: mjreno Date: Mon, 28 Oct 2024 17:57:37 -0400 Subject: [PATCH] remove temp path checks --- flopy4/compound.py | 22 ++++++++-------------- test/test_sim.py | 9 --------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/flopy4/compound.py b/flopy4/compound.py index 96e419c..2163a6d 100644 --- a/flopy4/compound.py +++ b/flopy4/compound.py @@ -381,25 +381,19 @@ def load(cls, f, **kwargs) -> "MFList": tokens = strip(line).split(maxsplit=maxsplit) assert len(tokens) == sum(param_cols) icol = 0 - for i, p in enumerate(param_lists): - if param_cols[i] == 1: + for i in range(len(param_types)): + row_l = [] + for j in range(param_cols[i]): if param_types[i] == "integer": - param_lists[i].append(int(tokens[icol])) + row_l.append(int(tokens[icol])) elif param_types[i] == "double": - param_lists[i].append(float(tokens[icol])) + row_l.append(float(tokens[icol])) else: - param_lists[i].append(tokens[icol]) + row_l.append(tokens[icol]) icol += 1 + if param_cols[i] == 1: + param_lists[i].append(row_l[0]) else: - row_l = [] - for j in range(param_cols[i]): - if param_types[i] == "integer": - row_l.append(int(tokens[icol])) - elif param_types[i] == "double": - row_l.append(float(tokens[icol])) - else: - row_l.append(tokens[icol]) - icol += 1 param_lists[i].append(row_l) if blk_params and "dimensions" in blk_params: diff --git a/test/test_sim.py b/test/test_sim.py index 382285c..fb7650f 100644 --- a/test/test_sim.py +++ b/test/test_sim.py @@ -144,15 +144,10 @@ def test_load_sim(tmp_path): assert "exchanges" in s.nam assert "solutiongroup" in s.nam assert "tdis6" in s.nam["timing"] - assert s.nam["timing"]["tdis6"].value == f"{tmp_path}/sim.tdis" assert "mtype" in s.nam["models"].params["models"] assert "mfname" in s.nam["models"].params["models"] assert "mname" in s.nam["models"].params["models"] assert s.nam["models"].params["models"]["mtype"][0] == "GWF6" - assert ( - s.nam["models"].params["models"]["mfname"][0] - == f"{tmp_path}/{name}.nam" - ) assert s.nam["models"].params["models"]["mname"][0] == f"{name}" assert "slntype" in s.nam["solutiongroup"].params["solutiongroup"] assert "slnfname" in s.nam["solutiongroup"].params["solutiongroup"] @@ -160,10 +155,6 @@ def test_load_sim(tmp_path): assert ( s.nam["solutiongroup"].params["solutiongroup"]["slntype"][0] == "ims6" ) - assert ( - s.nam["solutiongroup"].params["solutiongroup"]["slnfname"][0] - == f"{tmp_path}/{name}.ims" - ) assert ( s.nam["solutiongroup"].params["solutiongroup"]["slnmnames"][0] == f"{name}"