Skip to content

Commit

Permalink
Modified helpers a little bit to account for when using 1 dimensions …
Browse files Browse the repository at this point in the history
…in unstructured grid, there was a conflict with the array shapes
  • Loading branch information
Jonathan Quiroz committed Dec 6, 2024
1 parent 5628a82 commit b602305
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pyemu/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,8 @@ def _process_array_file(model_file, df):
if pd.isna(mlt):
continue
mlt_data = np.loadtxt(mlt, ndmin=2)
if 1 in list(mlt_data.shape): # if 1d arrays
org_arr = org_arr.reshape(mlt_data.shape)
if org_arr.shape != mlt_data.shape:
raise Exception(
"shape of org file {}:{} differs from mlt file {}:{}".format(
Expand Down
4 changes: 2 additions & 2 deletions pyemu/utils/pst_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ def add_py_function(
)
func_lines = []
search_str = "def " + function_name + "("
abet_set = set(string.printable) - {' '}
abet_set = set(string.printable) - {' ','\n','\t'}
with open(file_name, "r") as f:
while True:
line = f.readline()
Expand All @@ -1313,7 +1313,6 @@ def add_py_function(
break
func_lines.append(line)
break

self._function_lines_list.append(func_lines)
if is_pre_cmd is True:
self.pre_py_cmds.append(call_str)
Expand Down Expand Up @@ -2676,6 +2675,7 @@ def add_parameters(
# put the sr dict info into a df
# but we only want to use the n
if use_zone_array:
print(np.unique(zone_array))
for zone in np.unique(zone_array):
if int(zone) == 0:
continue
Expand Down

0 comments on commit b602305

Please sign in to comment.