Skip to content

Commit

Permalink
chore: Sort index level 0 in pack_df_debug function and remove unnece…
Browse files Browse the repository at this point in the history
…ssary code in _run.py
  • Loading branch information
sunt05 committed Aug 5, 2024
1 parent 9e5cd55 commit 86367e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/supy/_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def pack_df_debug(dict_debug):
)
df_debug = (
df_debug_raw.unstack(level=["group", "var"])
# .sort_index(level=0, axis=1)
.sort_index(level=0, axis=1)
.dropna(axis=1, how="all")
)
return df_debug
8 changes: 2 additions & 6 deletions src/supy/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,8 @@ def suews_cal_tstep_multi(dict_state_start, df_forcing_block):
"len_sim": np.array(df_forcing_block.shape[0], dtype=int),
}
)
# print("list_var_input_multitsteps", sorted(list_var_input_multitsteps))
# print("dict_input.keys()", sorted(dict_input.keys()))
# set_dif=set(dict_input.keys()) - set(list_var_input_multitsteps)
# print("set_dif", sorted(set_dif))

dict_input = {k: dict_input[k] for k in list_var_input_multitsteps}
# dict_input = {k: dict_input[k] if k in dict_input else np.array([0.0]) for k in list_var_input_multitsteps}

# main calculation:

Expand Down Expand Up @@ -434,7 +430,7 @@ def run_supy_ser(

# collect debug info
dict_debug = {
(tstep_final + freq, grid): debug
(tstep_final, grid): debug
for grid, debug in zip(list_grid, list_dict_debug)
}
df_debug = pack_df_debug(dict_debug)
Expand Down

0 comments on commit 86367e2

Please sign in to comment.